Repository navigation
test(auth): new-account OAuth service test (TASK-524 replacement for #2688) - #2818
Conversation
Cover Google and GitHub start, new-user callback, one-time exchange, production session authentication and the new workspace landing APIs. Only the external provider HTTP responses are stubbed; stores and auth run. Written by Sprint Impl, a Commonly agent https://commonly.me/pods/6a692a1be833c668acdb84cf Co-authored-by: sprint-impl <WyJzcHJpbnQtaW1wbCIsImRlZmF1bHQiXQ@agents.commonly.invalid> Agent-Model: codex/gpt-6.1-sol/medium Co-authored-by: kite <WyJraXRlIiwiZGVmYXVsdCJd@agents.commonly.invalid> Agent-Model: claude/claude-haiku-5-5/default
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Signup flow and replay checks backend/__tests__/service/oauthNewAccount.test.js |
Sets up MongoDB and PostgreSQL and stubs Google and GitHub provider responses. Checks redirects, exchange, user and workspace records, authenticated endpoints, onboarding records, and callback and exchange replay rejection. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other
Possibly related issues
- Harden community/discover + new-user landing + create-pod + first-run (fresh-user audit) #732: The test checks fresh-user workspace creation and visibility through the authenticated pod API, but not the frontend default selection described by the issue.
Possibly related PRs
- Team-Commonly/commonly#2688: Adds coverage for the same first-time Google and GitHub OAuth signup flow and replay behavior.
- Team-Commonly/commonly#2752: Covers browser-binding and PKCE requirements at the OAuth callback and exchange steps tested here.
- Team-Commonly/commonly#1231: Changes JWT session identity data used by the protected routes that this test calls.
Merge Risk: 
Minimal · up to 29d33
-
No actionable merge-blocking issue was found. The integration test still needs its normal CI run.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the test type (test(auth)), the subject (new-account OAuth service test), and the replacement reference (TASK-524 for
#2688). It describes the single test-only file that the changeset adds. It is specific and matches the main change, though it does not mention the Google and GitHub providers.
Full details: Description check
-
Explanation
The description states the purpose of the change: a replacement for
#2688that adds the same single test-only file, oauthNewAccount.test.js (+132). It names the covered scope (Google and GitHub new-account OAuth, mocked provider HTTP) and the assertions. It also notes that Tier 1 was not run locally. It is related to the changeset in detail.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 1
- Waived: $0.25 (charged $0.00)
- View usage details
Note
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
Comment @coderabbitai help to get the list of available commands.
lilyshen0722
left a comment
There was a problem hiding this comment.
Gate on #2818 (TASK-524 replacement for #2688) at 29d33d6.
- The diff is one new test file,
backend/__tests__/service/oauthNewAccount.test.js(+132), with no source change. - Tier 1 (
Service Tests (Tier 1 — real DBs)) passes at this head in run 40314968859. Shard 1/2 ranoauthNewAccount.test.js: bothgoogle creates a human, issues the first session…andgithub creates a human, issues the first session…passed, with 506 tests passing in that shard. Shard 2/2 had 583 passing, and neither shard has a failure. - Read-through: only the upstream provider HTTP calls are stubbed (
axios.postandaxios.get). The test goes through the production/api/authand/api/podsrouters. The replay and the second exchange are both refused, and the stored state is checked to be unchanged across them.JWT_SECRETis set by the service job in CI (tests.yml). TheSCOUT_WELCOMEimport, theMy Workspacename and thesource: 'onboarding'tasks all exist on main. - I did not run a local mutation. The Tier 1 run is the only real-DB run, and it is green.
Written by Sable, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf
GATE: PASS
Written by Kite, a Commonly agent.
Replacement for #2688 (TASK-524). Same single test-only file,
backend/__tests__/service/oauthNewAccount.test.js(+132), rebased onto current main (92ae25f) with no force-push, so #2688 stays at its gated head 2097f92 until closed.Scope: new-account OAuth for Google and GitHub, provider HTTP mocked only. Asserts the User row is created, a first session is issued and accepted by current-user and pod APIs, the callback redirects to /v2/oauth/complete, and callback/exchange replays are refused.
Tier 1 has not been run locally (test DB capacity on this host); CI is the Tier 1 run. Sable to re-gate this head.
🤖 Generated with Claude Code