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

Further Fastlane setup improvements before adding CI release automation #22214

Merged
merged 9 commits into from
Dec 14, 2023

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Dec 13, 2023

Follows up on @oguzkocer comments from the #22191 review, plus a few further refinements.


Regression Notes

  1. Potential unintended areas of impact – Some of the release automation might have broken. As the release manager, I'll deal with if I run into it.
  2. What I did to test those areas of impact (or what existing automated tests I relied on) – N.A.
  3. What automated tests I added (or what prevented me from doing so) – N.A.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes. N.A.
  • I have considered adding accessibility improvements for my changes. N.A.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary. N.A.

UI changes testing checklist: Not a UI PR.

@@ -24,28 +24,25 @@

release_branch_name = compute_release_branch_name(options:, version: release_version_next)

skip_user_confirmation = options[:skip_confirm]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed here, #22191 (comment), reverted the change that printed this information only in user interactive (skip_confirm:false) mode.

Comment on lines -104 to +101
UI.message('Aborting code freeze as requested.')
UI.message("Terminating as requested. Don't forget to run the remainder of this automation manually.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From #22191 (comment)

but this message feels a bit off to me. When we run this lane locally, the code freeze is completed at this point - we just didn't push it to remote yet.

It does make sense in CI, because if the change is not pushed, then it's discarded. However, that's not the case for local. 🤷

Changed the verb to "terminating" which I hope removes the impression that the lane is atomic and therefore aborting would discard changes. Also added the second sentence to reinforce the fact that changes have been made and it's up to the user to complete the process.

I considered listing what the remaining steps were, but then decided against it to avoid having to maintain that list as the lane evolves.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this works OK as a generic message. Thanks for the improvement!

Comment on lines +29 to -32
message = <<~MESSAGE
Code Freeze:
• New release branch from #{DEFAULT_BRANCH}: #{release_branch_name}

unless skip_user_confirmation
# The `release_version_next` is used as the `new internal release version` value because the external and internal
# release versions are always the same.
message = <<-MESSAGE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to call out in this diff the move from <<- to <<~ and how it affects the indentation once message is printed.

image

cc @spencertransier as (I think) the original author. It's a neat Ruby feature I hope you'll enjoy.

@mokagio mokagio added the Tooling Build, Release, and Validation Tools label Dec 13, 2023
@mokagio mokagio added this to the 24.0 milestone Dec 13, 2023
Copy link
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

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

Looks great! I left a couple non-blocking suggestions.

fastlane/Fastfile Outdated Show resolved Hide resolved
# That means if we change the branch as part of an action, it'll return the incorrect branch.
# This environment variable disables that behavior.
# See https://github.com/fastlane/fastlane/pull/21597
ENV['FL_GIT_BRANCH_DONT_USE_ENV_VARS'] = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick but also a question. I thought environment variables can only be strings - or not set at all. I guess Ruby might be setting this as a string, I am not sure - but for those who are less familiar with Ruby (like myself) I think it's worth setting this as a string value instead.

Having said that, I might totally be wrong about environment variables, and if so, I'd like to fix that 😅

Copy link
Contributor Author

@mokagio mokagio Dec 14, 2023

Choose a reason for hiding this comment

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

image

Nah, you are totally right. As the CI failure on this build shows, ENV expects the value passed to it to be a string.

I just assumed it was fine and that Ruby handled the conversion under the hood. My mistake. Thanks for noticing 🙇‍♂️

Comment on lines -104 to +101
UI.message('Aborting code freeze as requested.')
UI.message("Terminating as requested. Don't forget to run the remainder of this automation manually.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this works OK as a generic message. Thanks for the improvement!

mokagio and others added 2 commits December 14, 2023 11:34
Co-authored-by: Oguz Kocer <oguzkocer@users.noreply.github.com>
That's just how Ruby works, and I should have known better...
@wpmobilebot
Copy link
Contributor

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr22214-42156ab
Version23.9
Bundle IDorg.wordpress.alpha
Commit42156ab
App Center BuildWPiOS - One-Offs #8127
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr22214-42156ab
Version23.9
Bundle IDcom.jetpack.alpha
Commit42156ab
App Center Buildjetpack-installable-builds #7147
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@mokagio mokagio merged commit 48de6b7 into trunk Dec 14, 2023
22 of 23 checks passed
@mokagio mokagio deleted the mokagio/fastlane-improvements-followup branch December 14, 2023 01:27
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.

None yet

3 participants