Skip to content

feat: honor invite-only at sign-up and add an admin switch - #9498

Merged
aglinxinyuan merged 9 commits into
apache:mainfrom
aglinxinyuan:feat/invite-only-setting
Nov 17, 2026
Merged

aglinxinyuan merged 9 commits into
apache:mainfrom
aglinxinyuan:feat/invite-only-setting

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

USER_SYS_INVITE_ONLY now decides the role a new account starts with, and admins can switch it on Admin → Settings without a restart.

A new account, while invite-only is Before After
off INACTIVE; stays on the sign-up page, told to contact an administrator; every dashboard request refused REGULAR; opens the dashboard
on INACTIVE; pending-approval screen unchanged
  • Sign-up roles. These sign-ups start REGULAR while invite-only is off, and INACTIVE while it is on:

    • local sign-up, with or without email verification;
    • the first Google or Apple sign-in;
    • a sign-up that claims a dataset-contributor placeholder.

    An account from a provider that asserts no email (ORCID) stays INACTIVE until it supplies one, and then gets the same role. Staying INACTIVE until then is also what lets that step adopt a placeholder. Accounts already waiting for approval, and roles an admin set, are never changed.

  • An admin setting. Invite-only is now the invite_only site setting, read on every sign-up. Admin → Settings has a Registration card with an Invite Only switch. USER_SYS_INVITE_ONLY, now declared in default.conf, sets its value the first time config-service starts, like the page's other settings, and Reset restores it. The value is stored as true or false whatever spelling the variable uses (yes, off, …). /config/pre-login reports the stored value to the sign-up form. Nothing reads it after sign-in any more, so /config/user-system, which served only this flag, is removed along with the request the frontend made to it on every sign-in. Each sign-up reads the setting before it opens its transaction, so a burst of sign-ups cannot have each one hold a pooled connection while it waits for a second.

  • Every boolean default. The same now holds for every setting default.conf declares as a boolean: the sidebar tab switches (GUI_TABS_*_ENABLED) and the reset flag are stored as true or false too. Before, GUI_TABS_HUB_ENABLED=on stored on, and the dashboard and the admin page, which accept only "true", hid the Hub tab. A value that is not a boolean now stops config-service at startup, as USER_SYS_INVITE_ONLY and the reset flag already did. Rows a deployment already stored as on stay until an admin saves or resets that switch.

  • On by default, and closed when in doubt. A REGULAR account can run code on the server, so opening sign-up has to be a deployment's explicit choice. A deployment that never set the variable keeps its new accounts INACTIVE, as before. The configured value applies only while no row is stored: a read that fails, or a row that is neither true nor false, keeps sign-up closed and logs a warning. The admin card likewise shows anything but an explicit false as on, because Save writes whatever the switch shows.

  • Pending accounts. Any INACTIVE account gets the pending-approval screen when it signs in, whatever the switch says now. So accounts still waiting when an admin turns invite-only off are not dropped onto a dashboard that refuses every request. The same goes for an account an admin deactivated, which before got this screen only on invite-only deployments.

  • Sign-up page. When the new account is usable, the page says so and opens the dashboard. The "contact the administrator" hint and message appear only while invite-only is on, or while the account is still INACTIVE.

Before After
Admin → Settings Admin settings before Admin settings after
After signing up, invite-only off After sign-up before After sign-up after

Any related issues, documentation, discussions?

Closes #9497.

How was this PR tested?

Unit tests, all passing:

sbt "DAO/testOnly org.apache.texera.dao.SiteSettingsSpec" "Config/test" "Auth/testOnly org.apache.texera.auth.InviteOnlySpec" "ConfigService/test" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.auth.*"
cd frontend && ng test --watch=false --include=src/app/common/service/gui-config.service.spec.ts --include=src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts --include=src/app/hub/component/login/texera-login.component.spec.ts --include=src/app/common/service/user/auth.service.spec.ts

That is 15 SiteSettings, 105 Config, 9 InviteOnly, 43 ConfigService and 141 amber auth cases, plus 12 GuiConfigService, 62 admin-settings, 64 login and 39 AuthService cases. The new cases run with invite-only both on and off. They cover local sign-up, register/verify, Google and Apple, placeholder claims, the add-email step and placeholder adoption, and a switch reaching the very next registration. They check that pending accounts and admin-set roles are left alone, that a missing row falls back to the seed while a failed read or an unreadable row keeps sign-up closed, that invite-only, every sidebar tab switch and the reset flag are seeded as true or false whatever the spelling (off, no, on, yes) while a value that is not a boolean is refused, and that a fresh deployment seeds invite-only on. They also cover the admin card's load, save, reset and its guard against saving before the load, the sign-up page's outcomes and hint, the pending screen for an INACTIVE sign-in while invite-only is off, and a sign-in that no longer asks for /config/user-system.

Lint: scalafmtCheckAll and scalafixAll --check on DAO, Config, Auth, ConfigService and WorkflowExecutionService; prettier-eslint --list-different and eslint on the changed frontend files.

Manual check: config-service and the web server ran against a fresh database, with USER_SYS_INVITE_ONLY unset.

  1. invite_only was seeded true, and a sign-up came out INACTIVE with the Request access dialog.
  2. After turning the switch off on Admin → Settings, with no restart, the next sign-up was REGULAR and opened the dashboard.
  3. After turning it back on, the next sign-up was INACTIVE again.
  4. After the second review round, signing in requested /config/gui and /config/amber but not /config/user-system, which now answers 404, and the sign-up form still told new accounts to ask for activation.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

