-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix option conflicts in sigh #8129
Conversation
@mgrebenets @hjanuschka @KrauseFx It would be great to have some help testing sigh with these changes to try to identify any regressions. |
The CI failure does not appear to be related to my code, and all tests pass when I run them locally 😢 |
Rebased and pushed to pick up the test fix |
@mfurtak Will give it a test as soon as I can. I have resigner CI script at work, which uses both |
So I've tested with the following command:
And it unfolded to the following call to
Which is correct and is exactly what I am expecting to see. If I run the same command using latest code from If I change
Here the So as a summary, I can confirm that this change fixes issues I had and short options work properly for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with our resign scripts, looks good 👍
🎉 |
Could this be tested with a spec? |
#8076 (comment) should be a base for a spec. |
Thanks for doing some manual verification. I'll see if I can get a regression test in place. 👍 |
Looks good to me 👍 If this behaivior will be also applied to other tools. |
Adjust command option handling to stop using global_option for Commander options that are generated for the default command (renew)
3a11a5d
to
5f6187d
Compare
OK, I've added some tests that will catch a regression, so I'll merge this now 👍 |
Carry the work and lessons learned from #8129 over to gym gym does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to gym gym does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to match match does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to match match does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to pem pem does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to pem pem does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to pilot pilot does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to pilot pilot does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to supply supply does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to produce produce does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to produce produce does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to scan scan does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to scan scan does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to screengrab screengrab does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to screengrab screengrab does not currently have any option conflicts, but this refactoring is still generally more correct and safe.
Carry the work and lessons learned from #8129 over to snapshot snapshot currently has a misconfigured option in :reset_simulators that is being masked by the old way of setting up tool options. The option is now renamed to match the expected option name, and the masking is removed by the refactoring
Carry the work and lessons learned from #8129 over to snapshot snapshot currently has a misconfigured option in :reset_simulators that is being masked by the old way of setting up tool options. The option is now renamed to match the expected option name, and the masking is removed by the refactoring
Adjust command option handling to stop using
global_option
for Commander options that aregenerated for the default command (
renew
). Instead, they are now generated as normal options underneath that command.The only major (negative?) change in behavior affects how help information is generated/shown by Commander.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validDescription
Current option handling in sigh
Current help output:
This should not work (but it does) since
--force
is not a valid option for theresign
commandThis is good and shows that
--force
is seen by the default commandThis should be setting the
--provisioning_profile
, but is incorrectly interpreted as the--platform
from the default commandRevised option handling in sigh
Help for the top-level executable:
Help for the
renew
(default) command:The
resign
command now correctly throws an error when given the--force
optionThe default command still recognizes the
--force
flagThe
resign
command correctly receives the--provisioning_profile
optionMotivation and Context
#6169 introduced a new option for sigh. Unfortunately, it accidentally conflicts with the
-p
short flag as used by the sighresign
command. This is one example, but there are other sigh options in use that also have short flag conflicts, such as-i
. These problems were captured in #7935 and #8076This is a problem for all fastlane tools, not just sigh, but I'm testing out this approach here to see how it works, and gather feedback.