Repository navigation
Description
Problem
#9142 grew the DEV pool to 22 orgs. Rolling the new allowlist out to the e2e inference gateway showed three gaps in hack/setup-e2e-inference-gateway.sh:
- The config grows with the pool, up to a hard limit. The rendered config repeats the full repository list 6 times (two rate-limit keys, one
allowrule per real model). At 23 orgs × 12 repos it is 50,827 bytes (12 orgs: 30,622). Secret Manager rejects a version over 65,536 bytes, and each extra org adds about 2 KB. So roughly 7 more orgs, or a largerDefaultPoolSize, breaks the secret write mid-run, after the busy check and the frozen diff have passed. - The pool is listed by hand in three places, and nothing checks that they agree.
POOL_ORGS/POOL_REPOSin the script,orgPoolininternal/e2etest/testutil.go, andDevPoolOrgCount/DefaultPoolSizeinpkg/behaviourtest/drivers/install/. ci(e2e): expand DEV pool to 22 orgs #9142 updated the gateway script, but the gateway itself was not redeployed in the same change, and the behaviour run got HTTP 403 onhalfsend-14/test-repo-05.hack/setup-new-e2e-org.shends with "Uncomment ... in testutil.go orgPool" and never mentions the gateway script. - The docs say a pool change is a plain re-run, but the script refuses it. New orgs are inserted before the STAGE org
halfsend. The frozen-path diff only allows repos appended after the pool list, so a pool change exits 4 and needs--allow-frozen-change. The script header ("Re-running after a pool change adds a config secret version and rolls a new Cloud Run revision") and the "Pool change" bullet indocs/guides/dev/e2e-testing.mdboth say otherwise.
The pool names follow a fixed pattern (halfsend-NN/test-repo-NN, plus the STAGE org halfsend), so one anchored regular expression can replace the 276-entry list.
Scope
- Match the pool with one anchored regex instead of a list.
- Build it from two counts in the script,
POOL_ORG_COUNT(22) andPOOL_REPO_COUNT(12). Do not list names by hand. For the current pool it is:
^halfsend(-(01|02|...|22))?/test-repo-(01|02|...|12)$ - Write each number as an explicit alternative. Do not use
[0-9]{2}or digit ranges. The rule must admit exactly the pool, sohalfsend-00,halfsend-23andhalfsend-01/test-repo-13are refused. Whoever owns a pool-shaped org name outside the pool must not get access. - Use it in every place the list is used today:
- model
allowrules:jwt.repository.matches('<regex>') - both rate-limit keys:
default(jwt.repository, "").matches('<regex>')
- model
- The header comment keeps the counts, for example
# 276 allowed repositories (23 orgs x 12 repos). - Temporary repositories still get added as exact names:
jwt.repository.matches('<regex>') || jwt.repository in ["owner/name"]. Updatemask_configand its comment, so that only that trailing exact-name list is masked in the frozen-path diff, and a changed regex or count stays visible.
- Build it from two counts in the script,
- Keep the script's counts in sync with the behaviour pool.
- Add a test to
hack/setup-e2e-inference-gateway_test.shthat readsDevPoolOrgCountfromslotpool.goandDefaultPoolSizefromdriver.go, and fails whenPOOL_ORG_COUNT/POOL_REPO_COUNTdiffer. - Add a Go test that
orgPoolequalshalfsend-01...halfsend-<DevPoolOrgCount>.
- Add a test to
- Size guard. After rendering the config, and before any change, fail with a clear error naming the byte count when it exceeds 65,536 bytes. Print the config size in the normal output. Add a test: an oversized config exits non-zero and makes no gcloud write.
- Regex tests in
hack/setup-e2e-inference-gateway_test.sh, run against the rendered config's regex withgrep -E(an anchored alternation behaves the same in RE2 and ERE):- all 276 pool names match;
- these names are refused:
halfsend-00/test-repo-01,halfsend-23/test-repo-01,halfsend-1/test-repo-01,halfsend-01/test-repo-13,halfsend-01/test-repo-00,halfsend-01/test-repo-1,xhalfsend-01/test-repo-01,halfsend-01/test-repo-01x,halfsend-01/test-repo-01/x,Halfsend-01/test-repo-01,halfsend-01-x/test-repo-01. - Update the existing "allows the 23 x 12 pool repositories" check to read the counts and the regex.
- Docs.
docs/guides/dev/e2e-testing.md: the "authorises each model with an exact-match list ofjwt.repositoryvalues" bullet describes the anchored regex and says why it uses explicit alternatives.- The script header and the "Pool change" bullet: a pool change edits
POOL_ORG_COUNTorPOOL_REPO_COUNTand needs--allow-frozen-change, outside a release window, with the maintainers told first. Run--dry-runfirst: it shows the diff and exits 4. hack/setup-new-e2e-org.shnext steps: add the gateway script step, and fix theorgPoolwording to match how the list is kept now.
Out of scope: rate limits, models, API keys, and deploying to the live gateway. The first deploy after this change is a frozen change, run by an operator with --allow-frozen-change.
Done when
bash hack/setup-e2e-inference-gateway_test.shpasses, including the new regex, size and count-sync cases.go test ./internal/e2etest ./pkg/behaviourtest/drivers/installpasses.hack/setup-e2e-inference-gateway.sh --print-config --with-vertex(withE2E_GCP_PROJECT_IDset) renders a config whose only differences frommain's are the repository rules, the header and the comments.
Added for the PR takeover: pin the pool org ids
A rule that matches names alone trusts whoever holds an org name. If a pool org is deleted or renamed while the deployed rule still names it, a new owner of that name gets inference on the real models. Org ids are never reused, so pin them the way the fleet gateway pins repository_owner_id. Repository ids cannot be pinned: slot repositories are deleted and re-created for each lease.
-
Rule.
- Model
allowrules:jwt.repository_owner_id in [<ids>] && jwt.repository.matches('<regex>'). - Rate-limit keys: the same, with
default(..., "")on both claims. - Measured on the live 23-org config: 50,827 bytes with the exact list today, 5,501 with the regex alone, 7,507 with the regex and the id pin. Each extra org adds about 100 bytes.
- Model
-
Ids live in the script, one
org=idper pool org. Never look them up at deploy time: that would pin whoever owns the name on that day. Current values (gh api orgs/<org> --jq .id):Org Id halfsend273231846halfsend-01286139071halfsend-02286136132halfsend-03286139209halfsend-04286139284halfsend-05286139354halfsend-06286139421halfsend-07298026865halfsend-08298029010halfsend-09298029468halfsend-10298030162halfsend-11298030745halfsend-12298031207halfsend-13351883647halfsend-14353052683halfsend-15353052733halfsend-16353052777halfsend-17353052812halfsend-18353052850halfsend-19353052883halfsend-20353052926halfsend-21353052961halfsend-22353053001 -
Check at every run, before any change and in
--dry-run:- each pinned org's current id from
gh api orgs/<org>must equal the pinned id; - a mismatch or a missing org stops the run with an error naming the org.
- Tests: a stubbed mismatch exits non-zero with no gcloud write, and the org-count check also covers the number of pinned ids.
- each pinned org's current id from
-
Docs, in the "Pool change" bullet and
hack/setup-new-e2e-org.shnext steps:- Adding an org: add its id (with the command above) along with the count.
- Removing an org: lower the count and deploy before the org is deleted or renamed, so the deployed rule never names an org we no longer hold.
- Say in one sentence why both the id and the name are matched.
-
Rule tests add: a pool name with a wrong owner id is refused, and a pool name with no owner-id claim is refused.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
waynesun09 commentedon Nov 6, 2026
/fs-code
Do not sign off. No
git commit -s, noSigned-off-bytrailer. Scope is the issue body.fullsend-ai-triage commentedon Nov 6, 2026
🤖 Finished Triage · ✅ Success · Started 1:03 PM UTC · Completed 1:05 PM UTC
Commit:
21ba75e· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.18
fullsend-ai-coder commentedon Nov 6, 2026
🤖 Code ·⚠️ Cancelled · Started 1:03 PM UTC · Ended 1:05 PM UTC
Commit:
21ba75e· View workflow run →[-]hack: guard e2e gateway config size and keep its pool in sync with the behaviour pool[/-][+]hack: match the e2e gateway pool with one regex, guard config size, keep pool counts in sync[/+]fullsend-ai-triage commentedon Nov 6, 2026
Re-triage confirms the earlier result: this issue is ready for implementation. All named files and constants exist, no open PR addresses it, and the scope and tests in the issue are specific enough to implement directly.
Notes for the implementer
--print-config --with-vertexdiffers frommainonly in the repository rules, header and comments, so a live--dry-runshows only the intended frozen change.--allow-frozen-change.hack/setup-new-e2e-org.shanddocs/guides/dev/e2e-testing.md. It is not a blocker, but expect a possible merge conflict in the docs changes.Proposed test case
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancePrevious run
Triage found this issue ready for implementation. The three scoped items are clear, and each named file and constant exists in the repo. I found no duplicate issues and no open PR for this work.
Notes for the implementer
main. Check this with--print-config --with-vertexbefore and after the refactor, so a live--dry-runstill reports no changes.--allow-frozen-change, as the issue specifies.Proposed test cases
The
/fs-coderequest in the comments asks for no sign-off (no-sand noSigned-off-bytrailer). That applies to the implementation run.Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancefullsend-ai-coder commentedon Nov 6, 2026
🤖 Finished Code ·⚠️ Cancelled · Started 1:03 PM UTC · Completed 1:05 PM UTC
Commit:
21ba75e· View workflow run →Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high
waynesun09 commentedon Nov 6, 2026
/fs-code
Do not sign off. No
git commit -s, noSigned-off-bytrailer. Scope is the issue body.fullsend-ai-triage commentedon Nov 6, 2026
🤖 Triage · ❌ Terminated · Started 1:07 PM UTC · Ended 1:09 PM UTC
Commit:
7c9f11f· View workflow run →fullsend-ai-coder commentedon Nov 6, 2026
🤖 Code · ❌ Terminated · Started 1:08 PM UTC · Ended 1:23 PM UTC
Commit:
7c9f11f· View workflow run →fullsend-ai-triage commentedon Nov 6, 2026
🤖 Finished Triage · ✅ Success · Started 1:07 PM UTC · Completed 1:09 PM UTC
Commit:
7c9f11f· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.14
[-]hack: match the e2e gateway pool with one regex, guard config size, keep pool counts in sync[/-][+]hack: match the e2e gateway pool by org id and one regex, guard config size, keep pool counts in sync[/+]fullsend-ai-triage commentedon Nov 6, 2026
🤖 Finished Triage · ✅ Success · Started 1:22 PM UTC · Completed 1:24 PM UTC
Commit:
7c9f11f· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.18
fullsend-ai-coder commentedon Nov 6, 2026
🤖 Finished Code · ✅ Success · Started 1:08 PM UTC · Completed 1:23 PM UTC
Commit:
7c9f11f· View workflow run →Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $3.06
fullsend-ai-triage commentedon Nov 6, 2026
An open PR already implements this issue: the single anchored regex built from the two pool counts, the count-sync checks against the behaviour pool, the config size guard, the Go
orgPooltest and the doc updates. The PR is not a draft.One gap to check during review: the PR description does not mention the owner-id pinning added under the PR takeover section. That covers the
repository_owner_idrule, the per-run check of each org id, the stubbed id-mismatch tests, and the wrong-id and missing-claim rule tests. If the PR omits it, it will need a follow-up commit or a separate PR.Open PR #9061 also edits the e2e org setup script and the e2e testing guide, so expect a possible merge conflict in the docs. No CI or workflow file changes are needed.
Addressed by:
chore(#9153): bind the e2e gateway pool regex to each org's id
chore(fullsend-ai#9153): match the e2e gateway pool with one regex an…
Merge pull request fullsend-ai#9156 from fullsend-ai/agent/9153-gatew…