Reorder config precedence: global flag beats environment variable - #1308
Conversation
The pmm-framework resolved CLIENT_VERSION from the environment before the global --client-version flag, so a run passing --client-version=3.5.0 with CLIENT_VERSION=3.6.0 exported (e.g. by CI) still installed 3.6.0. An explicit CLI flag must beat an ambient env var: reorder resolve_value() to check GLOBAL_CLIENT_VERSION first for the CLIENT_VERSION key. Update the precedence test and the README/ARCHITECTURE docs to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0111eoWF5ABrxakfE2AbFsEk Signed-off-by: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
💤 Files with no reviewable changes (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Team
Run ID: 04e5527b-f9a4-4cee-b1f3-28ba9ce27416
📒 Files selected for processing (4)
qa-integration/pmm_qa/pmm-framework/ARCHITECTURE.mdqa-integration/pmm_qa/pmm-framework/README.mdqa-integration/pmm_qa/pmm-framework/lib/config.shqa-integration/pmm_qa/pmm-framework/tests/cli.bats
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
percona/pmm-qa(manual)percona/pmm(manual)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
|
No gate covers the behaviour this PR changes: |
Drop the rationale paragraph from resolve_value() (the precedence list already states the flag wins; the why lives in the PR/commit) and the per-assertion comments from the cli.bats precedence test, matching the repo's minimal-comments house style and the file's comment-free tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0111eoWF5ABrxakfE2AbFsEk Signed-off-by: Claude <noreply@anthropic.com>
|
Test evidence, run locally against the pushed head: Test 4, Agreed there's no CI gate running the Generated by Claude Code |
Fixes the precedence order for configuration value resolution so that an explicit
--client-versionCLI flag takes priority over an ambientCLIENT_VERSIONenvironment variable. This ensures that a run passing--client-version=Xinstalls X even whenCLIENT_VERSION=Yis exported (e.g. by CI).Changes:
resolve_value()logic inlib/config.shto checkGLOBAL_CLIENT_VERSIONbefore shell/environment variablestests/cli.batsto verify the new precedence order with explicit assertions for each levelREADME.mdandARCHITECTURE.mdto document the corrected precedenceThe change is minimal and surgical — only the order of two conditional branches in
resolve_value()— with comprehensive test coverage confirming the new behavior at each precedence level.https://claude.ai/code/session_0111eoWF5ABrxakfE2AbFsEk