Skip to content

feat: convert Forgejo and Gitea SDK records#269

Merged
mariusvniekerk merged 5 commits intomainfrom
forgejo-gitea-sdk-converters
May 8, 2026
Merged

feat: convert Forgejo and Gitea SDK records#269
mariusvniekerk merged 5 commits intomainfrom
forgejo-gitea-sdk-converters

Conversation

@mariusvniekerk
Copy link
Copy Markdown
Collaborator

Maps concrete Forgejo and Gitea SDK structs into the shared gitea-like DTO layer, including Forgejo Actions runs and Gitea draft pull requests.

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (da3c8f2)

Medium-risk gaps remain: Forgejo draft state is dropped, and draft normalization lacks required E2E coverage.

Medium

  • internal/platform/forgejo/convert.go:39
    Forgejo pull requests do not populate PullRequestDTO.Draft, so draft Forgejo PRs normalize as non-draft even though shared normalization now relies on pr.Draft. Map the Forgejo SDK draft/WIP field in convertPullRequest and add converter coverage for a draft PR.

  • internal/platform/gitealike/normalize.go:67
    The draft-state data flow changed, but coverage is limited to package-level unit tests. Add an E2E test through the real HTTP API and SQLite path that syncs or seeds a Gitea-like draft PR and verifies the API returns it as draft.


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 (bebe647)

No Medium-or-higher findings were reported across the reviews.

All agents that provided findings agree the diff is clean for reportable issues.


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 (90ac716)

Medium-risk issues remain around Forgejo draft detection and missing full-flow coverage.

Medium

  • internal/platform/forgejo/convert.go:42 - Forgejo draft state is inferred from a hard-coded title-prefix list. Instances with different WIP prefixes may sync draft PRs as non-draft, or regular PRs as draft. Use a Forgejo API/SDK draft or WIP field if available; otherwise make accepted WIP prefixes configurable and test that path.

  • internal/platform/forgejo/convert_test.go:13 - Draft-state coverage is limited to direct converter unit tests. Add an end-to-end/API + SQLite test that syncs a Forgejo-like WIP PR through the real data flow and asserts the stored/served draft state.


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

@mariusvniekerk mariusvniekerk force-pushed the gitealike-provider-core branch from ed1755a to c4e4cda Compare May 7, 2026 20:13
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 90ac716 to e278070 Compare May 7, 2026 20:13
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (e278070)

Adds Forgejo/Gitea conversion coverage, but one medium test-coverage gap remains.

Medium

  • internal/platform/forgejo/convert_test.go:12, internal/platform/gitea/convert_test.go:12
    The new Forgejo/Gitea SDK-to-DTO flow, including draft/WIP state, is only covered by private converter unit tests. There is no full sync path coverage through HTTP fixtures, SQLite persistence, and API readback.
    Fix: Add e2e coverage with Forgejo/Gitea API fixtures that sync a PR and verify persisted/API-visible fields such as draft state, labels, branch metadata, merged/closed times, and CI status.

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

@mariusvniekerk mariusvniekerk force-pushed the gitealike-provider-core branch from c4e4cda to 4e8dddc Compare May 7, 2026 20:50
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from e278070 to 94e4fda Compare May 7, 2026 20:50
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (94e4fda)

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

All agents either found no issues or provided no reportable findings.


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

@mariusvniekerk mariusvniekerk force-pushed the gitealike-provider-core branch from 4e8dddc to 9bda02e Compare May 7, 2026 21:17
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 94e4fda to 596d83f Compare May 7, 2026 21:18
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (596d83f)

Medium issues found; no Critical or High findings reported.

