Skip to content

feat(auth): add beta seat getters (signupCap/seatsRemaining/betaCapped)#4229

Merged
PierreBrisorgueil merged 1 commit into
masterfrom
feat/auth-seat-getters
Jun 1, 2026
Merged

feat(auth): add beta seat getters (signupCap/seatsRemaining/betaCapped)#4229
PierreBrisorgueil merged 1 commit into
masterfrom
feat/auth-seat-getters

Conversation

@PierreBrisorgueil
Copy link
Copy Markdown
Collaborator

What

Adds three null-safe Pinia getters to the auth store — signupCap, seatsRemaining, betaCapped — reading serverConfig.sign.{cap,remaining} (populated by the upstream GET /api/auth/config response). No action/state/fetch changes.

Why

Upstream-generic half of a downstream private-beta invite gate. Downstream landing components read these getters to render a "Beta · X seats left" banner; exposing typed getters avoids reaching into serverConfig.sign.* raw.

Inert by default

For any downstream without a configured cap, all three return null/false. Pairs with the devkit Node /auth/config change (contract: Node adds the fields, Vue reads them).

Tests

3 unit tests (uncapped, capped, missing serverConfig). Lint clean.

🤖 Generated with Claude Code

Expose signupCap, seatsRemaining, betaCapped getters derived from
serverConfig.sign.* — null-safe, inert when no cap is configured.
Copilot AI review requested due to automatic review settings June 1, 2026 17:03
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@PierreBrisorgueil, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 80ed4ad6-25f5-4d7e-bc82-d0f24d9307dd

📥 Commits

Reviewing files that changed from the base of the PR and between 486e7a9 and 652c597.

📒 Files selected for processing (2)
  • src/modules/auth/stores/auth.store.js
  • src/modules/auth/tests/auth.store.unit.tests.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/auth-seat-getters

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

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds three null-safe getters to the auth Pinia store to expose beta signup capacity information (signupCap, seatsRemaining, betaCapped) derived from serverConfig.sign.*, along with unit tests validating capped/uncapped/missing-config behavior.

Changes:

  • Added signupCap, seatsRemaining, and betaCapped getters to auth.store.js.
  • Added unit tests covering uncapped, capped, and missing serverConfig scenarios.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/modules/auth/stores/auth.store.js Introduces new beta seat/cap getters on the auth store.
src/modules/auth/tests/auth.store.unit.tests.js Adds unit tests to validate the new getters’ null-safety and behavior.

Comment on lines +66 to +69
// Beta capacity from the public auth config: cap/remaining are null when uncapped; betaCapped is true only when a numeric cap is set.
signupCap: (state) => state.serverConfig?.sign?.cap ?? null,
seatsRemaining: (state) => state.serverConfig?.sign?.remaining ?? null,
betaCapped: (state) => state.serverConfig?.sign?.cap != null,
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.56%. Comparing base (5a81c9a) to head (652c597).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4229   +/-   ##
=======================================
  Coverage   99.56%   99.56%           
=======================================
  Files          31       31           
  Lines        1159     1162    +3     
  Branches      327      329    +2     
=======================================
+ Hits         1154     1157    +3     
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil merged commit 0560aab into master Jun 1, 2026
8 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the feat/auth-seat-getters branch June 1, 2026 17:23
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