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

Use named block parameters in new_hotfix_release lane #13947

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Sep 13, 2024

Similar to #13793.

Description

While working on Automattic/simplenote-ios#1655 in the context of paaHJt-6ps-p2, I noticed new_hotfix_release lane used options. Updating it was a matter of a few SLOC.

Steps to reproduce

N.A.

Testing information

N.A. - I reviewed the changes carefully and trust you'll do the same.

This lane will run when we'll build a new hotfix, which we can't know ahead of time. Having said that, we can hack it a bit and test most of it:

--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -389,7 +389,7 @@ platform :ios do
   desc 'Creates a new hotfix branch for the given version:x.y.z. The branch will be cut from the tag x.y of the previous release'
   lane :new_hotfix_release do |version:, skip_confirm: false|
     # Verify that there's nothing in progress in the working copy
-    ensure_git_status_clean
+    # ensure_git_status_clean
 
     # Parse the provided version into an AppVersion object
     parsed_version = VERSION_FORMATTER.parse(version)
@@ -424,7 +424,7 @@ platform :ios do
     commit_version_bump
 
     # Push the newly created hotfix branch
-    push_to_git_remote(tags: false)
+    # push_to_git_remote(tags: false)
 
     UI.success("Done! New Release Version: #{release_version_current}. New Build Code: #{build_code_current}")
   end

The result on my end of running bundle exec fastlane new_hotfix_release version:20.2.1:

wcios  test [8$ 2?] 💎 v3.2.2 took 7s
➜ bf new_hotfix_release version:20.2.1

[✔] 🚀
[16:24:28]: ------------------------------
[16:24:28]: --- Step: default_platform ---
[16:24:28]: ------------------------------
[16:24:28]: Driving the lane 'ios new_hotfix_release' 🚀
[16:24:28]: -------------------
[16:24:28]: --- Step: is_ci ---
[16:24:28]: -------------------
[16:24:28]: ---------------------------------------
[16:24:28]: --- Step: check_for_toolkit_updates ---
[16:24:28]: ---------------------------------------
[16:24:28]: Currently using release toolkit version 12.0.0.
[16:24:28]: Checking for updates now...
[16:24:29]: There is a newest version 12.1.0 of the release toolkit!
[16:24:29]: Do you want to run bundle update now? (y/n)
n
[16:24:39]: -------------------
[16:24:39]: --- Step: is_ci ---
[16:24:39]: -------------------
[16:24:39]: ----------------------
[16:24:39]: --- Step: setup_ci ---
[16:24:39]: ----------------------
[16:24:39]: Not running on CI, skipping CI setup
[16:24:39]:
      New hotfix version: 20.2.1
      New build code: 20.2.1.0
      Branching from tag: 20.2


[16:24:39]: Do you want to continue? (y/n)
y
[16:24:40]: ----------------------------
[16:24:40]: --- Step: git_tag_exists ---
[16:24:40]: ----------------------------
[16:24:40]: Shell command exited with exit status 1 instead of 0.
[16:24:40]: ----------------------------
[16:24:40]: --- Step: git_tag_exists ---
[16:24:40]: ----------------------------
[16:24:40]: Creating hotfix branch...
[16:24:40]: $ git branch --list release/20.2.1
[16:24:40]: $ git checkout 20.2
[16:24:41]: ▸ Note: switching to '20.2'.
[16:24:41]: ▸ You are in 'detached HEAD' state. You can look around, make experimental
[16:24:41]: ▸ changes and commit them, and you can discard any commits you make in this
[16:24:41]: ▸ state without impacting any branches by switching back to a branch.
[16:24:41]: ▸ If you want to create a new branch to retain commits you create, you may
[16:24:41]: ▸ do so (now or later) by using -c with the switch command. Example:
[16:24:41]: ▸ git switch -c <new-branch-name>
[16:24:41]: ▸ Or undo this operation with:
[16:24:41]: ▸ git switch -
[16:24:41]: ▸ Turn off this advice by setting config variable advice.detachedHead to false
[16:24:41]: ▸ HEAD is now at cb31f4183b Bump version number
[16:24:41]: $ git checkout -b release/20.2.1
[16:24:41]: ▸ Switched to a new branch 'release/20.2.1'
[16:24:41]: ------------------------
[16:24:41]: --- Step: git_branch ---
[16:24:41]: ------------------------
[16:24:41]: Done! New hotfix branch is: release/20.2.1
[16:24:41]: Bumping hotfix version and build code...
[16:24:41]: ------------------------
[16:24:41]: --- Step: git_commit ---
[16:24:41]: ------------------------
[16:24:41]: $ git commit -m Bump\ version\ number /Users/gio/Developer/a8c/wcios/config/Version.Public.xcconfig
[16:24:41]: ▸ [release/20.2.1 090d36d0ed] Bump version number
[16:24:41]: ▸ 1 file changed, 2 insertions(+), 2 deletions(-)
[16:24:41]: Successfully committed "["/Users/gio/Developer/a8c/wcios/config/Version.Public.xcconfig"]" 💾.
[16:24:41]: Done! New Release Version: 20.2.1. New Build Code: 20.2.1.0
[16:24:41]: fastlane.tools finished successfully 🎉

Screenshots

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.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.ar

@wpmobilebot
Copy link
Collaborator

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr13947-7138e16
Version20.3
Bundle IDcom.automattic.alpha.woocommerce
Commit7138e16
App Center BuildWooCommerce - Prototype Builds #10849
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@mokagio mokagio added this to the 20.5 milestone Sep 13, 2024
@mokagio mokagio added the category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. label Sep 13, 2024
@mokagio mokagio requested a review from a team September 13, 2024 06:28
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.

❤️

@mokagio mokagio merged commit 6cc6bb1 into trunk Sep 13, 2024
17 checks passed
@mokagio mokagio deleted the mokagio/named-block-parameters-20240911 branch September 13, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants