fix(version): honor ATMOS_USE_VERSION env var for version re-exec#2556
fix(version): honor ATMOS_USE_VERSION env var for version re-exec#2556Erik Osterman (Cloud Posse) (osterman) wants to merge 1 commit into
Conversation
The documented, flag-bound ATMOS_USE_VERSION env var was silently ignored: the re-exec resolver only read the internal ATMOS_VERSION_USE (set solely by the --use-version CLI flag), the ATMOS_VERSION alias, and version.use config. Setting ATMOS_USE_VERSION as an environment variable was a complete no-op. - resolveRequestedVersion now reads ATMOS_USE_VERSION; precedence is ATMOS_VERSION_USE > ATMOS_USE_VERSION > ATMOS_VERSION > version.use. - cmd/root.go honors ATMOS_USE_VERSION from the environment so version- management commands re-exec on it just like the CLI flag. - Add table case and precedence tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
|
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 (3)
📝 WalkthroughWalkthroughThe PR introduces ChangesATMOS_USE_VERSION Environment Variable Support
Possibly related PRs
Suggested labels
Suggested reviewers
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 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 |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2556 +/- ##
==========================================
+ Coverage 78.70% 78.77% +0.06%
==========================================
Files 1192 1194 +2
Lines 113940 114110 +170
==========================================
+ Hits 89682 89888 +206
+ Misses 19328 19281 -47
- Partials 4930 4941 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
what
ATMOS_USE_VERSIONenvironment variable so Atmos actually switches to (and downloads, if needed) the requested version during early re-exec.resolveRequestedVersionnow readsATMOS_USE_VERSION, with precedenceATMOS_VERSION_USE>ATMOS_USE_VERSION>ATMOS_VERSION>version.use.cmd/root.goalso honorsATMOS_USE_VERSIONfrom the environment so version-management commands (e.g.atmos version) re-exec on it just like the--use-versionflag.why
ATMOS_USE_VERSIONis advertised as the primary env var (docs atwebsite/docs/cli/environment-variables.mdxand the flag bindingWithEnvVars("use-version", "ATMOS_USE_VERSION")), but the re-exec resolver never read it — it only checked the internalATMOS_VERSION_USE(set solely by the CLI flag), theATMOS_VERSIONalias, andversion.useconfig.Changed()and maps to viper keyuse-versionrather thanversion.use, soATMOS_USE_VERSIONfell through every code path — setting it was a complete no-op.ATMOS_USE_VERSIONwas set foratmos describe affected --uploadbut Atmos ran the already-installed version instead of switching. This brings the code in line with the existing documentation.references
website/docs/cli/environment-variables.mdxSummary by CodeRabbit
New Features
ATMOS_USE_VERSIONenvironment variable as an alternative to the--use-versionCLI flag for version selection.Tests