Skip to content

docs: add REST API documentation#2981

Open
M0NsTeRRR wants to merge 4 commits intodevelopfrom
docs/expose-api-docs
Open

docs: add REST API documentation#2981
M0NsTeRRR wants to merge 4 commits intodevelopfrom
docs/expose-api-docs

Conversation

@M0NsTeRRR
Copy link
Copy Markdown
Member

@M0NsTeRRR M0NsTeRRR commented May 1, 2026

Description

⚠️ Avoid squash and merge for this specific MR

  • Fix dead link on HTTPS proxy
  • Rename test docs deployment to test docs (as this workflow does not test the documentation deployment)
  • Use the same PNPM version across our package.json files
  • Add REST API documentation to the documentation (dependencies upgraded to support latest docusaurus-plugin-openapi-docs version)

The only thing I don't like much is that pnpm clean-api-docs all cleans the entire API folder, and we want to keep the _category_.json file. I didn't find a way to auto-generate it from the Docusaurus plugin.

How Has This Been Tested?

n/a

Screenshots / Logs (if applicable)

2026-05-01-024642_hyprshot

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • New Features

    • REST API documentation added to the public docs site.
  • Documentation

    • Docs build now generates API docs before building; site config, README, and category landing page added/updated to expose and describe the API docs.
    • Troubleshooting guide link corrected.
  • Chores

    • Build tooling and package manager updated; generated API docs are excluded from version control while the category file is preserved.
  • CI

    • Documentation CI job names simplified and build step adjusted to run API doc generation first.

@M0NsTeRRR M0NsTeRRR requested a review from a team as a code owner May 1, 2026 13:32
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 35e139d1-620d-4761-b3ad-3994e68a58fe

📥 Commits

Reviewing files that changed from the base of the PR and between fb1a15b and 9ef0f11.

⛔ Files ignored due to path filters (1)
  • gen-docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .github/workflows/docs-deploy.yml
  • .gitignore
  • docs/api/_category_.json
  • gen-docs/README.md
  • gen-docs/docusaurus.config.ts
  • gen-docs/package.json
  • gen-docs/scripts/clean-api-docs.cjs
✅ Files skipped from review due to trivial changes (2)
  • .gitignore
  • docs/api/category.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/docs-deploy.yml
  • gen-docs/scripts/clean-api-docs.cjs

📝 Walkthrough

Walkthrough

Adds OpenAPI-driven REST API docs generation to the docs site (plugin, theme, scripts, config), updates CI to run API docs generation before site build, updates dependencies and packaging, ignores generated docs in VCS while preserving a category file, and tweaks minor docs/CI text.

Changes

