Skip to content

test(auth): add regression tests from the Atmos Auth pre-release review - #3724

Merged
Andriy Knysh (aknysh) merged 1 commit into
aknysh/vendor-saml2awsfrom
aknysh/auth-review-tests
Nov 22, 2026
Merged

Andriy Knysh (aknysh) merged 1 commit into
aknysh/vendor-saml2awsfrom
aknysh/auth-review-tests

Conversation

@aknysh

@aknysh Andriy Knysh (aknysh) commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

what

  • Regression tests from the Atmos Auth pre-release review that cover auth paths outside the vendored SAML code:
    • auth exec child process and exit-code propagation
    • ECR token retrieval
    • kubeconfig drift detection
    • permission set authentication
    • GCP service account environment preparation
    • EKS kubeconfig merging
    • auth list status formatting
    • concurrent isolated identity operations
    • SSO token polling flow
    • Azure device code paths
    • plugin provider interactions
  • Two test harness hooks those tests need (cmd/auth/testmain_test.go, pkg/plugin/adapter/auth/main_test.go).

Test-only change. No production code is modified.

why

references

Summary by CodeRabbit

  • Tests
    • Expanded coverage for auth exec argument handling and exit-code reporting.
    • Added checks for AWS, Azure, and GCP authentication flows, credential refresh and storage, and error handling.
    • Added tests for Kubernetes configuration merging and cleanup, including preservation of user-managed settings.
    • Added coverage for identity status and expiration display, operation-scoped credential isolation, and device-code authentication through the plugin transport.

@aknysh
Andriy Knysh (aknysh) requested a review from a team as a code owner November 18, 2026 15:46
@aknysh Andriy Knysh (aknysh) added the no-release Do not create a new release (wait for additional code changes) label Nov 18, 2026
@aknysh Andriy Knysh (aknysh) added the no-release Do not create a new release (wait for additional code changes) label Nov 18, 2026
@atmos-pro

atmos-pro Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@github-actions github-actions Bot added size/l Large size PR quality:not-ready One or more Quality Gate requirements are pending or failing labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Quality Gate   Quality Gate passed

Readiness

✅ Ready for review

✅ No merge conflicts

✅ Release label and milestone

✅ Verified commit signatures

✅ Fewer than 150 changed files

Reviews

✅ CodeRabbit approval (current head)

✅ Review threads resolved or dismissed

Measures

✅ All CI checks and workflows

✅ Codecov (current head)

✅ Benchmark results

View job summary

Current commit: f195b29603568c7502651cab2ab7911615039e32 · quality:ready

Quality Gate details
Gate Status Evidence
Ready for review Passed Marked ready for review
No merge conflicts Passed No merge conflicts with the target branch
Release label and milestone Passed no-release: no release milestone required
All CI checks and workflows Passed 160 current PR CI results passed or were skipped/neutral
Codecov (current head) Passed codecov/patch: success; codecov/project: success
CodeRabbit approval (current head) Passed APPROVED
Verified commit signatures Passed 1/1 commits have GitHub-verified signatures
Review threads resolved or dismissed Passed 0 unresolved review threads (outdated threads still count)
Fewer than 150 changed files Passed 13 changed files; maximum 149
Benchmark results Passed No benchmark report processing error recorded for this head

@aknysh Andriy Knysh (aknysh) self-assigned this Nov 18, 2026
@aknysh
Andriy Knysh (aknysh) force-pushed the aknysh/auth-review-tests branch 2 times, most recently from c07a6a0 to b0dbac9 Compare November 18, 2026 16:09
@aknysh Andriy Knysh (aknysh) added this to the 1.235.0 milestone Nov 18, 2026
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
@aknysh
Andriy Knysh (aknysh) force-pushed the aknysh/auth-review-tests branch 2 times, most recently from ddaf89c to 6a7e804 Compare November 18, 2026 16:51
@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.79%. Comparing base (e3d3759) to head (f195b29).

Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           aknysh/vendor-saml2aws    #3724      +/-   ##
==========================================================
+ Coverage                   87.73%   87.79%   +0.06%     
==========================================================
  Files                        3508     3508              
  Lines                      320235   320235              
==========================================================
+ Hits                       280965   281166     +201     
+ Misses                      27444    27246     -198     
+ Partials                    11826    11823       -3     
Flag Coverage Δ
unittests 87.79% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

CI timing summary

Latest completed GitHub Actions runs for f195b2960356.

  • PR wall-clock time: 11h 54m 26s
  • Aggregate runner time: 16h 51m 31s
  • Included: 14 workflows, 141 jobs (including matrix jobs)

Wall-clock time spans the earliest included workflow creation through the latest completion. Aggregate runner time adds each job's execution time, so concurrent jobs are counted separately.

Workflow Elapsed Runner time Jobs
✅ Tests 56m 44s 13h 52m 17s 113
✅ Benchmarks 32m 30s 32m 23s 1
✅ Plugin SDK 18m 52s 1h 34m 12s 11
✅ CodeQL 12m 07s 25m 30s 6
✅ atmos.ci 10m 56s 10m 52s 1
✅ Pre-commit 9m 34s 9m 30s 1
✅ Dependency Review 3m 23s 3m 19s 1
✅ TruffleHog secret scan 1m 02s 58s 1
✅ Release Documentation Check 41s 38s 1
✅ Validate Codeowners 36s 32s 1
✅ PR Size Labeler 30s 26s 1
✅ Verify Repository Symlinks 30s 27s 1
✅ autofix.ci 28s 24s 1
✅ Quality Gate Signal 5s 3s 1
Longest jobs (top 10)
Job Workflow Duration Conclusion
benchmark Benchmarks 32m 23s ✅ success
Acceptance Tests (windows, shard 1/10) Tests 31m 16s ✅ success
[race] non-acceptance test suite (shard 2/4) Tests 28m 09s ✅ success
Acceptance Tests (linux, shard 1/10) Tests 23m 59s ✅ success
[race] non-acceptance test suite (shard 1/4) Tests 23m 54s ✅ success
Acceptance Tests (windows, shard 5/10) Tests 23m 07s ✅ success
[race] non-acceptance test suite (shard 3/4) Tests 22m 55s ✅ success
Acceptance Tests (macos, shard 1/10) Tests 22m 13s ✅ success
Acceptance Tests (windows, shard 9/10) Tests 20m 46s ✅ success
Acceptance Tests (macos, shard 2/10) Tests 19m 47s ✅ success

Updated automatically when a PR workflow finishes.

@aknysh

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) review

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aknysh

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) review

This test-only PR is skipped by automatic review because its title contains "test". It holds the general Atmos Auth regression tests that were moved out of #3722 to keep that PR under the 149-file limit.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 91a5c43 and f195b29.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

This PR adds tests for auth command execution, AWS and GCP credential flows, Azure credential paths, kubeconfig handling, auth manager operations, status formatting, and plugin device-code interactions.

Changes: Auth exec subprocess

Layer / File(s) Summary
Child process setup and execution
cmd/auth/exec_child_process_test.go, cmd/auth/testmain_test.go
A subprocess test checks argument preservation, the child’s ATMOS_IDENTITY, and successful or nonzero exit-code handling. TestMain routes the configured child process to its test runner.

AWS authentication

Layer / File(s) Summary
ECR token handling
pkg/auth/cloud/aws/ecr_token_test.go
A loopback fixture supports tests for token decoding, region selection, malformed authorization data, and OIDC credential rejection.
Permission-set authentication
pkg/auth/identities/aws/permission_set_authenticate_test.go
A fake SSO portal supports tests for account ID use and name resolution, repeated logins, returned credentials, and unauthorized responses.
SSO token polling and refresh
pkg/auth/providers/aws/sso_token_flow_test.go
Scripted OIDC responses support tests for polling outcomes, cached-token refresh, non-interactive refresh failure, and token-cache permissions.

Kubeconfig management

Layer / File(s) Summary
Kubeconfig merge and drift
pkg/auth/cloud/kube/config_drift_test.go
Tests check that merges restore Atmos-managed entries and preserve unrelated user entries.
EKS merge, cleanup, and lookup
pkg/auth/integrations/aws/eks_kubeconfig_merge_test.go
Tests check EKS context creation and cleanup, preservation of user-owned entries, and exact cluster-name matching.

GCP service-account environment

Layer / File(s) Summary
Stored credentials and environment
pkg/auth/identities/gcp_service_account/prepare_environment_test.go
Tests check stored-token use, project selection, identity-scoped gcloud configuration, and expired-credential errors.

Azure credential paths

Layer / File(s) Summary
Provider credential paths
pkg/auth/providers/azure/device_code_paths_test.go
Tests check credential paths for device-code and interactive providers with and without a realm.

Auth manager operations

Layer / File(s) Summary
Operation realm and credential routing
pkg/auth/manager_operation_test.go
Tests check realm selection, concurrent credential-file isolation, and parent-manager state.
Operation cleanup paths
pkg/auth/manager_operation_test.go
Tests check logout after panics, failed acquisition, and caller cancellation.

Authentication status formatting

Layer / File(s) Summary
Status and expiration output
pkg/auth/list/formatter_status_test.go
Tests check status and expiration agreement, unknown states, duration rounding, and preservation of displayed text with color styling.

Plugin device-code interactions

Layer / File(s) Summary
Device flow over plugin transport
pkg/plugin/adapter/auth/interactions_e2e_test.go, pkg/plugin/adapter/auth/main_test.go
Tests check interactive prompts, noninteractive refusal, invocation flags, output channels, returned credentials, and rejection of token-bearing URIs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

  • cloudposse/atmos#3722: This PR is stacked on #3722 and adds auth tests outside the vendored AWS SAML code changed there.

Suggested reviewers: osterman

Merge Risk: Minimal · previous review 91a5c

This change adds regression tests for authentication paths and leaves production behavior unchanged. No concrete merge-blocking issue remains after review.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names a test-only change and the 'auth' scope. It matches the main change: regression tests for Atmos Auth paths. It does not list every area, which is expected. The title is specific enough…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names a test-only change and the 'auth' scope. It matches the main change: regression tests for Atmos Auth paths. It does not list every area, which is expected. The title is specific enough to convey the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8362a13 and 91a5c43.

Files selected for processing: 13

  • cmd/auth/exec_child_process_test.go
  • cmd/auth/testmain_test.go
  • pkg/auth/cloud/aws/ecr_token_test.go
  • pkg/auth/cloud/kube/config_drift_test.go
  • pkg/auth/identities/aws/permission_set_authenticate_test.go
  • pkg/auth/identities/gcp_service_account/prepare_environment_test.go
  • pkg/auth/integrations/aws/eks_kubeconfig_merge_test.go
  • pkg/auth/list/formatter_status_test.go
  • pkg/auth/manager_operation_test.go
  • pkg/auth/providers/aws/sso_token_flow_test.go
  • pkg/auth/providers/azure/device_code_paths_test.go
  • pkg/plugin/adapter/auth/interactions_e2e_test.go
  • pkg/plugin/adapter/auth/main_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 18, 2026
@github-actions github-actions Bot added quality:ready All Quality Gate requirements pass for the current PR head and removed quality:not-ready One or more Quality Gate requirements are pending or failing labels Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Cover auth paths reviewed before the 1.235.0 release that sit outside the
vendored SAML code: the auth exec child process and exit codes, ECR token
retrieval, kubeconfig drift detection, permission set authentication, GCP
service account environment preparation, EKS kubeconfig merging, list
status formatting, concurrent isolated identity operations, the SSO token
polling flow, Azure device code paths, and plugin provider interactions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added quality:not-ready One or more Quality Gate requirements are pending or failing and removed quality:ready All Quality Gate requirements pass for the current PR head labels Nov 22, 2026

Copy link
Copy Markdown
Member

CodeRabbit (@coderabbitai) review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot removed the quality:not-ready One or more Quality Gate requirements are pending or failing label Nov 22, 2026
@github-actions github-actions Bot added the quality:ready All Quality Gate requirements pass for the current PR head label Nov 22, 2026
@aknysh
Andriy Knysh (aknysh) added this pull request to the merge queue Nov 22, 2026
@atmos-pro

atmos-pro Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Note

Atmos Pro  

Waiting for your GitHub Actions workflow to upload affected stacks.
Learn More.

Merged via the queue into main with commit abc42a7 Nov 22, 2026
189 of 254 checks passed
@aknysh
Andriy Knysh (aknysh) deleted the aknysh/auth-review-tests branch November 22, 2026 15:42
@atmos-pro

atmos-pro Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.235.0-nightly.45090098255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes) quality:ready All Quality Gate requirements pass for the current PR head size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants