Fix reconciliation of envvar with default, flag_value and type parameters for flag options#2956
Fix reconciliation of envvar with default, flag_value and type parameters for flag options#2956kdeldycke merged 1 commit intopallets:stablefrom kdeldycke:flag_normalization
default, flag_value and type parameters for flag options#2956Conversation
default, flag_value and type parameters for flag options
An extreme understatement! 😆 If we can once and for all consolidate how these arguments all affect each other, that would be amazing. |
|
We should also thoroughly document all the interactions once we settle on something. |
Ahah! 😄 If I can only increase the coverage and fix a couple of issues, I'll be happy. Refactoring will be easier after some incremental improvements. This PR is still a WIP. I'll work on it progressively in the next few days and try to push it as far as I can without breaking everything! 😅 |
|
@kdeldycke This is excellent! I struggled with just reconciling a few edgecases when I was fleshing out the docs. |
default, flag_value and type parameters for flag optionsdefault, flag_value and type parameters for flag options
kieranyyu
left a comment
There was a problem hiding this comment.
Test cases look very comprehensive!
But I'm not finished yet! Still have some edge-cases to tests! 😅 |
I'll probably add a couple of lines in the docs once I've ironed out this PR. At least to explain the rules by which to expect the different arguments to behave. |
|
This PR is ready to be reviewed and merged: all tests are passing! :) |
|
@davidism did you review all of this or just leave a comment? If so I am good with merging it. I assume this would go in Click 8.3.0? |
|
@kieranyyu would you mind reviewing this pr? |
|
Given how @davidism is uncomfortable with the removal of |
|
@davidism Could you please weigh in? I think 8.3.0 makes sense. |
This one fixes #2952 - which is very annoying for CI - and reason why we have < 8.2.0 for click in Airflow. So it would be worth to fix it in 8.2.2 and pretty quickly - also beacaue people think this is a FEATURE not a BUG - someone already created a PR documenting behaviour of ENVVAR with flags/bools thinking that it is how it is supposed to be #2988 |
|
BTW. We tested this one in Airflow and it looks good and indeed solves the #2952 issue. I can confirm that. |
|
Oh sorry, I missed the latest messages here. It looks like this doesn't change expected behavior, only fixes issues, so this should be fine for 8.2.2. |
|
@kdeldycke Great work! The community feedback from this already looks very good. You are good to merge into stable. You should have perms, if not then let me know and I will merge! |
Thanks @potiuk for testing this PR! Airflow being popular means my PR seems sound enough to be merged upstream! :)
Ok I'll try to merge it myself. Should be a good test for the process. Thanks for the approval! 👍 |
|
Hmmm @Rowlando13 ... What's your preferred way here? A proper merge commit or a rebase? On |
|
Since it's a bug fix it goes in stable. Since you don't have any work commits and no merge conflicts (you already squashed/rebased), you can do a regular merge commit. |
|
Tagged you in a few other issues that might be affected by this. |
While digging into internals of flag option management in the context of fixing #2952, I stumbled upon lots of edge-cases.
This is a WIP to identify and fix all these issues, essentially because the absence of value is mixed-up with the value of absence.
This PR:
default,flag_valueandtypeparameters for flag options.Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.Closes:
Fix edge-cases introduced in:
flag_valueis not taken into account withenvvar#2746Refs:
flag_valueis not taken into account withenvvar#2746