Skip to content
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

Merged
merged 26 commits into from
Feb 12, 2021
Merged

Move Fastlane to Project Root #15706

merged 26 commits into from
Feb 12, 2021

Conversation

jkmassel
Copy link
Contributor

@jkmassel jkmassel commented Jan 26, 2021

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:

  • Build Tests
  • Unit Tests
  • UI Tests (both)
  • Installable Build
  • Translation Build (note that the build in appetize.io is the one associated with the CI run 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!!

@jkmassel jkmassel self-assigned this Jan 26, 2021
@jkmassel jkmassel added the Tooling Build, Release, and Validation Tools label Jan 26, 2021
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 26, 2021

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 26, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@jkmassel jkmassel force-pushed the move/fastlane branch 8 times, most recently from d229677 to 0920e4f Compare January 30, 2021 06:50
@jkmassel jkmassel marked this pull request as ready for review January 31, 2021 07:13
Copy link
Contributor

@AliSoftware AliSoftware left a 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)

.gitignore Outdated Show resolved Hide resolved
Scripts/extract-framework-translations.swift Outdated Show resolved Hide resolved
Scripts/update-translations.rb Outdated Show resolved Hide resolved
Scripts/update-translations.rb Outdated Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
fastlane/Fastfile Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
@AliSoftware AliSoftware self-requested a review February 1, 2021 17:19
@jkmassel jkmassel added this to the 16.6 ❄️ milestone Feb 2, 2021
Copy link
Contributor

@loremattei loremattei left a 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 Show resolved Hide resolved
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
Copy link
Contributor

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.

Copy link
Contributor Author

@jkmassel jkmassel Feb 3, 2021

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"]="../"
Copy link
Contributor

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.

Copy link
Contributor

@AliSoftware AliSoftware Feb 2, 2021

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.

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export_method: "enterprise",
clean: true,
output_directory: "../build/",
derived_data_path: "../derived-data/alpha/",
Copy link
Contributor

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.

Copy link
Contributor Author

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" }
Copy link
Contributor

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.

Copy link
Contributor Author

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)

Copy link
Contributor Author

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\"")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor Author

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.

@jkmassel
Copy link
Contributor Author

jkmassel commented Feb 3, 2021

@AliSoftware this is ready for another look when you are!

@jkmassel jkmassel modified the milestones: 16.6, 16.7 ❄️ Feb 8, 2021
@jkmassel jkmassel changed the base branch from release/16.6 to release/16.7 February 8, 2021 23:50
# 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
Copy link
Contributor

@AliSoftware AliSoftware left a 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 😅
image

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

.circleci/config.yml Show resolved Hide resolved
Scripts/update-translations.rb Outdated Show resolved Hide resolved
Scripts/update-translations.rb Show resolved Hide resolved
Scripts/update-translations.rb Outdated Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
fastlane/README.md Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@AliSoftware
Copy link
Contributor

AliSoftware commented Feb 9, 2021

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.

Copy link
Contributor

@loremattei loremattei left a 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 :-)

Scripts/update-translations.rb Outdated Show resolved Hide resolved
@jkmassel
Copy link
Contributor Author

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.

Copy link
Contributor

@loremattei loremattei left a 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.
:shipit:

Copy link
Contributor

@AliSoftware AliSoftware left a 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 :shipit: 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)

@jkmassel jkmassel merged commit e020c26 into release/16.7 Feb 12, 2021
@jkmassel jkmassel deleted the move/fastlane branch February 12, 2021 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tooling Build, Release, and Validation Tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants