Repository navigation
Fix AWS store auth and add Floci E2E coverage - #2625
Conversation
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency ReviewThe following issues were found:
License Issuesgo.mod
Scanned Files
|
|
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR wires store auth resolvers into more execution paths, expands store endpoint and local-auth options, blocks reads from secret stores, adds Floci-based E2E infrastructure and scenarios, introduces runnable AWS gists, updates CI for Floci tests, and aligns store and secret documentation around canonical ChangesStore auth, backends, Floci tests, and docs
Estimated code review effort🎯 5 (Critical) | ⏱️ ~100 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 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.
Inline comments:
In @.github/workflows/test.yml:
- Around line 442-447: The actions/setup-go@v6 step in the Floci E2E tests job
is missing an explicit cache policy configuration. Currently it relies on the
default behavior which enables caching, creating a potential security risk for
PR workflows. Add a cache: false parameter to the with section of the
actions/setup-go step to explicitly disable caching and prevent cache poisoning
from untrusted code.
In `@cmd/secret/shared_loaders_test.go`:
- Around line 86-113: Add a new subtest to TestSecretStoreDefaultIdentity that
covers the cfg.IdentityFlagDisabledValue sentinel path. Create a test case
(similar to the existing "select sentinel falls back to auth chain" subtest)
that passes secretScope with Identity set to cfg.IdentityFlagDisabledValue to
the secretStoreDefaultIdentity function and verifies the correct behavior,
setting up any necessary mock expectations on authManager and asserting the
expected return value.
In `@cmd/terraform/utils_hooks_test.go`:
- Around line 769-796: The TestHookStoreDefaultIdentity test function in the
hookStoreDefaultIdentity test suite is missing a test case for the
disabled-identity sentinel value handled by the cfg.IdentityFlagDisabledValue
check. Add a new t.Run sub-test case that tests when the Identity field in
schema.ConfigAndStacksInfo is set to the disabled identity sentinel value, mock
the authManager appropriately (similar to the existing test cases), call
hookStoreDefaultIdentity with this configuration, and assert that the function
falls back to the chain-based identity resolution behavior. This will ensure the
precedence logic for disabled identities is properly tested and maintained.
In `@gists/aws-secrets/iam/secrets-policy.json`:
- Around line 7-14: The issue is that ssm:DescribeParameters action is grouped
with other actions in the same statement, but this action does not support
resource-level permissions and requires Resource set to "*". Remove
ssm:DescribeParameters from the existing statement (which contains
ssm:PutParameter, ssm:GetParameter, and ssm:DeleteParameter with the specific
parameter ARN resource), then create a separate new statement with the same
Effect and Principal but with Action containing only ssm:DescribeParameters and
Resource set to "*". This ensures account-level parameter listing operations
work correctly while maintaining least-privilege access for the other
parameter-specific actions.
In `@gists/aws-secrets/README.md`:
- Around line 108-110: The test command shown at line 109 uses a relative path
`./tests` that assumes execution from the repository root, but the documentation
earlier at line 27 directs users to the `gists/aws-secrets` directory. Add a `cd
../..` command before the test command to navigate back to the repository root
so the `./tests` path resolves correctly, ensuring users can run the Floci test
command without encountering a path not found error.
In `@gists/aws-store-hooks/iam/store-writer-policy.json`:
- Around line 7-14: The ssm:DescribeParameters action in the
store-writer-policy.json file must be moved to a separate IAM policy statement
because it is an account-level action that requires the wildcard resource "*"
and does not support parameter-level resource scoping. Remove
ssm:DescribeParameters from the current statement that contains
ssm:PutParameter, ssm:GetParameter, and ssm:DeleteParameter with the parameter
ARN resource, then create a new separate statement specifically for the
ssm:DescribeParameters action with "Resource": "*" to avoid AccessDenied errors.
In `@gists/aws-store-hooks/README.md`:
- Around line 60-62: The Floci test command in the README uses a relative path
./tests that assumes the user is running from the repository root, but the
documentation places users in the gists/aws-store-hooks subdirectory. Add a cd
../.. command before the ATMOS_TEST_FLOCI environment variable setup to navigate
back to the repository root before executing the go test command, ensuring the
relative path ./tests resolves correctly.
In `@internal/exec/describe_component_test.go`:
- Around line 21-49: The test TestDescribeStoreDefaultIdentity currently expects
the last chain entry to take precedence, but the correct precedence should be:
explicit configured default identity should be checked before falling back to
the chain. In the first test case "authenticated chain wins", update the
expectations so that when both a chain and a default identity are available, the
function should call GetDefaultIdentity(false) and return that result instead of
the last chain entry. This test should demonstrate that the default identity
takes precedence over the chain fallback. Adjust the mock expectations in this
test case to set up GetDefaultIdentity(false) to return a value and verify that
the returned value from describeStoreDefaultIdentity matches the default
identity rather than the chain entry.
In `@internal/exec/describe_component.go`:
- Around line 185-196: In the describeStoreDefaultIdentity function, reorder the
precedence logic so that GetDefaultIdentity is checked first before falling back
to the chain tail. Currently the function returns chain[len(chain)-1] whenever a
chain exists, which prevents GetDefaultIdentity from being evaluated. Instead,
first attempt to retrieve the identity using
authManager.GetDefaultIdentity(false) and return it if successful, then only
fall back to checking the chain and returning its last element if the default
identity was not available.
In `@tests/floci_harness_test.go`:
- Around line 209-223: When ATMOS_TEST_FLOCI environment variable is set to true
(opt-in test run), the TCP probe failure at net.DialTimeout and the HTTP probe
failure at http.DefaultClient.Do should hard-fail using t.Fatalf instead of
skipping silently with t.Skipf. Check if the environment variable is true and
conditionally choose between t.Fatalf (for opted-in runs that must have
coverage) and t.Skipf (for optional runs) for both the TCP dial error handling
and HTTP request error handling to ensure opted-in runs fail loudly when
endpoints are unreachable.
In `@website/docs/cli/configuration/stores.mdx`:
- Line 34: The stores.mdx file correctly uses canonical store kinds like
azure/keyvault and gcp/secretmanager, but other documentation files in the
repository (agent-skills documentation, tutorials, and multi-cloud guide) still
reference the legacy forms such as azure-key-vault and google-secret-manager.
Update all references to store kinds in these other documentation files to use
the canonical forms (azure/keyvault for Azure Key Vault and gcp/secretmanager
for Google Secret Manager) to keep the documentation consistent across the
repository, while optionally noting that legacy forms are still supported for
backward compatibility.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6d0516ee-1395-4cb1-9e2a-03c4482d6672
📒 Files selected for processing (79)
.github/workflows/test.ymlagent-skills/skills/atmos-stores/SKILL.mdagent-skills/skills/atmos-stores/references/store-providers.mdcmd/secret/shared.gocmd/secret/shared_loaders_test.gocmd/terraform/utils.gocmd/terraform/utils_hooks_test.godocs/fixes/2026-06-17-aws-stores-secrets-auth-and-gists.mdgists/aws-secrets/README.mdgists/aws-secrets/atmos.yamlgists/aws-secrets/components/terraform/secret-consumer/main.tfgists/aws-secrets/components/terraform/secret-consumer/outputs.tfgists/aws-secrets/iam/secrets-policy.jsongists/aws-secrets/stacks/dev.yamlgists/aws-secrets/stacks/prod.yamlgists/aws-store-hooks/README.mdgists/aws-store-hooks/atmos.yamlgists/aws-store-hooks/components/terraform/output-demo/main.tfgists/aws-store-hooks/components/terraform/output-demo/outputs.tfgists/aws-store-hooks/iam/store-writer-policy.jsongists/aws-store-hooks/stacks/consumer.yamlgists/aws-store-hooks/stacks/producer.yamlinternal/exec/describe_component.gointernal/exec/describe_component_test.gointernal/exec/template_funcs_store.gointernal/exec/template_funcs_store_test.gointernal/exec/terraform_test.gointernal/gcp/auth.gointernal/gcp/auth_test.gopkg/config/identity_dots_test.gopkg/config/load.gopkg/config/process_yaml.gopkg/function/store.gopkg/function/store_test.gopkg/store/authbridge/resolver.gopkg/store/authbridge/resolver_test.gopkg/store/aws_secrets_manager_store.gopkg/store/aws_secrets_manager_store_test.gopkg/store/aws_ssm_param_store.gopkg/store/aws_ssm_param_store_test.gopkg/store/azure_keyvault_store.gopkg/store/google_secret_manager_store.gopkg/store/identity.gopkg/store/identity_test.gopkg/store/options.gopkg/store/registry.gopkg/store/registry_kind_test.gopkg/store/registry_test.gotests/README.mdtests/aws_stores_floci_test.gotests/azure_stores_floci_test.gotests/fixtures/scenarios/aws-secrets-floci/atmos.yamltests/fixtures/scenarios/aws-secrets-floci/components/terraform/secret-consumer/main.tftests/fixtures/scenarios/aws-secrets-floci/components/terraform/secret-consumer/outputs.tftests/fixtures/scenarios/aws-secrets-floci/stacks/dev.yamltests/fixtures/scenarios/aws-secrets-floci/stacks/prod.yamltests/fixtures/scenarios/aws-store-hooks-floci/atmos.yamltests/fixtures/scenarios/aws-store-hooks-floci/components/terraform/output-demo/main.tftests/fixtures/scenarios/aws-store-hooks-floci/components/terraform/output-demo/outputs.tftests/fixtures/scenarios/aws-store-hooks-floci/stacks/consumer.yamltests/fixtures/scenarios/aws-store-hooks-floci/stacks/producer.yamltests/fixtures/scenarios/azure-secrets-floci/atmos.yamltests/fixtures/scenarios/azure-secrets-floci/stacks/dev.yamltests/fixtures/scenarios/gcp-secrets-floci/atmos.yamltests/fixtures/scenarios/gcp-secrets-floci/stacks/dev.yamltests/floci_harness_test.gotests/gcp_stores_floci_test.gotests/preconditions.gotests/terraform_floci_dag_test.gotests/testhelpers/toolchain.gowebsite/docs/cli/commands/secret/usage.mdxwebsite/docs/cli/configuration/secrets.mdxwebsite/docs/cli/configuration/stores.mdxwebsite/docs/functions/template/atmos.Store.mdxwebsite/docs/functions/yaml/store.get.mdxwebsite/docs/functions/yaml/store.mdxwebsite/docs/intro/multi-cloud.mdxwebsite/docs/stacks/hooks.mdxwebsite/docs/tutorials/sharing-state/stores.mdx
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
agent-skills/skills/atmos-config/SKILL.md (1)
180-186:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMove
identityout ofoptionsin this store example.This example puts
identityin the wrong place. It should be a sibling ofkind, not nested underoptions, or users may silently miss identity-based auth resolution.Suggested fix
stores: ssm/dev: kind: aws/ssm + identity: dev-admin options: region: us-east-1 - identity: dev-admin🤖 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 `@agent-skills/skills/atmos-config/SKILL.md` around lines 180 - 186, In the ssm/dev store example, the identity field is incorrectly nested under the options section. Move the identity field out of options so it becomes a sibling of the kind field at the same indentation level. This ensures the configuration matches the expected structure and prevents users from accidentally misconfiguring identity-based authentication.pkg/store/aws_secrets_manager_store.go (1)
87-94:⚠️ Potential issue | 🟠 Major | ⚡ Quick winReset lazy init state when resolver is injected for an existing identity.
When a store is created with a non-empty
identityName, an early call toensureClient()before resolver injection can cacheinitErr. A laterSetAuthContext(resolver, "")(the normal path for preconfigured identities) does not clear that state, so the store can stay permanently broken.Suggested fix
func (s *SecretsManagerStore) SetAuthContext(resolver AuthContextResolver, identityName string) { s.authResolver = resolver if identityName != "" && s.identityName != identityName { s.identityName = identityName s.client = nil s.initOnce = sync.Once{} s.initErr = nil + return + } + + // Resolver injected for an already-configured identity after a prior lazy-init failure. + if identityName == "" && s.identityName != "" && s.client == nil && s.initErr != nil { + s.initOnce = sync.Once{} + s.initErr = nil } }🤖 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 `@pkg/store/aws_secrets_manager_store.go` around lines 87 - 94, In the SetAuthContext method, the lazy initialization state (initOnce and initErr) is only being reset when the identityName changes, but it should also be reset when the resolver is injected for an existing identity with an empty identityName. Modify the condition to additionally reset s.initOnce and s.initErr when identityName is empty (the normal path for preconfigured identities), ensuring that any previously cached initialization errors are cleared when a new resolver is provided, preventing the store from remaining in a broken state.tests/preconditions.go (1)
365-383:⚠️ Potential issue | 🟠 Major | ⚡ Quick winSerialize global
PATHupdates across binaries.Line 365 guards once-per-binary, but Lines 377-382 mutate one global
PATH. Parallel misses for different binaries can clobber each other and cause flakyexec.LookPathoutcomes.Suggested fix
var testToolPathLocks sync.Map +var testToolPathMu sync.Mutex @@ lockValue, _ := testToolPathLocks.LoadOrStore(binary, &sync.Once{}) lockValue.(*sync.Once).Do(func() { @@ - path := os.Getenv("PATH") - if path == "" { - os.Setenv("PATH", binDir) - return - } - os.Setenv("PATH", binDir+string(os.PathListSeparator)+path) + testToolPathMu.Lock() + defer testToolPathMu.Unlock() + + path := os.Getenv("PATH") + if path == "" { + _ = os.Setenv("PATH", binDir) + return + } + _ = os.Setenv("PATH", binDir+string(os.PathListSeparator)+path) }) }🤖 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 `@tests/preconditions.go` around lines 365 - 383, The code uses a per-binary lock (testToolPathLocks) to ensure once-per-binary execution, but the PATH environment variable modification in lines 377-382 is global and shared across all binaries. When different binaries are processed in parallel, their Do() functions can execute concurrently and race to modify the global PATH, causing flaky behavior. Add a global sync.Mutex to serialize all modifications to the PATH environment variable. Guard the entire os.Setenv("PATH", ...) section with this global mutex to ensure that only one goroutine modifies PATH at a time, regardless of which binary is being processed.
🤖 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.
Inline comments:
In `@agent-skills/skills/atmos-config/references/sections-reference.md`:
- Around line 272-278: The `identity` field in the ssm/dev store example is
incorrectly positioned as a nested property under `options` when it should be a
top-level property of the store configuration itself. Move the `identity:
dev-admin` line from under the `options` section to be at the same indentation
level as the `options` key and the `kind: aws/ssm` property in the ssm/dev store
block.
In `@website/docs/cli/commands/toolchain/toolchain-get.mdx`:
- Around line 77-87: The documentation page contains inconsistent examples of
configured Terraform versions - one example shows 1.15.6 (configured) while
other examples display 1.9.8 as the configured/current version. Search through
the entire toolchain-get.mdx page and update all instances where a version is
marked with the "(configured)" label to use the same version number consistently
throughout the page. Select either 1.15.6 or 1.9.8 as the standard configured
version and apply it uniformly across all examples to maintain consistency.
---
Outside diff comments:
In `@agent-skills/skills/atmos-config/SKILL.md`:
- Around line 180-186: In the ssm/dev store example, the identity field is
incorrectly nested under the options section. Move the identity field out of
options so it becomes a sibling of the kind field at the same indentation level.
This ensures the configuration matches the expected structure and prevents users
from accidentally misconfiguring identity-based authentication.
In `@pkg/store/aws_secrets_manager_store.go`:
- Around line 87-94: In the SetAuthContext method, the lazy initialization state
(initOnce and initErr) is only being reset when the identityName changes, but it
should also be reset when the resolver is injected for an existing identity with
an empty identityName. Modify the condition to additionally reset s.initOnce and
s.initErr when identityName is empty (the normal path for preconfigured
identities), ensuring that any previously cached initialization errors are
cleared when a new resolver is provided, preventing the store from remaining in
a broken state.
In `@tests/preconditions.go`:
- Around line 365-383: The code uses a per-binary lock (testToolPathLocks) to
ensure once-per-binary execution, but the PATH environment variable modification
in lines 377-382 is global and shared across all binaries. When different
binaries are processed in parallel, their Do() functions can execute
concurrently and race to modify the global PATH, causing flaky behavior. Add a
global sync.Mutex to serialize all modifications to the PATH environment
variable. Guard the entire os.Setenv("PATH", ...) section with this global mutex
to ensure that only one goroutine modifies PATH at a time, regardless of which
binary is being processed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 26b24afb-d7a9-428b-abc4-f497783d7172
📒 Files selected for processing (38)
.github/workflows/test.ymlagent-skills/skills/atmos-config/SKILL.mdagent-skills/skills/atmos-config/references/sections-reference.mdagent-skills/skills/atmos-stores/SKILL.mdagent-skills/skills/atmos-stores/references/store-providers.mdcmd/secret/set.gocmd/secret/set_coverage_test.gocmd/secret/set_test.godocs/prd/secrets-management.mddocs/prd/store-identity-support.mdexamples/auth-stores/README.mdexamples/auth-stores/atmos.yamlgists/aws-secrets/README.mdgists/aws-secrets/stacks/dev.yamlgists/aws-secrets/stacks/prod.yamlgists/aws-store-hooks/stacks/consumer.yamlgists/aws-store-hooks/stacks/producer.yamlpkg/store/aws_secrets_manager_store.gopkg/store/aws_secrets_manager_store_test.gopkg/store/registry.gopkg/store/registry_kind_test.gotests/aws_stores_floci_test.gotests/fixtures/scenarios/aws-secrets-floci/stacks/dev.yamltests/fixtures/scenarios/aws-secrets-floci/stacks/prod.yamltests/fixtures/scenarios/aws-store-hooks-floci/stacks/consumer.yamltests/fixtures/scenarios/aws-store-hooks-floci/stacks/producer.yamltests/fixtures/scenarios/azure-secrets-floci/stacks/dev.yamltests/fixtures/scenarios/gcp-secrets-floci/stacks/dev.yamltests/preconditions.gotests/test-cases/hooks-component-scoped/atmos.yamltests/testhelpers/toolchain.gowebsite/blog/2026-01-29-artifactory-store-fix.mdxwebsite/blog/2026-02-22-store-identity-support.mdxwebsite/docs/cli/commands/toolchain/toolchain-get.mdxwebsite/docs/cli/commands/toolchain/toolchain-info.mdxwebsite/docs/cli/configuration/stores.mdxwebsite/docs/intro/multi-cloud.mdxwebsite/docs/tutorials/sharing-state/stores.mdx
💤 Files with no reviewable changes (2)
- cmd/secret/set_coverage_test.go
- cmd/secret/set.go
✅ Files skipped from review due to trivial changes (12)
- website/docs/cli/commands/toolchain/toolchain-info.mdx
- tests/test-cases/hooks-component-scoped/atmos.yaml
- examples/auth-stores/README.md
- website/blog/2026-01-29-artifactory-store-fix.mdx
- website/blog/2026-02-22-store-identity-support.mdx
- tests/fixtures/scenarios/aws-store-hooks-floci/stacks/producer.yaml
- docs/prd/store-identity-support.md
- tests/fixtures/scenarios/gcp-secrets-floci/stacks/dev.yaml
- docs/prd/secrets-management.md
- tests/fixtures/scenarios/aws-secrets-floci/stacks/prod.yaml
- agent-skills/skills/atmos-stores/references/store-providers.md
- agent-skills/skills/atmos-stores/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (10)
- tests/fixtures/scenarios/aws-store-hooks-floci/stacks/consumer.yaml
- tests/testhelpers/toolchain.go
- gists/aws-store-hooks/stacks/consumer.yaml
- gists/aws-secrets/stacks/dev.yaml
- tests/fixtures/scenarios/aws-secrets-floci/stacks/dev.yaml
- tests/fixtures/scenarios/azure-secrets-floci/stacks/dev.yaml
- .github/workflows/test.yml
- pkg/store/aws_secrets_manager_store_test.go
- website/docs/cli/configuration/stores.mdx
- website/docs/tutorials/sharing-state/stores.mdx
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2625 +/- ##
==========================================
+ Coverage 79.77% 80.03% +0.26%
==========================================
Files 1352 1353 +1
Lines 126821 127034 +213
==========================================
+ Hits 101169 101676 +507
+ Misses 20012 19711 -301
- Partials 5640 5647 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ixes Add testcontainers-based auto-start for the opt-in Floci cloud-emulator E2E tests. When ATMOS_TEST_FLOCI=true and the FLOCI_* endpoints are unset, the suite detects the container runtime (Docker or Podman, via pkg/container), wires Podman's API socket into testcontainers, and brings the AWS/GCP/Azure emulators up on dynamic ports, tearing them down afterward. CI keeps its service containers (pre-set endpoints make auto-start a no-op), and tests skip cleanly with an actionable message when no runtime is available. Also includes this branch's AWS SSM / Secrets Manager / Azure Key Vault / GCP Secret Manager store auth and endpoint changes and their tests. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add a focused test for the error-propagation paths (failing scalar decode inside a mapping and a sequence) and the default/alias branch of decodeNodeWithYamlFunctions, raising it from ~73% to ~97%. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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.
Inline comments:
In `@pkg/store/aws_ssm_param_store_test.go`:
- Around line 755-760: The test for buildAuthConfigOpts in the SSMStore test
file only validates the count of returned options using assert.Len, but does not
verify the actual behavior of those options such as region and endpoint
selection. After asserting the option length, add additional assertions to
verify the applied effects of the options by checking that the correct region
and endpoint values are actually set when the options are applied, ensuring
precedence rules are maintained and preventing future regressions in option
behavior.
In `@tests/cli_test.go`:
- Around line 786-789: The maybeStartFloci function call on line 786 uses
context.Background() which has no timeout, potentially causing TestMain to block
indefinitely if Podman or Docker calls hang. Replace the context.Background()
argument with a context that has an appropriate timeout (such as using
context.WithTimeout), ensuring the auto-start process for Floci has a defined
time limit before it fails gracefully and allows the test suite to proceed.
In `@tests/precondition_cached_tools_test.go`:
- Around line 78-82: The subtest hardcodes Unix-specific paths `/usr/bin` in
both the t.Setenv call on line 78 and the assertion on line 81, which violates
test portability requirements. Replace the hardcoded `/usr/bin` strings with
OS-agnostic paths constructed using filepath.Join() to ensure the test works
correctly across different operating systems. Apply the same filepath.Join()
approach consistently to both the environment variable setting and the expected
PATH value in the assert.Equal comparison.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1cbf5233-b18b-4b70-ba5e-80bf73b410c6
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (27)
.github/workflows/test.ymlagent-skills/skills/atmos-stores/references/store-providers.mdcmd/secret/shared.gocmd/terraform/utils.gogists/aws-store-hooks/README.mdgo.modinternal/exec/describe_component.gointernal/gcp/auth.gopkg/config/load.gopkg/config/load_yaml_path_test.gopkg/config/process_yaml_test.gopkg/function/store.gopkg/store/authbridge/resolver_test.gopkg/store/aws_secrets_manager_store.gopkg/store/aws_secrets_manager_store_endpoint_test.gopkg/store/aws_ssm_param_store_test.gopkg/store/azure_keyvault_store.gopkg/store/azure_keyvault_store_endpoint_test.gopkg/store/google_secret_manager_store.gopkg/store/options.gopkg/store/options_test.gotests/README.mdtests/cli_test.gotests/floci_containers_test.gotests/floci_harness_test.gotests/precondition_cached_tools_test.gowebsite/docs/cli/configuration/stores.mdx
✅ Files skipped from review due to trivial changes (2)
- tests/README.md
- gists/aws-store-hooks/README.md
🚧 Files skipped from review as they are similar to previous changes (13)
- pkg/store/options.go
- cmd/secret/shared.go
- pkg/function/store.go
- cmd/terraform/utils.go
- pkg/store/google_secret_manager_store.go
- internal/exec/describe_component.go
- pkg/config/load.go
- .github/workflows/test.yml
- pkg/store/azure_keyvault_store.go
- internal/gcp/auth.go
- website/docs/cli/configuration/stores.mdx
- tests/floci_harness_test.go
- pkg/store/aws_secrets_manager_store.go
- aws_ssm_param_store_test: assert applied option behavior (region, endpoint, profile, config/creds files) not just option count, so auth precedence can't regress silently - precondition_cached_tools_test: use OS-agnostic temp-dir PATH fixture instead of hardcoded /usr/bin - cli_test: bound Floci auto-start with a 3m timeout context so a hung Podman/Docker call can't block TestMain indefinitely Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- setup.go: add the required perf.Track defer to the public SetAuthContext function, matching the package convention (nil atmosConfig) - setup_test: make TestSetAuthContext_WithIdentityResolverEndpoint table-driven to also exercise the strings.ToLower identity-name fallback in endpointURLFromManager (mixed-case input, lowercase-keyed identity) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@pkg/store/hashicorp_vault_store_test.go`:
- Around line 92-101: In the HTTP handler defined with mux.HandleFunc for the
"/v1/secret/data/" path, replace the require.NoError call on the
json.Decoder.Decode line with explicit error handling that writes an HTTP error
response instead of using require.FailNow() inside the handler goroutine.
Additionally, add the missing writeJSON helper function to this file that sets
the Content-Type header to application/json and marshals the provided value to
JSON, writing it to the response writer with proper error handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3b53eee1-8c65-4efa-8c92-ae432e0510aa
📒 Files selected for processing (9)
pkg/auth/cloud/aws/setup.gopkg/auth/cloud/aws/setup_test.gopkg/secrets/providers/store_test.gopkg/secrets/service_test.gopkg/store/hashicorp_vault_store.gopkg/store/hashicorp_vault_store_test.gopkg/store/onepassword_client_test.gopkg/store/onepassword_store_test.gopkg/store/registry_kind_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
- pkg/auth/cloud/aws/setup_test.go
- pkg/auth/cloud/aws/setup.go
|
CodeRabbit (@coderabbitai) any regressions in test coverage or curve fitting? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Count new vs removed test functions
echo "=== NEW TEST FUNCTIONS ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^+func Test' | wc -l
echo "=== REMOVED TEST FUNCTIONS ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^-func Test' | wc -l
echo "=== REMOVED TEST FUNCTION NAMES ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^-func Test'
echo "=== NEW TEST FUNCTION NAMES (sample) ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^+func Test'
echo ""
echo "=== TESTS THAT ONLY SET UP MOCKS AND CHECK NON-NIL RESOLVER (potential curve-fitting) ==="
rg -n "ResolverOnly" --type go
echo ""
echo "=== CHECKING FOR TESTS SKIPPING ACTUAL BEHAVIOR ASSERTIONS ==="
git diff origin/main...HEAD -- '*_test.go' | grep '^+' | grep -E 'assert\.(NotNil|True|Equal.*nil)' | head -30
echo ""
echo "=== COVERAGE GATE: test.yml codecov step ==="
git diff origin/main...HEAD -- '.github/workflows/test.yml' | grep -A5 -B5 'coverage'Length of output: 6696
Removed tests — all justified:
Mild curve-fitting concern — the three These only assert that Coverage gate change ( Short answer: coverage trends up, no regressions, the |
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
These changes were released in v1.222.0-rc.5. |
The after-apply `store-outputs` hook resolves store credentials on a separate, freshly-loaded config from the main terraform path. It injected the store auth resolver but no default identity, so identity-less stores fell back to the default AWS SDK credential chain — empty under Atmos auth — and failed with "no EC2 IMDS role found". The main terraform path already inherits the run's identity; this brings the hook path in line (the follow-up deferred in #2625). - internal/exec: add HookStoreDefaultIdentity, mirroring the main path (auto-detect the active identity from the auth manager chain, normalize empty/select/disabled to ""). Returns "" with no auth manager, so runs without Atmos auth keep the prior ambient/default-credential behavior. - cmd/terraform: injectHookStoreAuthResolver now injects the resolver WITH the default identity via SetAuthContextResolverWithDefaultIdentity. - pkg/store: defaultIdentityForStore was missing *SecretsManagerStore (aws/asm), so AWS Secrets Manager stores never inherited a default identity on any path. Add the case so aws/asm behaves like aws/ssm. Tests: internal/exec.TestHookStoreDefaultIdentity (new); cmd/terraform TestInjectHookStoreAuthResolver_InheritsDefaultIdentity (replaces _ResolverOnly); pkg/store default-identity test updated so identity-less aws/asm asserts inheritance; Floci E2E TestAWSStoreHooks_InheritedIdentity_FlociE2E with new fixture aws-store-hooks-floci-inherit (no per-store identity, ambient creds cleared, hook write succeeds). Fix doc under docs/fixes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
) * fix(hooks): store-output hooks inherit the run's default identity The after-apply `store-outputs` hook resolves store credentials on a separate, freshly-loaded config from the main terraform path. It injected the store auth resolver but no default identity, so identity-less stores fell back to the default AWS SDK credential chain — empty under Atmos auth — and failed with "no EC2 IMDS role found". The main terraform path already inherits the run's identity; this brings the hook path in line (the follow-up deferred in #2625). - internal/exec: add HookStoreDefaultIdentity, mirroring the main path (auto-detect the active identity from the auth manager chain, normalize empty/select/disabled to ""). Returns "" with no auth manager, so runs without Atmos auth keep the prior ambient/default-credential behavior. - cmd/terraform: injectHookStoreAuthResolver now injects the resolver WITH the default identity via SetAuthContextResolverWithDefaultIdentity. - pkg/store: defaultIdentityForStore was missing *SecretsManagerStore (aws/asm), so AWS Secrets Manager stores never inherited a default identity on any path. Add the case so aws/asm behaves like aws/ssm. Tests: internal/exec.TestHookStoreDefaultIdentity (new); cmd/terraform TestInjectHookStoreAuthResolver_InheritsDefaultIdentity (replaces _ResolverOnly); pkg/store default-identity test updated so identity-less aws/asm asserts inheritance; Floci E2E TestAWSStoreHooks_InheritedIdentity_FlociE2E with new fixture aws-store-hooks-floci-inherit (no per-store identity, ambient creds cleared, hook write succeeds). Fix doc under docs/fixes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * address comments --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
what
why
references