Skip to content

Conversation

@iangmaia
Copy link
Contributor

@iangmaia iangmaia commented Nov 17, 2025

Related to AINFRA-1518

Description

This PR aims to add more robustness and require less manual intervention to the hotfix creation lane new_hotfix_release.

We have observed that sometimes it is possible that the release has been finalized but a release tag isn't present yet for some reason (likely due to the fact that the release hasn't been published yet), so release managers will get an error and require manual intervention.

This PR changes the code so that it, if not release tag is present, we start the hotfix branch based on the corresponding release branch.

Testing instructions

There are basically 3 test scenarios that can be simulated:

  1. There is a release tag that can be used to create the hotfix branch
  2. There's no tag, but there's still a release branch that can be used to create the hotfix branch
  3. There's no tag or branch (error)

To test it, you can create test branches / tags (⚠️ delete them later or, even better, use this technique of pointing your working copy’s origin remote to a local bare repo instead ⚠️ ) and run bundle exec fastlane new_hotfix_release skip_confirm:false version_name:$VERSION build_code:$CODE and then answer no after the prompt so that the lane execution stops and check the printed values.

For example:

  1. Create and push release branch release/30.6 (which doesn't exist and has no corresponding tag for that version)
  2. Run bundle exec fastlane new_hotfix_release skip_confirm:false version_name:30.6 build_code:9999
  3. It should use the release/30.6 branch instead of trying to use a tag. It should print:
Current release version: 26.3.1
New hotfix version: 30.6

Current build code: 1478
New build code: 9999

Branching from release/30.6

@iangmaia iangmaia added this to the 26.5 milestone Nov 17, 2025
@iangmaia iangmaia self-assigned this Nov 17, 2025
@AliSoftware AliSoftware self-requested a review November 17, 2025 23:47
@iangmaia iangmaia force-pushed the iangmaia/improve-hotfix-handling branch 2 times, most recently from 5e382c9 to b4376a1 Compare November 19, 2025 21:19
# Parse the provided version into an AppVersion object
parsed_version = VERSION_FORMATTER.parse(new_version)
# Validate that this is a hotfix version (must have a patch component > 0)
UI.user_error!("Invalid hotfix version '#{new_version}'. Must include a patch number.") unless parsed_version.patch.to_i.positive?
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick, and sort of out of scope because it would have required changing more of the existing code that this PR originally touched, but I noticed that other projects use hotfix_version as the name for this var, which to me sounds better in the context of this hotfix lane.

No big deal, it's just that the PR I looked before this used hotfix_version so this jumped to my attention, I think.

Copy link
Contributor Author

@iangmaia iangmaia Nov 25, 2025

Choose a reason for hiding this comment

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

I think hotfix_version was an exception though, only DOApple (or maybe other one or two) used it, but admittedly I also like it 🙂 I'll update it in the PRs that are still open.

@iangmaia
Copy link
Contributor Author

@AliSoftware I've implemented the last change we discussed about ensuring the hotfix branch doesn't exist on 56b313c .

@iangmaia iangmaia force-pushed the iangmaia/improve-hotfix-handling branch from 56b313c to 1f79171 Compare November 25, 2025 16:20
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants