Skip to content

[Tooling] Fix complete_code_freeze push on tags#17627

Merged
oguzkocer merged 1 commit intodevelopfrom
tooling/fix-push
Dec 6, 2021
Merged

[Tooling] Fix complete_code_freeze push on tags#17627
oguzkocer merged 1 commit intodevelopfrom
tooling/fix-push

Conversation

@AliSoftware
Copy link
Copy Markdown
Contributor

@AliSoftware AliSoftware commented Dec 6, 2021

This trivial change in our Fastfile aims to fix wordpress-mobile/release-toolkit#314

The issue in wordpress-mobile/release-toolkit#314 can only happen if the user of the lane has invalid tags locally (i.e. local tags that are not in sync with remote tags anymore). But since we don't really need to push tags on code freeze (we only pushed them because this is the default for this fastlane action and we didn't override it), better just not push them and avoid the risk.

PS: Fixing on develop because even if it's fixing the release lanes, this fix only affects complete_code_freeze which won't be called again during the current release/18.8 branch so no point in fixing that in the frozen branch as I often do otherwise.

@AliSoftware AliSoftware added the Tooling Build, Release, and Validation Tools label Dec 6, 2021
@AliSoftware AliSoftware added this to the 18.9 milestone Dec 6, 2021
@AliSoftware AliSoftware requested a review from mokagio December 6, 2021 11:33
@AliSoftware AliSoftware self-assigned this Dec 6, 2021
@peril-wordpress-mobile
Copy link
Copy Markdown

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

@peril-wordpress-mobile
Copy link
Copy Markdown

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


UI.confirm('Ready to push changes to remote and trigger the beta build?') unless ENV['RELEASE_TOOLKIT_SKIP_PUSH_CONFIRM']
push_to_git_remote
push_to_git_remote(tags: false)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder why fastlane developers opted to make tags parameter true by default. That seems a bit risky to me. 🤷

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep I was surprised by this as well, quite unfortunate.

I'm back-and-forth on creating our own helper action (which could be something like git_commit(message:files:push:) or something like that) in the release-toolkit to have our own default values and options, also because this built-in one as that tags: true as default. Not sure if it's worth it though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know how often this method is used, so I don't have any feedback on that. However, what you're proposing makes sense to me if you feel it'd be worthwhile.

Not so fun fact, I struggled a bit finding where this method(?) was defined. I searched for the project and release-toolkit convinced that it was supposed to be there. I only later realized it might be a fastlane method. One of many things I struggle with Ruby(?) or the release-toolkit structure where things are not very obvious for someone like me who is used to code being a bit more explicit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't really answer your question, but when the parameter was added, they set it to true for backward compatibility.

I think it would be reasonable to suggest to switch to false as the default. I wonder how they would treat that change from a SemVer point of view, though 🤔 Maybe there's too much inertia in the tool's adoption to introduce a breaking but little change like this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure from how the fastlane team runs things that this would be a no-no for them to change the default value of this action there, because they're pretty conservative in the API, oftentimes preferring to keep an old API intact despite finding flaws in it later, rather than doing a breaking change.

Since it was created and reach its first stable version (1.0.0) years, fastlane only made a major version (2.x.x) once (!), especially because of that and the fact they really seem to try very hard to avoid doing any breaking changes (in order to not have users make migrations every N months or so). So changing the default value here is very likely out of the question for them.

Not so fun fact, I struggled a bit finding where this method(?) was defined. I searched for the project and release-toolkit convinced that it was supposed to be there. I only later realized it might be a fastlane method. One of many things I struggle with Ruby(?) or the release-toolkit structure where things are not very obvious for someone like me who is used to code being a bit more explicit.

💯 I wish Fastlane had at least some namespacing concept, so that we could do a8c.some_action to distinguish our actions from the Release Toolkit from the rest. Or even better, an ability to have nested namespaces like a8c.ios.some_action, a8c.ios.git.some_sub_action… That would help clarify a lot. Sadly I don't think that's a feature they currently support 😒

PS: Note that Fastlane now supports writing Fastfiles in Swift (as an alternative to Ruby). Which might (?) provide us with nicer type checking and API in our Fastfiles (though given the dynamic nature of the available actions with the plugin system, not sure how much it would improve things in practice…). I am guessing that this means depending on the presence of the Swift compiler (Xcode or the CommandLine Tools) being installed on the Mac running fastlane, which is ok for iOS projects but not an ideal for Android projects…

@oguzkocer oguzkocer merged commit 51d5ec1 into develop Dec 6, 2021
@oguzkocer oguzkocer deleted the tooling/fix-push branch December 6, 2021 19:01
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.

push_to_git_remote failed on a Mac that had pulled tags from remote

3 participants