fix: Removing extra --auth-provider-cmd call - #6045
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughCentralizes IAM credential handling in dependency output retrieval by merging IAM options and using an AWS provider-based credential setup, adds ChangesDependency Output Credential Centralization
Auth-Provider Command Test Fixtures and Integration Test
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Trivy (0.69.3)Failed to read Trivy output file: ENOENT: no such file or directory, open '/inmem/1273/nsjail-d9ceaa76-3ed6-436f-9d0c-a7bce399475e/merged/.trivy-output.json' Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/integration_test.go (1)
3354-3367: ⚡ Quick winAssert the per-module invocation pattern, not just the total count.
assert.Len(t, calls, 5)plus the cache-dir check will still pass if the extra auth-provider invocation moves to the wrong unit but the total stays at five. Since this regression is specifically about prefetching in unit directories for dependencies, please also assert the expected working-dir distribution (dep= 3,dependent= 2) or the exact documented sequence.Proposed assertion tightening
assert.Len(t, calls, 5) + expectedCounts := map[string]int{ + filepath.Join(rootPath, "dep"): 3, + filepath.Join(rootPath, "dependent"): 2, + } + actualCounts := map[string]int{} + for _, call := range calls { assert.NotContains(t, call.WorkingDir, ".terragrunt-cache") + actualCounts[call.WorkingDir]++ } + + assert.Equal(t, expectedCounts, actualCounts)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/integration_test.go` around lines 3354 - 3367, Tighten the test by asserting the per-module invocation pattern instead of only total count: compute counts for each call.WorkingDir from the calls slice and assert that the working-dir corresponding to the "dep" module appears exactly 3 times and the "dependent" module appears exactly 2 times (or alternatively assert the exact documented sequence of WorkingDir values matches the expected 5-element order). Update the assertions surrounding calls and the cache-dir check to verify these per-module counts/sequence so the regression (extra auth-provider invocation moving to the wrong unit) is caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/integration_test.go`:
- Around line 3354-3367: Tighten the test by asserting the per-module invocation
pattern instead of only total count: compute counts for each call.WorkingDir
from the calls slice and assert that the working-dir corresponding to the "dep"
module appears exactly 3 times and the "dependent" module appears exactly 2
times (or alternatively assert the exact documented sequence of WorkingDir
values matches the expected 5-element order). Update the assertions surrounding
calls and the cache-dir check to verify these per-module counts/sequence so the
regression (extra auth-provider invocation moving to the wrong unit) is caught.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cca5019f-1d39-4ea8-b225-82acce4a5864
📒 Files selected for processing (8)
test/fixtures/auth-provider-cmd/run-all-call-count/.gitignoretest/fixtures/auth-provider-cmd/run-all-call-count/auth-provider.shtest/fixtures/auth-provider-cmd/run-all-call-count/dep/main.tftest/fixtures/auth-provider-cmd/run-all-call-count/dep/terragrunt.hcltest/fixtures/auth-provider-cmd/run-all-call-count/dependent/main.tftest/fixtures/auth-provider-cmd/run-all-call-count/dependent/terragrunt.hcltest/fixtures/auth-provider-cmd/run-all-call-count/root.hcltest/integration_test.go
* fix: Removing extra `--auth-provider-cmd` call * chore: Adding `TestReadTerragruntAuthProviderCmdRunAllCallCountWithRacing`
Description
Removes additional call to the authentication provider command, preventing calls in
.terragrunt-cachedirectories in favor of the ones that are called in unit directories beforehand for dependencies.TODOs
Read the Gruntwork contribution guidelines.
Summary by CodeRabbit