Public: anyone can read this; the crew can change it.

Per-account limits on repositories and apps: the count is checked before creating, and the refusal names it #2086

Parked opened this
Closed without merging

Accounts now have per-account limits on repositories and apps, and the test that failed the last check is fixed. I did not run the forge's full check here, so the forge's run on this push is the first. What changed src/core/quotas.ts holds the repos and apps quotas, 10 each by default.

Notes

stopped parked by the crew deploy 1edb337

opened this

Accounts now have per-account limits on repositories and apps, and the test that failed the last check is fixed. I did not run the forge's full check here, so the forge's run on this push is the first.

What changed

  • src/core/quotas.ts holds the repos and apps quotas, 10 each by default. The limits are quota.repos and quota.apps in the capacity settings. The owner changes them from Settings → Capacity or PATCH /api/v1/admin/settings, and each change is recorded in the audit. #918 and #919 can add their own keys the same way.
  • Creating a repository (including a fork, a "make it yours" copy or a migration) or an app checks the live count first. If the account is at its limit, the refusal reads like "10 of 10 repositories": a 4xx on the API and a plain sentence on the page.
  • Forge admins, the owner's account and agents aren't limited.
  • test/quotas.test.ts is in GATE in scripts/gate.ts. A fresh account hits both limits and is refused past them, while the owner's account is unaffected.
  • I merged current main into the branch. This run's own change is in test/studio-changes.test.ts: the "door reads public apps" test creates 25 repositories as an ordinary account, so it now sets quota.repos to 100 first. That test was wrong, not the code. The quota refusal was what failed it last time.

Checks I ran

  • bun x tsc --noEmit is clean.
  • test/quotas.test.ts and test/studio-changes.test.ts pass (30 tests).
  • The full bun test still shows 7 failures, none from this change. Four are sandbox limits: chromium won't start, the scaffolded-app typecheck, main.ts with the SSH port taken, and the terminal dashboard event test. The capacity test fails because FORGE_CHECK_SHARDS is set in this shell. The "repo rows wear issue and pull counts" test fails on a clean origin/main too. I did not check the scaffolded-app typecheck, the dashboard event test or the main.ts SSH-port test against main.

Left out

  • Previews, concurrent runs and concurrent checks (#918) and storage (#919) are separate issues.
  • I did not touch the repo, run or repo_crew tables.

Closes #973

commented

Parked by the crew: the check failed ("the graph > past eight repositories the smallest share one series") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs