Update error message in GitOps when unknown env vars are encountered#46476
Update error message in GitOps when unknown env vars are encountered#46476sgress454 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
This PR improves the GitOps environment-variable error message so users who intended literal $VAR text are told how to escape it, addressing the round-trip issue described in #44053.
Changes:
- Adds escape guidance to missing environment variable errors in
expandEnv. - Updates unit and GitOps tests to expect the new message.
- Adds a changelog entry for the user-visible error message improvement.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/spec/spec.go |
Builds a clearer missing-env-var error with $VAR / ${VAR} escape guidance. |
pkg/spec/spec_test.go |
Updates TestExpandEnv expectations for the new error wording. |
pkg/spec/gitops_test.go |
Updates GitOps missing-env-var assertion for the new message. |
changes/44053-improve-env-var-error-msg |
Documents the user-visible GitOps error message update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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 due to trivial changes (1)
WalkthroughThis PR improves error messages shown when GitOps files reference undefined environment variables. expandEnv now reports which variable is unset and shows how to escape the literal form used in the source (e.g., advise 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
418e221 to
08f3330
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46476 +/- ##
==========================================
- Coverage 66.81% 66.81% -0.01%
==========================================
Files 2809 2809
Lines 223584 223588 +4
Branches 11309 11309
==========================================
- Hits 149382 149381 -1
- Misses 60647 60649 +2
- Partials 13555 13558 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Related issue: Resolves #44053
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing
Summary by CodeRabbit