fix: send JSON:API Accept on GitHub App manifest setup - #880
Conversation
The manifest setup endpoint returns a vnd.api+json document and the Accept gate 406s plain application/json, so the create/replace flow always failed. The endpoint negotiates JSON for either media type, so requesting vnd.api+json satisfies both. Adds frontend header regression test plus backend 200/406 contract tests.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe backend tests define the manifest setup Accept contract. The frontend sends the JSON:API media type and redirects to the returned GitHub authorization URL. Frontend tests verify the request header and redirect behavior. ChangesGitHub App manifest setup
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The manifest setup request now matches the endpoint’s content-negotiation contract, preventing the prior 406 response during GitHub App setup. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. 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. A rabbit checks the headers bright Comment |
Clicking "Create or replace with GitHub" always failed with 406 "The Accept header must allow application/vnd.api+json".
Root cause: the frontend sent
Accept: application/jsonon/admin/github-app/manifest/setup. The endpoint returns avnd.api+jsondocument, so the Accept gate rejects anything else. The endpoint itself negotiates its JSON body on either media type, so requestingvnd.api+jsonsatisfies both sides. One-line fix.Tests: frontend header regression test (asserts the Accept value plus end-to-end navigation to the GitHub setup URL) and backend 200/406 contract tests for the endpoint.
Verified: frontend 534/534, github-app backend suites 14/14, typechecks clean, file lint clean, complexity zero repo-wide, lint budget passes (752/0 vs 762/0).
AI-assisted contribution via Hermes Agent (Nous Research), model muse-spark.
Summary by CodeRabbit
Bug Fixes
Tests