feat(issue): add issue dependency tools with correct Forgejo API contract #335

Merged
MaherMakerHallerErne merged 0 commits from feature/issue-dependency-tools-upstream-api into main 2026-07-23 03:23:58 +00:00
MaherMakerHallerErne commented 2026-07-09 13:34:51 +00:00 (Migrated from codeberg.org)

Adds four MCP tools for managing issue dependencies:

list_issue_dependencies — issues the given issue depends on
list_issue_dependents — issues that depend on the given issue
add_issue_dependency — create a dependency relationship
remove_issue_dependency — remove a dependency relationship
Uses the raw HTTP helpers in forgejo because the pinned SDK does not expose typed dependency methods. The mutation endpoints use the Forgejo IssueMeta body shape ({index, owner, repo}), confirmed against a live Codeberg instance.

Includes handler tests for request paths, body shape, self-dependency rejection, API error surfacing, and 404-as-empty-list behavior.

Closes the issue dependency feature gap.

Adds four MCP tools for managing issue dependencies: list_issue_dependencies — issues the given issue depends on list_issue_dependents — issues that depend on the given issue add_issue_dependency — create a dependency relationship remove_issue_dependency — remove a dependency relationship Uses the raw HTTP helpers in forgejo because the pinned SDK does not expose typed dependency methods. The mutation endpoints use the Forgejo IssueMeta body shape ({index, owner, repo}), confirmed against a live Codeberg instance. Includes handler tests for request paths, body shape, self-dependency rejection, API error surfacing, and 404-as-empty-list behavior. Closes the issue dependency feature gap.
op1st-gitops commented 2026-07-09 13:34:54 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code is skipping this commit.
User MaherMakerHallerErne is not allowed to trigger CI via pull_request in this repo.

op1st Pipelines as Code is skipping this commit. User MaherMakerHallerErne is not allowed to trigger CI via pull_request in this repo.
goern commented 2026-07-10 04:17:30 +00:00 (Migrated from codeberg.org)

/ok-to-test

/ok-to-test
op1st-gitops commented 2026-07-10 04:17:34 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-qlwbk is running.

Starting Pipelinerun forgejo-mcp-code-scans-qlwbk in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-qlwbk -f

op1st Pipelines as Code/forgejo-mcp-code-scans-qlwbk is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-qlwbk](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-qlwbk)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-qlwbk) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-qlwbk -f</code>
op1st-gitops commented 2026-07-10 04:17:34 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-nbs9x is running.

Starting Pipelinerun forgejo-mcp-on-pull-request-nbs9x in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-nbs9x -f

op1st Pipelines as Code/forgejo-mcp-on-pull-request-nbs9x is running. Starting Pipelinerun <b>[forgejo-mcp-on-pull-request-nbs9x](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-nbs9x)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-nbs9x) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-nbs9x -f</code>
op1st-gitops commented 2026-07-10 04:17:57 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-qlwbk has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 12 seconds

fetch-source

Succeeded 10 seconds

gitleaks-version

Succeeded 11 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-qlwbk has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-qlwbk">forgejo-mcp-code-scans-qlwbk</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>12 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-qlwbk/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>10 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-qlwbk/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>11 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-qlwbk/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-07-10 04:19:54 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-nbs9x has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 15 seconds

fetch-source

Succeeded 2 minutes

build-and-test

Succeeded 16 seconds

commit-title-check

op1st Pipelines as Code/forgejo-mcp-on-pull-request-nbs9x has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-nbs9x">forgejo-mcp-on-pull-request-nbs9x</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>15 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-nbs9x/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>2 minutes</td><td> [build-and-test](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-nbs9x/logs/build-and-test) </td></tr> <tr> <td>Succeeded</td> <td>16 seconds</td><td> [commit-title-check](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-nbs9x/logs/commit-title-check) </td></tr> </table>
op1st-gitops commented 2026-07-13 08:28:33 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-n6bw6 is running.

Starting Pipelinerun forgejo-mcp-code-scans-n6bw6 in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-n6bw6 -f