Cohort / File(s) Summary
CI / Workflows
\.github/workflows/docs-deploy.yml, \.github/workflows/test-docs.yml
docs-deploy.yml: include seerr-api.yml in push paths and change build step to run pnpm gen-api-docs all && pnpm build. test-docs.yml: shorten workflow name and rename job id/name from test-deploy/“Test deployment” to test-build/“Test build”.
Docusaurus OpenAPI setup
gen-docs/docusaurus.config.ts, gen-docs/package.json, gen-docs/README.md, gen-docs/scripts/clean-api-docs.cjs
Add docusaurus-plugin-openapi-docs and docusaurus-theme-openapi-docs, configure plugin to read ../seerr-api.yml and output to ../docs/api, add gen-api-docs/clean-api-docs scripts, bump Docusaurus and related deps, update README, and add cleanup script that preserves _category_.json.
Docs output & metadata
docs/api/_category_.json, \.gitignore
Add _category_.json to define "REST API documentation" category; update .gitignore to ignore docs/api/* while negating docs/api/_category_.json.
Local package pin
bin/duplicate-detector/package.json
Bump packageManager pnpm pin from pnpm@10.17.1 to pnpm@10.24.0.
Docs text update
docs/troubleshooting.mdx
Adjust proxy docs hyperlink target to point to the network settings section.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub
    participant Actions as GitHub Actions
    participant Gen as gen-api-docs
    participant Docusaurus as Docusaurus build
    participant Site as Docs output

    Dev->>GH: push changes (including `seerr-api.yml` or docs)
    GH->>Actions: trigger workflows (docs-deploy / test-docs)
    Actions->>Gen: run `pnpm gen-api-docs all`
    Gen->>Docusaurus: write generated files to `docs/api`
    Actions->>Docusaurus: run `pnpm build` (after gen succeeds)
    Docusaurus->>Site: build site including generated API docs
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • fallenbagel
  • gauthier-th

Poem

🐰
I hopped through YAML, scripts in tow,
I sketched the API for all to know.
Workflows hum and docs now grow,
Tiny paws, big changes — off I go! 🥕

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'docs: add REST API documentation' directly and accurately reflects the main change: adding REST API documentation to the documentation site, which is the primary objective evident from file changes and PR description.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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
Review rate limit: 6/8 reviews remaining, refill in 10 minutes and 29 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@M0NsTeRRR M0NsTeRRR changed the title Docs/expose api docs docs: add REST API documentation May 1, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/docs-deploy.yml:
- Around line 58-60: The workflow only triggers on changes to docs/** and
gen-docs/**, so OpenAPI spec-only changes (e.g., updates to seerr-api.yml) won't
run the "Build website" step in gen-docs (run: pnpm gen-api-docs all && pnpm
build); update the workflow trigger (the on: push / pull_request paths) to
include the OpenAPI spec file(s) (for example seerr-api.yml or the directory
where specs live) so changes to the spec will execute the Build website step in
gen-docs.

In @.github/workflows/test-docs.yml:
- Around line 21-22: The test job "test-build" in the workflow test-docs.yml
only runs the build and must be aligned with the deploy job; update the
"test-build" job to run the same steps the deploy job performs (include the
API-doc generation step that was added to deploy and any validation steps for
seerr-api.yml), e.g., add the API-doc generation command(s) (the same pnpm
script(s) invoked by deploy) and any linter/validation commands used for
seerr-api.yml so PRs exercise the same pipeline as deployment.

In `@docs/troubleshooting.mdx`:
- Line 106: The link text "HTTP(S) Proxy" points to the anchor
"#enable-proxy-support" which is a different setting; update the link so text
and anchor match: either change the href to the HTTP(S) Proxy anchor (e.g., use
/using-seerr/settings/network#http(s)-proxy or the exact anchor used in the site
for the HTTP(S) Proxy heading) or rename the link text to "Enable Proxy Support"
to match the existing `#enable-proxy-support` anchor; edit the line containing
"You can configure Seerr to use a proxy with the [HTTP(S)
Proxy](/using-seerr/settings/network#enable-proxy-support) setting."
accordingly.

In `@gen-docs/README.md`:
- Around line 37-40: The README entry for the "clean-api-docs" command is
missing a warning about its destructive behavior; update the description for the
command `pnpm clean-api-docs all` (and any mention of `clean-api-docs`) to state
that it will delete tracked docs such as `docs/api/_category_.json` and either
add a restore step (e.g., how to recover that file from git) or explicitly warn
contributors not to run it without backing up those files. Ensure the README
text mentions the exact file `docs/api/_category_.json` and gives a brief
recovery command (git restore or git checkout) or a clear cautionary note.
- Around line 33-40: Replace the inline fenced examples for the two commands so
they're markdownlint-clean: remove the leading "$" prompt and add a language to
the fences (use bash) for the commands `pnpm gen-api-docs all` and `pnpm
clean-api-docs all` so the blocks read as ```bash pnpm gen-api-docs all ``` and
```bash pnpm clean-api-docs all ``` to satisfy MD040/MD014.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47b9ccf7-1541-478c-9702-f99f178ae3a5

📥 Commits

Reviewing files that changed from the base of the PR and between 3ad2d09 and efe6cd0.

⛔ Files ignored due to path filters (1)
  • gen-docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .github/workflows/docs-deploy.yml
  • .github/workflows/test-docs.yml
  • .gitignore
  • bin/duplicate-detector/package.json
  • docs/api/_category_.json
  • docs/troubleshooting.mdx
  • gen-docs/README.md
  • gen-docs/docusaurus.config.ts
  • gen-docs/package.json

Comment thread .github/workflows/docs-deploy.yml
Comment thread .github/workflows/test-docs.yml
Comment thread docs/troubleshooting.mdx
Comment thread gen-docs/README.md Outdated
Comment thread gen-docs/README.md Outdated
Comment thread gen-docs/README.md Outdated
Comment thread gen-docs/README.md Outdated
Comment thread gen-docs/README.md Outdated
@M0NsTeRRR M0NsTeRRR force-pushed the docs/expose-api-docs branch from efe6cd0 to ebd0353 Compare May 1, 2026 13:47
@M0NsTeRRR M0NsTeRRR requested a review from 0xSysR3ll May 1, 2026 13:47
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
gen-docs/README.md (1)

37-41: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Document clean-api-docs as destructive (with restore guidance).

At Line 37, “cleans REST API documentation” is too soft for this repo behavior. This command can remove tracked docs (notably docs/api/_category_.json), so please add a clear warning and a quick recovery command (e.g., git restore docs/api/_category_.json).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@gen-docs/README.md` around lines 37 - 41, The README's description for the
pnpm script clean-api-docs is too mild; update the entry for the clean-api-docs
command to mark it as destructive, add a prominent warning that it can remove
tracked documentation (specifically call out docs/api/_category_.json), and
include a short recovery note showing the restore command (e.g., git restore
docs/api/_category_.json) so maintainers know how to recover removed tracked
files; modify the text around the clean-api-docs example to include this warning
and the restore guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@gen-docs/README.md`:
- Around line 37-41: The README's description for the pnpm script clean-api-docs
is too mild; update the entry for the clean-api-docs command to mark it as
destructive, add a prominent warning that it can remove tracked documentation
(specifically call out docs/api/_category_.json), and include a short recovery
note showing the restore command (e.g., git restore docs/api/_category_.json) so
maintainers know how to recover removed tracked files; modify the text around
the clean-api-docs example to include this warning and the restore guidance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f660653e-06eb-4df3-ac6c-7d1771dfb7e4

📥 Commits

Reviewing files that changed from the base of the PR and between efe6cd0 and ebd0353.

⛔ Files ignored due to path filters (1)
  • gen-docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .github/workflows/docs-deploy.yml
  • .gitignore
  • docs/api/_category_.json
  • gen-docs/README.md
  • gen-docs/docusaurus.config.ts
  • gen-docs/package.json
✅ Files skipped from review due to trivial changes (4)
  • .gitignore
  • docs/api/category.json
  • .github/workflows/docs-deploy.yml
  • gen-docs/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • gen-docs/docusaurus.config.ts

@github-actions github-actions Bot added the merge conflict Cannot merge due to merge conflicts label May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

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

M0NsTeRRR added 3 commits May 1, 2026 17:50
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
@0xSysR3ll 0xSysR3ll force-pushed the docs/expose-api-docs branch from ebd0353 to fb1a15b Compare May 1, 2026 15:53
@github-actions github-actions Bot removed the merge conflict Cannot merge due to merge conflicts label May 1, 2026
Co-authored-by: 0xsysr3ll <0xsysr3ll@pm.me>
Co-authored-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
@0xSysR3ll 0xSysR3ll force-pushed the docs/expose-api-docs branch from fb1a15b to 9ef0f11 Compare May 1, 2026 15:57
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@gen-docs/scripts/clean-api-docs.cjs`:
- Around line 11-15: The current try/catch around readFileSync(categoryPath,
'utf8') swallows all errors; modify the catch to accept an error object and only
suppress the error when it's a missing-file ENOENT (set categoryContent =
undefined), otherwise rethrow the error so real filesystem issues surface.
Locate the block using readFileSync, categoryPath and categoryContent and change
the catch to inspect error.code === 'ENOENT' (or equivalent) before deciding to
set categoryContent = undefined or throw.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f0a9518-0f24-4f58-a7de-e3992c895297

📥 Commits

Reviewing files that changed from the base of the PR and between ebd0353 and fb1a15b.

⛔ Files ignored due to path filters (1)
  • gen-docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .github/workflows/docs-deploy.yml
  • .github/workflows/test-docs.yml
  • .gitignore
  • bin/duplicate-detector/package.json
  • docs/api/_category_.json
  • docs/troubleshooting.mdx
  • gen-docs/README.md
  • gen-docs/docusaurus.config.ts
  • gen-docs/package.json
  • gen-docs/scripts/clean-api-docs.cjs
✅ Files skipped from review due to trivial changes (6)
  • bin/duplicate-detector/package.json
  • docs/api/category.json
  • .gitignore
  • .github/workflows/test-docs.yml
  • docs/troubleshooting.mdx
  • gen-docs/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • gen-docs/docusaurus.config.ts

Comment thread gen-docs/scripts/clean-api-docs.cjs
@0xSysR3ll 0xSysR3ll requested a review from a team May 3, 2026 14:29
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.

2 participants