@aglinxinyuan
aglinxinyuan marked this pull request as ready for review November 16, 2026 10:50
Copilot AI balanced review requested due to automatic review settings November 16, 2026 10:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added feature engine frontend Changes related to the frontend GUI docs Changes related to documentations infra common platform Non-amber Scala service paths labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Committers with relevant context: @parshimers
    You can request their reviews formally with /request-review @parshimers.

  • Contributors with relevant context: @Neilk1021, @tanishqgandhi1908, @sshiv012
    You can notify them by mentioning @Neilk1021, @tanishqgandhi1908, @sshiv012 in a comment.

@aglinxinyuan
aglinxinyuan requested a review from mengw15 November 16, 2026 11:11
@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.61%. Comparing base (43c3982) to head (d8d0562).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...main/scala/org/apache/texera/auth/InviteOnly.scala 60.00% 0 Missing and 4 partials ⚠️
...apache/texera/web/resource/auth/AuthResource.scala 85.71% 0 Missing and 1 partial ⚠️
...g/apache/texera/common/config/DefaultsConfig.scala 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9498      +/-   ##
============================================
- Coverage     91.63%   91.61%   -0.02%     
+ Complexity     5042     5033       -9     
============================================
  Files          1284     1285       +1     
  Lines         56996    57059      +63     
  Branches       7405     7411       +6     
============================================
+ Hits          52226    52276      +50     
- Misses         2903     2913      +10     
- Partials       1867     1870       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø) Carriedforward from 756f272
amber 85.35% <81.81%> (-0.05%) ⬇️
computing-unit-managing-service 64.02% <ø> (-0.03%) ⬇️
config-service 87.50% <100.00%> (-0.24%) ⬇️
file-service 82.16% <ø> (ø)
frontend 96.43% <100.00%> (+<0.01%) ⬆️
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.50% <ø> (ø) Carriedforward from 756f272
workflow-compiling-service 78.30% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 2 worse · ⚪ 13 noise (<±5%) · 0 without baseline

Compared against main 43c3982 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 341 0.208 26,872/61,422/61,422 us 🔴 +32.7% / 🔴 +347.4%
⚪ bs=100 sw=10 sl=64 800 0.488 122,195/149,678/149,678 us ⚪ within ±5% / 🔴 +69.1%
⚪ bs=1000 sw=10 sl=64 936 0.572 1,058,506/1,155,054/1,155,054 us ⚪ within ±5% / 🔴 +39.7%
Baseline details

Latest main 43c3982 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 341 tuples/sec 338 tuples/sec 1,005 tuples/sec +0.9% -66.1%
bs=10 sw=10 sl=64 MB/s 0.208 MB/s 0.206 MB/s 0.614 MB/s +1.0% -66.1%
bs=10 sw=10 sl=64 p50 26,872 us 27,469 us 10,325 us -2.2% +160.3%
bs=10 sw=10 sl=64 p95 61,422 us 46,293 us 13,728 us +32.7% +347.4%
bs=10 sw=10 sl=64 p99 61,422 us 46,293 us 16,323 us +32.7% +276.3%
bs=100 sw=10 sl=64 throughput 800 tuples/sec 834 tuples/sec 1,347 tuples/sec -4.1% -40.6%
bs=100 sw=10 sl=64 MB/s 0.488 MB/s 0.509 MB/s 0.822 MB/s -4.1% -40.7%
bs=100 sw=10 sl=64 p50 122,195 us 117,778 us 80,846 us +3.8% +51.1%
bs=100 sw=10 sl=64 p95 149,678 us 152,320 us 88,523 us -1.7% +69.1%
bs=100 sw=10 sl=64 p99 149,678 us 152,320 us 112,010 us -1.7% +33.6%
bs=1000 sw=10 sl=64 throughput 936 tuples/sec 954 tuples/sec 1,394 tuples/sec -1.9% -32.8%
bs=1000 sw=10 sl=64 MB/s 0.572 MB/s 0.582 MB/s 0.851 MB/s -1.7% -32.7%
bs=1000 sw=10 sl=64 p50 1,058,506 us 1,043,700 us 787,853 us +1.4% +34.4%
bs=1000 sw=10 sl=64 p95 1,155,054 us 1,164,479 us 826,583 us -0.8% +39.7%
bs=1000 sw=10 sl=64 p99 1,155,054 us 1,164,479 us 872,816 us -0.8% +32.3%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,586.55,200,128000,341,0.208,26871.93,61422.14,61422.14
1,100,10,64,20,2499.96,2000,1280000,800,0.488,122195.04,149678.02,149678.02
2,1000,10,64,20,21359.09,20000,12800000,936,0.572,1058505.62,1155053.66,1155053.66

@kunwp1 kunwp1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the feature! Left three comments!

@aglinxinyuan
aglinxinyuan requested a review from kunwp1 November 17, 2026 05:33

@kunwp1 kunwp1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Left a few small follow-ups.

@aglinxinyuan
aglinxinyuan requested a review from kunwp1 November 17, 2026 08:07
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 17, 2026
Merged via the queue into apache:main with commit 095da7b Nov 17, 2026
40 checks passed
@aglinxinyuan
aglinxinyuan deleted the feat/invite-only-setting branch November 17, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common docs Changes related to documentations engine feature frontend Changes related to the frontend GUI infra platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make invite-only decide new accounts' role and let admins switch it

4 participants