Skip to content

feat: enable proven Forgejo and Gitea mutations#275

Merged
mariusvniekerk merged 6 commits into
mainfrom
forge-mutation-capabilities
May 8, 2026
Merged

feat: enable proven Forgejo and Gitea mutations#275
mariusvniekerk merged 6 commits into
mainfrom
forge-mutation-capabilities

Conversation

@mariusvniekerk
Copy link
Copy Markdown
Collaborator

Enable SDK-backed comment, issue creation, state/content edit, merge, and review approval capabilities for Forgejo and Gitea providers. Workflow approval and ready-for-review remain unsupported until those operations are proven through provider interfaces and tests.

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (65abe58)

Enabling Gitea/Forgejo mutations has medium-risk correctness and coverage gaps that should be addressed before merge.

Medium

  • internal/platform/gitealike/provider.go:282
    Edited merge-request comments are normalized with merge request number 0, so the returned event can be associated with the wrong MR and may corrupt or update the wrong local activity row.
    Fix: Preserve the owning MR/issue number when editing comments, either by passing it through the mutator API or enriching CommentDTO from the transport response before normalization.

  • internal/platform/gitea/client.go:87, internal/platform/forgejo/client.go:88
    Core mutation workflows are enabled for Gitea/Forgejo without full-stack e2e coverage through the HTTP API and SQLite persistence path.
    Fix: Add e2e tests for representative Gitea/Forgejo mutation endpoints, including merge, comment, state flows, and local DB updates.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 65abe58 to 6e24689 Compare May 7, 2026 12:45
@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from f43b11a to 3930d2d Compare May 7, 2026 12:45
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (6e24689)

No Medium, High, or Critical issues were reported.

All review agents found the code clean or provided no findings.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (0fd2c47)

No Medium-or-higher issues found across the reviews.

All agents that reported findings agree the code is clean.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from 5d5ec50 to ad6128b Compare May 7, 2026 20:14
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 0fd2c47 to c1dae33 Compare May 7, 2026 20:14
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (c1dae33)

No Medium, High, or Critical findings were reported.

All review agents agree the code is clean for the requested severity threshold.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from ad6128b to baf99d9 Compare May 7, 2026 20:28
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from c1dae33 to 0862fad Compare May 7, 2026 20:28
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (0862fad)

Summary verdict: one medium test coverage gap remains; no high or critical issues were reported.

Medium

  • internal/server/api_test.go:8636 - The new full-stack Gitea-like mutation test covers comments, review, merge, state changes, and issue creation, but does not exercise the server API path for editing PR title/body, even though the change enables EditMergeRequestContent for Gitea/Forgejo. Add coverage to TestAPIGitealikeMutationsPersistThroughServer or a similar e2e test that calls the PR content edit endpoint and asserts the updated title/body persist.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (f2bfea8)

Merge support has one medium-severity provider error-handling regression to fix before merging.

Medium

  • internal/server/huma_routes.go:1717: Gitea/Forgejo merge failures now surface through gitealike.HTTPError, but mergePR only preserves status/details for *github.ErrorResponse. Provider-side 409, 405, or 422 merge failures can be returned as generic 502s and skip the conflict-sync path.

    Fix: Add platform-neutral HTTP/status error handling for non-GitHub providers. Map merge conflicts and method-not-allowed responses to 409 with sync, and forward other relevant 4xx statuses where appropriate.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from baf99d9 to 68ac4be Compare May 7, 2026 20:51
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (4e48478)

No Medium, High, or Critical issues found.

All review outputs are clean.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from 8b7f592 to 68796b2 Compare May 8, 2026 00:31
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 4e48478 to 940615d Compare May 8, 2026 00:31
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 8, 2026

roborev: Combined Review (940615d)

No Medium, High, or Critical issues found across the reviews.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from 68796b2 to 48ac4af Compare May 8, 2026 00:38
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 940615d to 8a29033 Compare May 8, 2026 00:38
@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from 48ac4af to 559c53b Compare May 8, 2026 00:42
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 8a29033 to 8331476 Compare May 8, 2026 00:42
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 8, 2026

roborev: Combined Review (8a29033)

No Medium, High, or Critical findings were reported.

All review agents found no actionable issues to include.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from 559c53b to 3673e48 Compare May 8, 2026 00:45
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 8331476 to 8a9218a Compare May 8, 2026 00:45
@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from 3673e48 to e6eaace Compare May 8, 2026 00:47
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 8a9218a to 3702e76 Compare May 8, 2026 00:47
@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from e6eaace to aa27d54 Compare May 8, 2026 00:49
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 3702e76 to 1e4c257 Compare May 8, 2026 00:49
@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from aa27d54 to a8fa36d Compare May 8, 2026 00:51
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 1e4c257 to 5a489f5 Compare May 8, 2026 00:51
@mariusvniekerk mariusvniekerk force-pushed the forge-container-e2e-fixtures branch from a8fa36d to ba8b0be Compare May 8, 2026 00:52
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from 5a489f5 to bb46abc Compare May 8, 2026 00:52
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 8, 2026

roborev: Combined Review (bb46abc)

No Medium, High, or Critical findings were reported.

All agents that provided review content found the code clean for reportable issues.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

Base automatically changed from forge-container-e2e-fixtures to main May 8, 2026 00:57
Enable SDK-backed comment, issue creation, state/content edit, merge, and review approval capabilities for Forgejo and Gitea providers. Workflow approval and ready-for-review remain unsupported until those operations are proven through provider interfaces and tests.
Pass the owning issue or pull request number through comment edit mutators so provider-normalized events keep the correct local association before persistence.
Exercise Gitea-backed comment, review, merge, state, and issue mutation endpoints through the generated HTTP client and assert the SQLite rows updated by each representative workflow.
The mutation API test lives on the mutation branch, so it must use WithMutations there rather than relying on the tip branch cleanup.
Gitea and Forgejo merge failures surface as gitealike HTTP errors, not GitHub errors. Map those statuses through the same merge policy so conflicts refresh the pull request and provider 4xx messages reach the UI instead of becoming generic 502 responses.
Wrap Forgejo and Gitea SDK mutation calls with the same context guard used by reads so cancellation and SDK context locking remain consistent.

Extend the full API and SQLite mutation regression to cover PR title/body edits.
@mariusvniekerk mariusvniekerk force-pushed the forge-mutation-capabilities branch from bb46abc to 3d54dbf Compare May 8, 2026 00:58
@mariusvniekerk mariusvniekerk merged commit 973ea30 into main May 8, 2026
8 of 9 checks passed
@mariusvniekerk mariusvniekerk deleted the forge-mutation-capabilities branch May 8, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant