Skip to content

feat(api): check Seerr API compatibility in CI and track upstream weekly - #44

Merged
selmant merged 5 commits into
developfrom
feat/seerr-api-compat
Nov 3, 2026
Merged

selmant merged 5 commits into
developfrom
feat/seerr-api-compat

Conversation

@selmant

@selmant selmant commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Description

Foreseerr can no longer merge upstream Seerr (the backend is Rust now), but it promises to keep serving Seerr's /api/v1 API. This PR makes that promise something CI checks, and replaces merging with a weekly upstream review.

Seerr API contract

  • upstream/seerr-api.yml is upstream's spec at af0356245, kept byte-for-byte. It is the contract.
  • The new Seerr API compatibility workflow runs oasdiff breaking (image pinned by digest) against it and fails on any breaking change or warning that isn't listed with a reason in upstream/accepted-breaking.txt. That list is empty: with feat(api): restore ratingscombined and add overrideRule/advancedRequest #45 below this PR, Foreseerr has every Seerr operation and breaks none.
  • The 104 operations Seerr doesn't have are now marked x-foreseerr: true. scripts/check-seerr-api.ts checks that the markers match upstream exactly, and --fix adds or removes them.
  • New routes::spec_coverage tests: every documented operation has a Rust handler, and every handler is documented. Without a handler, a documented operation answers a bare 500. The native desktop host's POST /desktop/browser-cache/redeem is the one deliberate exception and is listed in the test.

Upstream tracking

  • upstream/sync.json records reviewedThrough, the last upstream commit that has been fully triaged.
  • scripts/upstream-sync.sh report lists the upstream commits after it, sorted into security / port to Rust / cherry-pick / translations / skip, plus Seerr API changes (oasdiff changelog, and breaks against our spec). bump <sha> marks a commit as reviewed and pins its spec.
  • The new Upstream Seerr sync workflow runs weekly on Mondays (and on demand) and keeps one upstream-sync issue up to date.
  • Process: upstream/README.md. The README and migration guide now describe the API guarantee and point to sync.json.

reviewedThrough is af0356245, upstream's head today: all 52 commits since the last merge base are ported or deliberately skipped in #46 (backend), #45 (missing endpoints) and #43 (frontend).

Stacked: develop ← #46 ← #45 ← this. #43 is independent. Merge in the order #46 → #45 → #43 → #44. GitHub retargets each PR as its base merges; with squash merges, rebase the next one onto develop before merging it.

How Has This Been Tested?

  • cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings, cargo test --locked: 724 passed on this stack (698 + 15 from fix(backend-rs): port upstream Seerr backend fixes through af0356245 #46 + 9 from feat(api): restore ratingscombined and add overrideRule/advancedRequest #45 + the 2 new coverage tests). The coverage tests failed before I fixed their matching (generic {id}/{action} handlers, literal movie/tv handlers), and they caught the undocumented redeem route.
  • oasdiff with the exact CI command passes on this branch with no accepted differences. A negative test (putting the watchlist 201 back to 200) fails with response-success-status-removed.
  • check-seerr-api.ts: passes. Removing one marker fails, and --fix restores the file byte-for-byte.
  • scripts/upstream-sync.sh report against upstream/develop listed the 52 unreviewed commits, with the two Merge commit from fork advisory fixes under Security. After bump af0356245, it reports nothing to do.
  • The whole stack plus fix(ui): port upstream Seerr frontend fixes through af0356245 #43 was merged locally and checked together: Rust as above; frontend typecheck, lint (0 errors), 68 tests, prettier; no i18n drift.
  • actionlint and shellcheck are clean. bun run format:check passes. The route table regenerates without drift.
  • The weekly workflow itself can only run once this is on develop (schedule / workflow_dispatch).

Checklist:

  • I have read and followed the contribution guidelines.
  • I tested this change manually (see our AI policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build bun run build
  • Translation keys bun run i18n:extract
  • Database migration (if required)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added guidance on Seerr API compatibility, upstream changes, and the reference point for reviewing upstream updates.
  • Chores
    • Added automated checks for API compatibility and route documentation coverage.
    • Added a weekly report of upstream changes, including API differences.
    • Documented the current upstream tracking status and accepted API differences.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The changes add a pinned Seerr API contract, checks for API annotations and Rust route coverage, and scripts and workflows to report upstream changes and track review progress.

Changes: Seerr API compatibility and upstream tracking

Layer / File(s) Summary
Define the Seerr API contract
seerr-api.yml, upstream/sync.json, upstream/accepted-breaking.txt, upstream/README.md, .prettierignore, README.md
The API spec marks Foreseerr-added operations with x-foreseerr: true. The sync metadata records the upstream repository, branch, and reviewed commit. Supporting documentation describes the API contract and accepted differences.
Check API annotations and route coverage
scripts/check-seerr-api.ts, .github/workflows/seerr-api-compat.yml, backend-rs/src/routes/mod.rs, backend-rs/src/standalone/fallback.rs, upstream/README.md
The checker validates or fixes operation markers. CI compares the current and pinned API specs. Rust tests check documented operations against handlers and handlers against documentation, with one allowlisted route.
Report and advance upstream review
scripts/upstream-sync.sh, upstream/README.md, docs/migration-guide.mdx, README.md
The script reports unreviewed commits and API changes, and can advance the reviewed commit while updating the pinned spec and markers. The documentation describes the sync process and reviewed-commit boundary.
Schedule reports and manage tracking issues
.github/workflows/upstream-sync.yml
The workflow runs on a schedule or manual dispatch. It adds the report to the workflow summary and closes, updates, or creates an upstream-sync issue based on the report.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as upstream-sync.yml
  participant Script as upstream-sync.sh
  participant Issues as GitHub Issues
  Workflow->>Script: Generate upstream report
  Workflow->>Issues: Find open upstream-sync issue
  alt Reviewed through reported commit
    Workflow->>Issues: Close issue if present
  else Unreviewed commits remain
    Workflow->>Issues: Update or create issue with report
  end
Loading

Possibly related PRs

  • selmant/foreseerr#10: Adds the Rust backend and documented-route data used by the new route-coverage tests.
  • selmant/foreseerr#43: Ports changes through the commit recorded as the upstream review point in this PR.
  • selmant/foreseerr#34: Adds an API operation and handler that the new API surface checks cover.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@selmant
selmant force-pushed the feat/seerr-api-compat branch from f462634 to 8cc984b Compare November 3, 2026 20:44
@selmant
selmant changed the base branch from develop to feat/seerr-missing-endpoints November 3, 2026 20:44
@selmant
selmant force-pushed the feat/seerr-missing-endpoints branch 3 times, most recently from ab11602 to a1889a4 Compare November 3, 2026 20:47
@selmant
selmant changed the base branch from feat/seerr-missing-endpoints to develop November 3, 2026 20:47
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

selmant and others added 5 commits November 3, 2026 23:53
upstream/seerr-api.yml is upstream Seerr's spec at af03562, kept
byte-for-byte as the contract Foreseerr's /api/v1 must not break.
Every operation Seerr doesn't have (104) is now marked x-foreseerr: true
in seerr-api.yml; scripts/check-seerr-api.ts checks (and --fix applies)
the markers. upstream/accepted-breaking.txt lists the known gaps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A documented operation nothing serves answers a bare 500 from the
fallback. routes::spec_coverage checks both ways: every operation in
seerr-api.yml has a handler in routes::router, and every handler is
documented (the native desktop host's browser-cache redeem route is the
one deliberate exception).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seerr API compatibility: oasdiff fails on any breaking change against
the pinned Seerr spec not accepted in upstream/accepted-breaking.txt,
and the x-foreseerr markers must match.

Upstream Seerr sync (weekly, on demand): scripts/upstream-sync.sh lists
the upstream commits after upstream/sync.json's reviewedThrough, sorted
into security / port to Rust / cherry-pick / translations / skip, with
the Seerr API changes, in one open upstream-sync issue. 'bump <sha>'
marks a commit reviewed and pins its spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All 52 upstream commits since 59d5947 are ported or skipped (backend
sync, frontend sync and missing-endpoints PRs), and Foreseerr now has
every Seerr operation, so no breaking differences are accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@selmant
selmant force-pushed the feat/seerr-api-compat branch from 8cc984b to 106a4ef Compare November 3, 2026 20:53
@selmant
selmant merged commit 36d71b9 into develop Nov 3, 2026
24 of 25 checks passed
@selmant
selmant deleted the feat/seerr-api-compat branch November 3, 2026 20:59
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