flag: make Apply return an error and drop errorableFlag - #15
Conversation
The Flag interface's Apply method silently ignored parsing errors from environment-variable defaults; callers that wanted errors had to implement the unexported errorableFlag interface, and flagSet type-asserted for it. Fold ApplyWithError into Apply so the Flag interface returns an error directly, and delete errorableFlag along with the type assertion. This is a breaking change for external Flag implementations, hence v2.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe flag API now returns errors directly from ChangesFlag application API
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to This change makes flag application errors propagate before command execution, improving failure handling, but it also requires downstream custom flag implementations to update their method signature before dependent applications can rebuild. The PR is mergeable with explicit owner awareness of that migration requirement. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ 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 |
address v2 TODO.
Summary by CodeRabbit
Bug Fixes
Refactor