Skip to content

feat: read Forgejo and Gitea through shared provider core#270

Open
mariusvniekerk wants to merge 5 commits intoforgejo-gitea-sdk-convertersfrom
forgejo-gitea-read-apis
Open

feat: read Forgejo and Gitea through shared provider core#270
mariusvniekerk wants to merge 5 commits intoforgejo-gitea-sdk-convertersfrom
forgejo-gitea-read-apis

Conversation

@mariusvniekerk
Copy link
Copy Markdown
Collaborator

Wire the Forgejo and Gitea SDK clients into the shared gitealike provider so repository, merge request, issue, release, tag, and CI read paths use the same pagination and typed error behavior. Forgejo includes action runs in CI checks where the SDK exposes them; Gitea stays on commit statuses only.

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (b01a2a4)

High: Forgejo/Gitea read capabilities need end-to-end coverage before merge.

High

  • internal/platform/forgejo/client.go:90, internal/platform/gitea/client.go:87
    • The new Forgejo and Gitea providers now advertise full read capabilities for repository, PR/issue, release/tag, and CI sync paths, but coverage appears limited to package-level unit/httptest tests.
    • This is a major data-flow change through sync, SQLite persistence, and the HTTP API, so integration regressions could ship undetected.
    • Add E2E coverage for Forgejo and Gitea sync/import using the real server/API path and SQLite, asserting persisted repositories, PRs/issues, events, releases/tags, and CI checks.

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 (22d5fab)

No Medium, High, or Critical findings were reported.

All agents either found no issues or provided no findings in scope for this PR comment.


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 (529ef18)

PR review summary: one medium-risk issue remains; no high or critical findings were reported.

Medium

  • internal/platform/forgejo/read.go:279 - Forgejo CI reads always call the Actions runs endpoint after reading commit statuses. If Actions are disabled or unsupported on a Forgejo host, a 404 from /actions/runs makes ListCIChecks fail and discards otherwise valid commit statuses, causing MR CI refresh to fail. Treat action-run 404/unsupported errors as optional and return the status checks already collected, or feature-detect/configure Actions support before enabling ReadActions.

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

@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 90ac716 to e278070 Compare May 7, 2026 20:13
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from 529ef18 to e409f6a Compare May 7, 2026 20:13
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (e409f6a)

Medium-severity coverage gaps remain in the new Gitea/Forgejo read-provider integration.

Medium

  • internal/server/api_test.go:8494
    The full-stack read-sync coverage only registers platform.KindForgejo. The new Gitea read path advertises capabilities and participates in the same server/API/SQLite workflow, but lacks e2e coverage for provider identity, persisted data, and API responses.
    Fix: Table-drive the e2e over both platform.KindForgejo and platform.KindGitea, asserting repo, MR, issue, events, CI status, provider, and capabilities for each.

  • internal/server/api_test.go:8494
    The Forgejo e2e uses gitealike.Options{} and a transport without ActionsTransport, while the real Forgejo client enables ReadActions: true. Action-run CI sync is not covered through SQLite persistence and the HTTP API.
    Fix: Add a Forgejo full-stack case with ReadActions: true and an actions-capable fake transport, then assert action-run checks are persisted and surfaced correctly.


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 (6c16c83)

Review found one medium-severity issue that should be addressed before merge.

Medium

  • internal/platform/gitea/read.go:74, internal/platform/forgejo/read.go:76
    The new read transport methods accept context.Context but do not apply it to SDK requests. Sync cancellation, server shutdown, and caller deadlines will not stop Gitea/Forgejo HTTP reads, so a stalled platform request can hang maintainer sync flows.

    Suggested fix: wire the provided context into every SDK request path using the SDK’s request context support or request-scoped HTTP calls, and add coverage for cancellation/deadline propagation.


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

@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from e278070 to 94e4fda Compare May 7, 2026 20:50
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from 6c16c83 to 89ebd24 Compare May 7, 2026 20:50
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (89ebd24)

No Medium, High, or Critical findings were reported.

All review agents found the changed code paths clean.


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

@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 94e4fda to 596d83f Compare May 7, 2026 21:18
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from 89ebd24 to e525542 Compare May 7, 2026 21:18
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (e525542)

High-level verdict: Not ready to merge due to a production startup blocker for the new Gitea/Forgejo providers.

High

  • cmd/middleman/provider_startup.go:36
    The new Forgejo and Gitea read clients are never registered in defaultProviderFactories, so real configs using platform = "forgejo" or platform = "gitea" still fail startup with unsupported platform. The new read/sync implementation is only reachable from tests that manually inject a provider.

    Fix: Register Forgejo and Gitea factories that construct clients with rate tracking and return them as platform.Providers. Add coverage for the production startup path.


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

@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 596d83f to 6aa70c5 Compare May 7, 2026 21:35
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from e525542 to 73793e8 Compare May 7, 2026 21:35
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (73793e8)

Summary verdict: One medium reliability issue remains; no high or critical findings were reported.

Medium

  • internal/platform/forgejo/client.go:93
    Forgejo clients unconditionally enable action-run reads, and ListActionRuns propagates HTTP errors. On Forgejo instances or repositories where Actions is disabled or unavailable, CI sync can fail even though commit statuses are still readable.
    Suggested fix: Treat unsupported or not-found action-run responses as an empty action-run list, or enable action reads only after capability detection/configuration.

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

@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from 73793e8 to 565114c Compare May 7, 2026 21:54
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (565114c)

Clean: no Medium, High, or Critical findings were reported.

All reviewers found no actionable issues.


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

@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 25dd2b8 to 809f2dc Compare May 7, 2026 22:11
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from 565114c to 5f77a5d Compare May 7, 2026 22:11
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (5f77a5d)

No Medium, High, or Critical findings were reported.

All reviewed outputs agree the code is clean for reportable issues.


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

Wire the Forgejo and Gitea SDK clients into the shared gitealike provider so repository, merge request, issue, release, tag, and CI read paths use the same pagination and typed error behavior. Forgejo includes action runs in CI checks where the SDK exposes them; Gitea stays on commit statuses only.
Exercise Forgejo reads through the shared gitealike provider, syncer, SQLite persistence, and generated HTTP client so provider read support is covered beyond unit-level transport tests.
The shared provider constructor now accepts functional options, but lower stack branches still used direct Options literals. Update the read-provider layer so each intermediate PR builds independently after the constructor refactor.
The Forgejo SDK can return a nil action-run response alongside a successful HTTP response. Guard that path before converting workflow runs so nilaway and CI push hooks do not flag a possible panic.
Some Forgejo instances return 404, 405, or 501 for repository action runs when Actions are disabled or unsupported.

Treat those action-run responses as an empty optional source so commit statuses still sync, and cover the behavior with client tests.
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 809f2dc to b2ae569 Compare May 7, 2026 22:36
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-read-apis branch from 5f77a5d to bd27b9f Compare May 7, 2026 22:36
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (bd27b9f)

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

All agents that reported results found the code clean for applicable findings.


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

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