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
[action] add xcodes
action, deprecating xcversion
and xcode-install
#20672
Conversation
The spec failure that is happening in this PR also happens in master, and it may be something related to recent changes on Apple's end 😬 |
xcodes
action, deprecating xcversion
and xcode-install
It's weird:
|
Ugh, so, locally, here's the breakdown:
CI is failing specs and it is running Ruby 2.6.0 apparently... but not sure why this is happening in my PR only, and on presumably unrelated files (
😬 Any help would be appreciated |
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.
Hi @rogerluan 👋🏻
Nice to "see" you again after a long time 😃 And sorry for the late reply.
😬 Any help would be appreciated
I can't promise anything, but I hope I'll take a look some time after reviewing this.
I read the migration guide and this PR's description, I started testing it, but it failed with:
[21:00:46]: Couldn't find xcodes binary at path ''
[21:00:46]: You passed invalid parameters to 'xcodes'.
[21:00:46]: Check out the error below and available options by running `fastlane action xcodes`
+------------------+------------------+
| Lane Context |
+------------------+------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios ensure_xcode |
+------------------+------------------+
[21:00:46]: Invalid default value for binary_path, doesn't match verify_block
Although it is fairly obvious that the issue is that it can't find xcodes
, and you have to (most probably) run brew install robotsandpencils/made/xcodes
, I think that this should be mentioned in the migration guide and/or the new action's description, since it's a required dependency that's not automatically managed by fastlane. What do you think?
Oops, forgot to address the "no binary" issue. Gimme a few mins |
Done @revolter 😊 Nice catch! |
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.
Just some small changes, to be less confusing for future contributors 🤔
c335335
to
b5fbe8f
Compare
@rogerluan, would you mind if I'd remove the merge commit, and rebase the branch instead? |
By all means @revolter 🙇 |
I hope it fixes it 😂 Because it doesn't make sense |
…xcodes' action to replace the 'xcode_install' one.
2b04c63
to
fad9d58
Compare
This makes it consistent with the rest of the codebase.
This was caused by the fact that that test calls a method that uses `$?` (https://stackoverflow.com/a/6834572/865175), which, somehow, (I think) was executed right after a call to XcodesHelper's `find_xcodes_binary_path` method. This latter one returned a non-zero code, because `xcodes` can't be installed on Ubuntu, which got picked up by the certificates return code check, so it treated its actual command as failed.
fad9d58
to
11bd750
Compare
Ok, this took me a lot longer than I thought it would 😐 Very very weird issue, but great debugging session nonetheless ❤️ I also noticed that some paths were being concatenated using There are still some failures, but these ones might not be that hard to fix 🤔 (Also, because I rebased and force-pushed to the branch, guessing that you didn't commit anything after 136b664, please delete the local branch, fetch the new changes, and check it out again, to avoid other superfluous merges.) I really need to go to sleep now, as it's already tomorrow 😫 |
Please let me work on this more? 😂 I have an idea that I want to test this evening. |
(reverted from commit 11bd750)
ab46738
to
0c2dddf
Compare
Ok, I was not happy with the fix, because I didn't understand it fully (still don't), and felt more like a hack. From what I (extensively) read, even through the source code, and by also testing it locally by replacing the |
Somehow, the 2 failures (Validate Documentation and Validate Fastlane.swift generation) got fixed too 😮 |
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.
@revolter dude, this was just amazing!! Thank you thank you thank you ❤️ Great context that you provided in the commit messages also! I'd never have guessed something like this, I can't even imagine how was your train of thought and how you got to the root cause 🤯
Separately, do you think we should at least create an Issue for future improvement of getting rid of all the $?
in other specs (and maybe in the source code too)?
Again, thank you so much 🙇 I'm so glad we'll be able to deliver this PR to xcode-install
users 💪
if FastlaneCore::Globals.verbose? | ||
UI.command_output(stdout) | ||
UI.command_output(stderr) | ||
end | ||
|
||
unless $?.success? | ||
unless status.success? |
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.
👏👏👏
@@ -12,7 +12,7 @@ def self.read_xcode_version_file | |||
end | |||
|
|||
def self.find_xcodes_binary_path | |||
`which xcodes`.strip | |||
Actions.sh("which xcodes", log: false).strip |
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.
What the... 🤯
In the case of the tests, `$?` was not mocked, so it looks like it was indeed just a coincidence that it worked. Meaning, some other shell command that somehow was actually executed (so it wasn't stubbed) succeeded, which caused the `$?.success?` to succeed too.
0c2dddf
to
58a0ed9
Compare
Brute-force trial and error, using divide et impera, by reverting half of the changes, then half of the half, etc., until I pinpointed the responsible line of code, and then a lightbulb went off in my head about the
Hmm, maybe that would be the way to go, but it's also a case of "if it ain't broken, don't fix it" 🤔 Maybe the best thing is that at least the 2 of us know of this, and hopefully remember it when (if) it happens in the future.
Really happy that I could (finally) help you with this one. Thank you too for the kind words, I'm really flattered |
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.
This is soooo amazing!! ❤️ Sorry it took so long but I'm back from family leave and thank for doing this 😊
Congratulations! 🎉 This was released as part of fastlane 2.211.0 🚀 |
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 validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
With the planned sunset of
xcode-install
(akaxcversion
) gem (xcpretty/xcode-install#467), a new action was needed to supportxcodes
.Description
This PR depends on XcodesOrg/xcodes#220 and XcodesOrg/xcodes#182 merge & release so the
installed
option with specified version is available, as well as--install
and--select
arguments for theinstall
option.These PRs were later merged & released under v1.1.0 https://github.com/RobotsAndPencils/xcodes/releases/tag/1.1.0, so v1.1.0 of xcodes is required to use and test this feature.
Testing Steps
To test this branch, modify your Gemfile as:
And run
bundle install
to apply the changes.Then switch your implementation of
xcversion
andxcode_install
according to the migration guide which can be found here: https://github.com/xcpretty/xcode-install/blob/master/MIGRATION.mdAny and every testing is highly appreciated! I did very limited testing only 🙇