op1st Pipelines as Code/forgejo-mcp-code-scans-n6bw6 is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-n6bw6](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-n6bw6)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-n6bw6) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-n6bw6 -f</code>
op1st-gitops commented 2026-07-13 08:28:33 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-lp47v is running.

Starting Pipelinerun forgejo-mcp-on-pull-request-lp47v in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-lp47v -f

op1st Pipelines as Code/forgejo-mcp-on-pull-request-lp47v is running. Starting Pipelinerun <b>[forgejo-mcp-on-pull-request-lp47v](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-lp47v)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-lp47v) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-lp47v -f</code>
op1st-gitops commented 2026-07-13 08:28:59 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-n6bw6 has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 12 seconds

fetch-source

Succeeded 10 seconds

gitleaks-version

Succeeded 14 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-n6bw6 has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-n6bw6">forgejo-mcp-code-scans-n6bw6</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>12 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-n6bw6/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>10 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-n6bw6/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>14 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-n6bw6/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-07-13 08:31:03 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-lp47v has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 12 seconds

fetch-source

Succeeded 2 minutes

build-and-test

Succeeded 17 seconds

commit-title-check

op1st Pipelines as Code/forgejo-mcp-on-pull-request-lp47v has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-lp47v">forgejo-mcp-on-pull-request-lp47v</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>12 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-lp47v/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>2 minutes</td><td> [build-and-test](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-lp47v/logs/build-and-test) </td></tr> <tr> <td>Succeeded</td> <td>17 seconds</td><td> [commit-title-check](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-lp47v/logs/commit-title-check) </td></tr> </table>
synath-bot commented 2026-07-18 17:25:51 +00:00 (Migrated from codeberg.org)

We took this PR for a spin against Codeberg (live instance) and want to share the results as a datapoint: all four tools work as specified; the pagination revision (page/limit echoed in the response) behaves as documented; and the 404-as-empty-list behavior matches Forgejo's habit. Handler tests pass. Nice work.

One gap worth considering before merge: the mutation body hardcodes owner/repo to the target issue's repo, so cross-repo dependencies can't be created — even though the IssueMeta body shape exists precisely to express them, and Codeberg accepts them (we verified a cross-repo add → list → remove cycle live). We extended the tools with optional depends_on_owner/depends_on_repo (add) and dependency_owner/dependency_repo (remove), defaulting to the target repo, with the self-dependency check scoped to same-repo — including tests for the cross-repo body shape and the same-index-different-repo case. The change is one commit on top of this branch: synath/forgejo-mcp@658e7f2 (branch feat/issue-dependency-cross-repo). Happy to open it as a follow-up PR once this lands, or @MaherMakerHallerErne is welcome to cherry-pick it into this PR directly.

(Posted by synath's Claude agent on David's behalf — testing and the cross-repo extension were agent work.)

We took this PR for a spin against Codeberg (live instance) and want to share the results as a datapoint: all four tools work as specified; the pagination revision (page/limit echoed in the response) behaves as documented; and the 404-as-empty-list behavior matches Forgejo's habit. Handler tests pass. Nice work. One gap worth considering before merge: the mutation body hardcodes `owner`/`repo` to the target issue's repo, so **cross-repo dependencies can't be created** — even though the `IssueMeta` body shape exists precisely to express them, and Codeberg accepts them (we verified a cross-repo add → list → remove cycle live). We extended the tools with optional `depends_on_owner`/`depends_on_repo` (add) and `dependency_owner`/`dependency_repo` (remove), defaulting to the target repo, with the self-dependency check scoped to same-repo — including tests for the cross-repo body shape and the same-index-different-repo case. The change is one commit on top of this branch: [`synath/forgejo-mcp@658e7f2`](https://codeberg.org/synath/forgejo-mcp/commit/658e7f2) (branch `feat/issue-dependency-cross-repo`). Happy to open it as a follow-up PR once this lands, or @MaherMakerHallerErne is welcome to cherry-pick it into this PR directly. *(Posted by synath's Claude agent on David's behalf — testing and the cross-repo extension were agent work.)*
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp!335
No description provided.