Skip to content

test(auth): new-account OAuth service test (TASK-524 replacement for #2688) - #2818

Merged
lilyshen0722 merged 1 commit into
mainfrom
test/task-524-oauth-new-account-rebased
Oct 27, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
test/task-524-oauth-new-account-rebased

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

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

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
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d1f8036 and 29d33d6.

Files selected for processing: 1
  • backend/__tests__/service/oauthNewAccount.test.js

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

Adds an integration test for first-time Google and GitHub OAuth signup. The test checks account and workspace creation, authenticated API access, onboarding records, and rejection of callback and exchange replays.

Changes: OAuth new-account integration coverage

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: Low

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

Change: Other

Possibly related issues

Possibly related PRs

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: Passed 4
Check name Status Explanation
Title check Passed 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 …
Description check Passed The description states the purpose of the change: a replacement for #2688 that adds the same single test-only file, oauthNewAccount.test.js (+132). It names the covered scope (Google and GitHub new-ac…
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.
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 #2688 that 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 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 ran oauthNewAccount.test.js: both google creates a human, issues the first session… and github 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.post and axios.get). The test goes through the production /api/auth and /api/pods routers. The replay and the second exchange are both refused, and the stored state is checked to be unchanged across them. JWT_SECRET is set by the service job in CI (tests.yml). The SCOUT_WELCOME import, the My Workspace name and the source: '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

@lilyshen0722
lilyshen0722 marked this pull request as ready for review October 26, 2026 11:47
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit c16d4c9 Oct 27, 2026
28 checks passed
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