Repository navigation
fix(tests): stop the Slack install test overwriting the auth secret - #338
Conversation
The Slack install test set BETTER_AUTH_SECRET at module scope, which changes it for the whole test process rather than for that file. MCP access tokens are signed with that secret, so a token issued before the file loaded no longer verified afterwards and the MCP authorize PKCE boundary test failed with an invalid access token. The secret already comes from the repository .env in local runs and from the workflow environment in CI, so the assignment was never needed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Slack integration test setup no longer assigns Changes
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change stops the Slack install test from overwriting the shared authentication secret, preventing unrelated tests from rejecting valid tokens; no actionable merge-blocking risk remains after normal checks. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
What broke
mainhas been red since aa3e922. One test fails in theUnit and integration testsjob:It passes in isolation and fails only in a full-suite run, which is why it survived review on #323.
Why
apps/web/tests/features/settings/integrations-connect-slack.test.ts, added in #323, sets the auth secret at module scope:Module scope means the whole test process, not that file. Bun loads test files into one process, so from the moment this file is loaded every other test sees the new secret. MCP access tokens are signed with
BETTER_AUTH_SECRET, so a token issued under the real secret no longer verifies once the file has been loaded, andverifyMcpAccessTokencorrectly rejects it.The assignment was never needed.
BETTER_AUTH_SECRETalready comes from the repository.envlocally and from the workflow environment in CI.How I confirmed it
Full
apps/websuite, same lane and same database, only this line varying:a447d5a5, before the three mergesaa3e922d, currentmainaa3e922dwithintegrations-connect-slack.test.tsremovedaa3e922dwith only this one line removedI also ruled out two other candidates on the way: removing the
registry.test.tsfile added by #334 changes nothing, and rewritingdescribe.serialtodescribechanges nothing.The remaining 16 are the pre-existing full-suite failures that are also present on
a447d5a5and pass in isolation. They are a separate problem and not touched here.Verification
apps/web/tests/features/settings/integrations-connect-slack.test.tson its own: 4 pass, 0 failapps/web/tests/app/api/authon its own: 15 pass, 0 failapps/websuite: 2240 pass, 16 fail, matchinga447d5a5bun run lintandbun run check-commentscleanWorth a follow up separately: a test that mutates
process.envat module scope can break any other test in the process, and nothing catches it. The 16 remaining full-suite failures are probably worth their own issue too, since they mean a localbun run verifycannot be green today.Greptile Summary
Removes an unnecessary module-scope
BETTER_AUTH_SECREToverride from the Slack installation test.Confidence Score: 5/5
The PR appears safe to merge, with no actionable defects identified in the changed test.
The removed environment assignment is unused by the Slack installation path, while its removal prevents unrelated tests from observing an overwritten authentication secret.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(tests): stop the Slack install test ..." | Re-trigger Greptile