perf(#6179): skip WIF provisioning when provider already exists - #6195
Open
fullsend-ai-coder[bot] wants to merge 2 commits into
Open
perf(#6179): skip WIF provisioning when provider already exists#6195fullsend-ai-coder[bot] wants to merge 2 commits into
fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
|
🤖 Finished Review · ✅ Success · Started 5:31 PM UTC · Completed 5:43 PM UTC Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsLow
Previous runReviewFindingsLow
Previous run (2)ReviewFindingsLow
Labels: PR modifies behaviour test install driver (pkg/behaviourtest/drivers/install/) |
Add a read-before-write guard in RunGitHubSetup: before calling ProvisionInference (which walks the full create → conflict → undelete → update → enable IAM write sequence), first check whether a healthy WIF provider already exists via "inference status". When the provider is found and healthy, skip provisioning entirely and reuse it. This eliminates redundant IAM write operations on every merge-queue attempt for repos whose WIF providers are already correctly configured. The fallback path still provisions when the provider is missing or unhealthy. Note: pre-commit could not run (sandbox network policy blocks git fetch). golangci-lint not available in sandbox. go vet and all tests passed. Closes #6179 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pkg/behaviourtest/drivers/install/common package had no test files of its own; RunGitHubSetup and GetExistingInferenceWIFProvider were only exercised indirectly through the install package's tests, which does not count toward common's own coverage in CI's default `go test ./...` (no -coverpkg), leaving codecov/patch at 0% for this PR's changes despite passing tests. Add setup_test.go with direct unit tests for both functions. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
ralphbean
force-pushed
the
agent/6179-skip-inference-provision
branch
from
August 13, 2026 18:31
a3d4840 to
fcda183
Compare
|
🤖 Finished Review · ✅ Success · Started 6:33 PM UTC · Completed 6:46 PM UTC Commit: |
Member
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 1:47 PM UTC · Completed 1:59 PM UTC Commit: |
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.
Summary
Add a read-before-write guard to
RunGitHubSetupso that WIF provider provisioning is skipped when an existing healthy provider is found viainference status. This eliminates redundant IAM write operations (create/undelete/update/enable) on every merge-queue attempt for repos whose WIF providers are already correctly configured.Related Issue
Changes
GetExistingInferenceWIFProviderinpkg/behaviourtest/drivers/install/common/setup.go— runsinference statusto check for an existing healthy WIF provider before provisioningRunGitHubSetupto try the existing provider lookup first, falling back toProvisionInferenceonly when the provider is missing or unhealthyTestRepoEnsurer_DoEnsure_WithGCPProject→ renamed to_SkipsProvisionto verify the read-before-write guard skips provisioning (2 CLI calls instead of 3)TestRepoEnsurer_DoEnsure_WithGCPProject_FallsBackToProvisionto verify the fallback path when no existing provider is found (4 CLI calls: status-fail, provision, status-ok, setup)Testing
RunGitHubSetupandGetExistingInferenceWIFProviderProvisionInferenceError,StatusCLIError,ParseWIFProviderError) continue to pass — the fallback path preserves their behaviorCloses #6179
Post-script verification
agent/6179-skip-inference-provision)0dfd422a67a70dad790965ecd11e132fb421e704..HEAD)