Medium

  • internal/platform/gitea/convert.go:134, internal/platform/forgejo/convert.go:142 - Unvalidated CI status URLs are persisted and rendered as clickable links. A malicious or compromised status publisher could set target_url to a dangerous scheme such as javascript:, which may execute script or navigate the local dashboard unexpectedly when clicked.
    Fix: Allow only http and https status target URLs before storing or rendering them, and add API/UI coverage for rejected unsafe schemes.

  • internal/platform/forgejo/convert.go:43 - The Forgejo WIP draft fix lacks full conversion-path coverage. The new full-stack test seeds Draft: true directly into a gitealike.PullRequestDTO, so it would still pass if forgejoDraftFromTitle or SDK-to-DTO conversion regressed.
    Fix: Add e2e coverage that drives a Forgejo WIP pull request through the real conversion path and verifies the stored/API merge request has IsDraft: true.


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
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (6aa70c5)

Summary verdict: one medium test coverage gap remains; no higher-severity issues were reported.

Medium

  • internal/server/api_test.go:8699 - The unsafe gitealike status URL handling is only covered at converter-unit level. There is no full-stack HTTP API plus SQLite test proving an unsafe status TargetURL is discarded before persistence and omitted from client responses.
    • Fix: Add an e2e/API test that syncs a gitealike PR status with a javascript: or otherwise unsafe target URL, then assert the stored merge request/check payload and API response do not expose it.

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 (25dd2b8)

No Medium, High, or Critical findings were reported.

All reported issues were Low severity, so they are omitted per the review rules.


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

@mariusvniekerk mariusvniekerk force-pushed the gitealike-provider-core branch from 7508c2e to d48e9c1 Compare May 7, 2026 22:11
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 25dd2b8 to 809f2dc Compare May 7, 2026 22:11
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (809f2dc)

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

Medium

  • internal/platform/gitealike/normalize.go:259
    NormalizeStatuses sanitizes action run HTMLURL values, but coverage only exercises unsafe commit status URLs. An unsafe action run URL could regress without an e2e/API+SQLite test catching it.
    Fix: Extend the gitealike server persistence/readback test to return an action run with a javascript: HTMLURL and assert the API/DB CIChecksJSON does not contain it.

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

@mariusvniekerk mariusvniekerk force-pushed the gitealike-provider-core branch from d48e9c1 to 7a30080 Compare May 7, 2026 22:35
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from 809f2dc to b2ae569 Compare May 7, 2026 22:36
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 7, 2026

roborev: Combined Review (b2ae569)

No Medium, High, or Critical issues found.

All reviewers agreed the change is clean.


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

@mariusvniekerk mariusvniekerk force-pushed the gitealike-provider-core branch from 7a30080 to c6466bd Compare May 8, 2026 00:29
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from b2ae569 to add0e73 Compare May 8, 2026 00:29
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 8, 2026

roborev: Combined Review (add0e73)

All reviewers found no Medium-or-higher issues.

No issues found.


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

Base automatically changed from gitealike-provider-core to main May 8, 2026 00:35
Maps concrete Forgejo and Gitea SDK structs into the shared gitea-like DTO layer, including Forgejo Actions runs and Gitea draft pull requests.
Map Forgejo WIP pull request titles into the shared draft field and keep the shared draft normalization tests consistent after the DTO split from locked state.
The converter layer feeds the shared provider DTO path, so cover the fields reviewers called out through sync, SQLite, and generated API readback: draft state, labels, branches, merged and closed timestamps, and CI status.
Forgejo and Gitea statuses can include arbitrary target URLs. Only keep http and https URLs during SDK conversion so unsafe schemes are never persisted or rendered as CI links.
Strip non-http status and action URLs in the shared gitealike normalizer so unsafe provider values cannot be persisted or returned by API responses.

Add a full server sync regression test covering the persisted and API-visible CI checks JSON.
@mariusvniekerk mariusvniekerk force-pushed the forgejo-gitea-sdk-converters branch from add0e73 to 3a25000 Compare May 8, 2026 00:37
@mariusvniekerk mariusvniekerk merged commit bab09d2 into main May 8, 2026
8 of 9 checks passed
@mariusvniekerk mariusvniekerk deleted the forgejo-gitea-sdk-converters branch May 8, 2026 00:39
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