Repository navigation
perf: start the apply sooner and run Terraform with parallelism 20 - #27
Merged
Merged
Conversation
The admin check is now the first step of the resolve job, before any token is minted or anything read, instead of a job of its own: one job start fewer (about 7 s) with the same order and the same refusal. Terraform plan and apply run with -parallelism=20 (default 10): measured refresh runs at about 2 s per ARM read, so 20 is about 9 reads a second, well inside ARM's 25 a second per principal for 50 teams; azurerm and azuread serialise writes to one Foundry account or one registration, so concurrent writes do not conflict. The pause gate stays its own job, as AIP_PAUSED lives only in the {env}-events Environment.
DaRoszko
requested
a balanced review from Copilot
and removed request for
a team
October 29, 2026 21:40
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the workflow startup optimization and Terraform concurrency changes.
No open issues 🎉
What changed in this PR
Reduces startup overhead and increases Terraform concurrency in the reusable apply workflow used by tenants and deployments, without changing caller inputs or secrets.
Changes:
- Moves the initial admin check into the first step of
resolve, removing a separate job while retaining the apply-time recheck. - Sets Terraform plan and apply parallelism to 20.
- Updates tests to verify admin-check ordering and the Terraform arguments.
| File | Description |
|---|---|
tests/unit/workflows.test.js |
Verifies the admin check precedes token creation and resolution, with no separate access job. |
tests/integration/scripts/apply.test.js |
Checks that plan and apply pass -parallelism=20. |
scripts/apply.sh |
Sets and uses parallelism 20 for Terraform plan and apply. |
.github/workflows/apply-state.yml |
Merges the initial admin check into resolve and updates rerun comments. |
Review effort: Balanced
ai-platform-orchestrator Bot
added a commit
that referenced
this pull request
Oct 29, 2026
🤖 I have created a release *beep* *boop* --- ## [2.0.4](v2.0.3...v2.0.4) (2026-10-29) ### Performance Improvements * start the apply sooner and run Terraform with parallelism 20 ([#27](#27)) ([4534e21](4534e21)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: ai-platform-orchestrator[bot] <333351233+ai-platform-orchestrator[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Cuts the time of every platform and tenants apply. There are two changes, and neither alters isolation, control flow or permissions.
resolve, before any App token is minted or anything is read, so the order and the refusal are unchanged. This saves one job start and its queue gap, about 7 s per run (run 40928903653 hadaccess18:14:25 to 18:14:30 andresolvestarting 18:14:32).-parallelism=20(the default is 10).Why it is safe
deployments: read. The check does not use it, and anyone who can read the repository can already read it. No secret is exposed before the check: the App key reaches only the token step that comes after it.applyjob still re-checks the actor on every attempt.AIP_PAUSEDexists only in the{env}-eventsEnvironment, and a job has one Environment. Merging the gate would mean moving the switch, which is a control change.apply / access(checked across tenants, deployments, infra and workflows).Why parallelism 20
Tests
tests/unit/workflows.test.js: the check comes before the token step and beforeresolve-apply, and there is noaccessjob.tests/integration/scripts/apply.test.js: plan and apply pass-parallelism=20.workflowsandapply.shsuites pass (97); lint, shellcheck and actionlint pass.Release
perf:gives a patch release. It reaches tenants and deployments at@v2with no change to callers' inputs, secrets or permissions.