-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Move Fastlane to Project Root #15706
Conversation
You can trigger an installable build for these changes by visiting CircleCI here. |
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
d229677
to
0920e4f
Compare
0920e4f
to
b00b031
Compare
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.
Only initial review for now (by just reading diff from GitHub per commit; not tested locally yet)
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.
I gave a first pass and left a few comments.
I'm going to be AFK for the rest of this week, but I don't want to block the work on this PR, so I've put a [**] on the two that I think can lead to bugs and should be addressed or carefully tested before merging.
For the others, feel free to do what you prefer.
Scripts/update-translations.rb
Outdated
system "grep -a '\\x00\\x20\\x00\\x22\\x00\\x22\\x00\\x3b$' #{lang_dir}/Localizable#{strings_file_ext}.strings" | ||
|
||
# Clean up after ourselves | ||
FileUtils.rm destination if File.exist? destination |
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.
[**] I'm not sure about this. I think this has been added to replace the call to system "rm #{lang_dir}/Localizable#{strings_file_ext}.strings.bak"
which has been removed from above, right?
If so, I think we should add .bak
to destination
, otherwise it looks like to me that this will delete the strings
files instead of the temporary backups.
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.
Resolved in 7f6cded!
ENV["DOWNLOAD_METADATA"]="./fastlane/download_metadata.swift" | ||
ENV["PROJECT_ROOT_FOLDER"]="../" |
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.
[**] I'm not sure we can get rid of passing PROJECT_ROOT_FOLDER
as an env variable 🤔 IIRC this is used in the release-toolkit
as well.
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.
It is indeed, well spotted.
Though now that all our projects are aligned to have the fastlane/
folder at root after this change, we could consider make the release-toolkit
default that value to ../
, or better yet, compute it – by move up the dir hierarchy in a while
loop until we find .git/
folder, or by just using git rev-parse --show-toplevel
. But that's for yet another bullet point that I'll have to add to my long refactoring todo list, so we're not there yet in release-toolkit and we should keep the env var for now.
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.
Ah ok – easy enough to fix – I'll just set it for now then we can remove it in the Great Refactor ™
ref: 38c660e
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.
Tracked in wordpress-mobile/release-toolkit#205
export_method: "enterprise", | ||
clean: true, | ||
output_directory: "../build/", | ||
derived_data_path: "../derived-data/alpha/", |
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.
With that we're moving the derived_data_path
to DerivedData
for both the Internal and the Beta 🤔
I can't think about issues with this, but wanted to highlight to make sure this is wanted.
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.
Yeah, I thought it was weird that we were using different directories for each - especially locally it sort of makes the project directory messy.
I don't foresee any issues with this (especially given that we have clean: true
there – it'll do cleanup prior to the build locally.
export_options: { method: "enterprise" }) | ||
|
||
sh("mv ../../build/WordPress.ipa \"../../build/WordPress Alpha.ipa\"") | ||
export_options: { method: "enterprise" } |
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 looks good to me on CI, but I found it useful to be able to run the lane locally to build both the versions and have both of them available at the end.
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.
Hmm good point – I might make it so that this just moves them to the Artifacts
directory that we already have – that way it's consistent across the whole project – if you want the .ipa
file locally, it'll always be in Artifacts
(which is what we use for the translation lane)
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 adjusted in b15122e, which puts the build artifacts for all lanes in the Artifacts
directory.
export_team_id: get_required_env("INT_EXPORT_TEAM_ID"), | ||
export_options: { method: "enterprise" }) | ||
|
||
sh("mv ../../build/WordPress.ipa \"../../build/WordPress Internal.ipa\"") |
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.
Same as above
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 adjusted in b15122e, which puts the build artifacts for all lanes in the Artifacts
directory.
@AliSoftware this is ready for another look when you are! |
# Conflicts: # fastlane/metadata/ar-SA/release_notes.txt # fastlane/metadata/de-DE/release_notes.txt # fastlane/metadata/default/release_notes.txt # fastlane/metadata/en-GB/release_notes.txt # fastlane/metadata/en-US/release_notes.txt # fastlane/metadata/es-ES/release_notes.txt # fastlane/metadata/es-MX/release_notes.txt # fastlane/metadata/fr-FR/release_notes.txt # fastlane/metadata/id/release_notes.txt # fastlane/metadata/it/release_notes.txt # fastlane/metadata/ja/release_notes.txt # fastlane/metadata/ko/release_notes.txt # fastlane/metadata/nl-NL/release_notes.txt # fastlane/metadata/ru/release_notes.txt # fastlane/metadata/sv/release_notes.txt # fastlane/metadata/tr/release_notes.txt # fastlane/metadata/zh-Hans/release_notes.txt # fastlane/metadata/zh-Hant/release_notes.txt
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.
The recurring theme when reviewing this PR from the GitHub UI is clearly this 😅
Joke aside, added a couple of nits, but also saw a couple of files that were commited while they really shouldn't.
It can easily be seen by looking at the diff between 16.6.0.1
(the tag from which you started to initially cut the branch from at that time, iinm) and move/fastlane
– after cloning the branches locally (in Terminal, because a diff in GitHub UI will be swamped by the diff size) – like so: git diff --summary 16.6.0.1 move/fastlane | grep -v rename
Note: I've created a Draft P2 post in +iosp2 (edit link sent in DM – ref: paNNhX-c0-p2) – just so we don't forget to announce the change made by that PR – that is ready to be published once we're ready to approve and merge this PR. |
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 looks generally good to me, other than the accidentally added files that Olivier pointed out.
I've still a doubt about the refactoring of update-translations.rb
, so I left a question there.
I've tried to run a couple of modified lanes and they worked as expected anyway :-)
Co-authored-by: Olivier Halligon <[email protected]>
Co-authored-by: Olivier Halligon <[email protected]>
Co-authored-by: Olivier Halligon <[email protected]>
Co-authored-by: Olivier Halligon <[email protected]>
Thanks for the feedback @loremattei and @AliSoftware – it should all be addressed. I did need to adjust one thing – Ruby wasn't happy with: system("curl", "-fgsLo", destination, url) || puts "Error downloading #{url}" but it was fine with system("curl", "-fgsLo", destination, url) or raise "Error downloading #{url}" for reasons I don't entirely understand. That said, I think I prefer this, because IMHO if it can't download the strings it should fail the build instead of carrying on with missing strings. |
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.
LGTM!
I briefly tested update-translation.rb
and it worked as expected. I recommend double checking the diff it generates on the first actual release.
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.
The merge of release/16.7 into that branch made it a bit hard to ensure the last diff was right, but looking at the incremental diffs from last time (537 commits behind 😱) it LGTM.
…
Switched to branch 'move/fastlane'
Your branch is behind 'origin/move/fastlane' by 537 commits, and can be fast-forwarded.
So I say and:
- Don't forget to publish the draft P2 post I prepared [paNNhX-c0-p2] to announce the change (even if we MIEs might be more frequent users of those lanes than the code wranglers)
- As Lore said, we might want to remember to double-check the diff during next release just to be sure. (It will always be time to fix anything we might have missed later anyway if needed, so better finally merge it ASAP)
Aligns this project with others to put the
fastlane
directory at the root of the project.To Test:
Note that the following CI jobs are passing for this PR:
To Review:
This is (necessarily) a huge PR because it moves every file in the
fastlane
directory. I'd recommend reviewing this by commit – the first just moves all of the files into the new location – subsequent ones alter them to make them compatible with the new location.It's possible that there might be other breaking changes I haven't encountered while testing, but I'd like to land this in the release branch (then in
develop
) as soon as possible in order to avoid conflicts with other changes – I can fix other broken tooling if/when I run into it – this should be the vast majority of it.--
Reviews: I'd like review from both @AliSoftware and @loremattei for this – @loremattei because he's most familiar with all of it and @AliSoftware because I streamlined a bunch of the pathing and variables and I'd love your input on the changes.
Thank you!!