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

Fastlane: Finalize Release #612

Merged
merged 13 commits into from Aug 3, 2020
Merged

Conversation

jleandroperez
Copy link
Contributor

@jleandroperez jleandroperez commented Jul 24, 2020

Description:

In this PR we're enabling support for localizations in Fastlane's finalize_release step. This means that:

  • We'll download Metadata (AppStore Strings!)
  • We'll also download translated Localizable.strings
  • And as per PR NIB(s) Localization Support #605, we'll also download the Main Menu subproject translations.

Ref. #8

/cc @mokagio @loremattei
Thanks in advance gentlemen!!

Details:

  • VERSION_LONG has been patched to match WooCommerce style. This was causing issues when updating the Metadata GlotPress Key.
  • Fastlane: finalize release now runs ios_update_metadata as well!
  • We're bringing download_metadata.swift from Simplenote iOS (with its URL patched!)

Test

Testing this PR is quite tricky, because the actual scritps perform git push.
For that reason, we'll need to disable few things in your local checkout. Please:

  1. Locate ios_git_helper.rb in your local checkout
  2. Open your fastlane/Fastfile
    • Comment this line (disables finalize_prechecks!)
    • Comment this line (disables ios_final_tag)
  3. Turn off your wifi!!!
  4. Run bundle exec fastlane finalize_release
  • Verify the following files were updated in your local repository, for every language:
    • keywords.txt
    • description.txt
    • promotional.txt
    • release.txt
    • Localizable.strings
    • MainMenu.strings

Release

These changes do not require release notes.

@jleandroperez jleandroperez added tooling Related to anything that supports the building & maintaining of the project. i18n All things Internationalization. labels Jul 24, 2020
@jleandroperez jleandroperez added this to the 1.13 milestone Jul 24, 2020
@jleandroperez jleandroperez self-assigned this Jul 24, 2020
@jleandroperez jleandroperez marked this pull request as ready for review July 24, 2020 18:35
Base automatically changed from issue/8-fastlane-cli to develop July 29, 2020 12:52
@jleandroperez
Copy link
Contributor Author

@mokagio Important detail about this PR is: I've manually patched this constant (otherwise the script that updates the "Download Release Notes from GlotPress" would fail).

I haven't found where is it, exactly, that VERSION_LONG is updated. Is that a manual step?

Thank you!!!

Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

To test this, I had to leave my WiFi on, otherwise the script failed to download the data from GlotPress.

Verify the following files were updated in your local repository, for every language

All the languages had:

  • Localizable.strings
  • MainMenu.strings
  • promotional_text.txt

Some of the languages had:

  • release_notes.txt

None of the languages had:

  • keywords.txt
  • description.txt

Here's my full git status

Details
M  Simplenote/ar.lproj/Localizable.strings
M  Simplenote/ar.lproj/MainMenu.strings
M  Simplenote/cy.lproj/Localizable.strings
M  Simplenote/cy.lproj/MainMenu.strings
M  Simplenote/de.lproj/Localizable.strings
M  Simplenote/de.lproj/MainMenu.strings
M  Simplenote/el.lproj/Localizable.strings
M  Simplenote/el.lproj/MainMenu.strings
M  Simplenote/es.lproj/Localizable.strings
M  Simplenote/es.lproj/MainMenu.strings
M  Simplenote/fa.lproj/Localizable.strings
M  Simplenote/fa.lproj/MainMenu.strings
M  Simplenote/fr.lproj/Localizable.strings
M  Simplenote/fr.lproj/MainMenu.strings
M  Simplenote/he.lproj/Localizable.strings
M  Simplenote/he.lproj/MainMenu.strings
M  Simplenote/id.lproj/Localizable.strings
M  Simplenote/id.lproj/MainMenu.strings
M  Simplenote/it.lproj/Localizable.strings
M  Simplenote/it.lproj/MainMenu.strings
M  Simplenote/ja.lproj/Localizable.strings
M  Simplenote/ja.lproj/MainMenu.strings
M  Simplenote/ko.lproj/Localizable.strings
M  Simplenote/ko.lproj/MainMenu.strings
M  Simplenote/nl.lproj/Localizable.strings
M  Simplenote/nl.lproj/MainMenu.strings
M  Simplenote/pt-BR.lproj/Localizable.strings
M  Simplenote/pt-BR.lproj/MainMenu.strings
M  Simplenote/ru.lproj/Localizable.strings
M  Simplenote/ru.lproj/MainMenu.strings
M  Simplenote/sv.lproj/Localizable.strings
M  Simplenote/sv.lproj/MainMenu.strings
M  Simplenote/tr.lproj/Localizable.strings
M  Simplenote/tr.lproj/MainMenu.strings
M  Simplenote/zh-Hans-CN.lproj/Localizable.strings
M  Simplenote/zh-Hans-CN.lproj/MainMenu.strings
M  Simplenote/zh-Hant-TW.lproj/Localizable.strings
M  Simplenote/zh-Hant-TW.lproj/MainMenu.strings
A  fastlane/metadata/de-DE/promotional_text.txt
A  fastlane/metadata/default/promotional_text.txt
A  fastlane/metadata/default/release_notes.txt
A  fastlane/metadata/en-US/promotional_text.txt
A  fastlane/metadata/en-US/release_notes.txt
A  fastlane/metadata/es-ES/promotional_text.txt
A  fastlane/metadata/es-ES/release_notes.txt
A  fastlane/metadata/fr-FR/promotional_text.txt
A  fastlane/metadata/id/promotional_text.txt
A  fastlane/metadata/it/promotional_text.txt
A  fastlane/metadata/ja/promotional_text.txt
A  fastlane/metadata/ko/promotional_text.txt
A  fastlane/metadata/nl-NL/promotional_text.txt
A  fastlane/metadata/pt-BR/promotional_text.txt
A  fastlane/metadata/ru/promotional_text.txt
A  fastlane/metadata/sv/promotional_text.txt
A  fastlane/metadata/tr/promotional_text.txt
A  fastlane/metadata/zh-Hans/promotional_text.txt
A  fastlane/metadata/zh-Hant/promotional_text.txt

Could it be due to some of the languages not having translations yet? There was a bit of logs about it in my Fastlane output

Details
[14:14:51]: $ cd fastlane && ./download_metadata.swift
[14:14:56]: ▸ Downloading Language: de
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: es
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: nl
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: fr
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ Downloading Language: sv
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ Downloading Language: ja
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: it
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: zh-cn
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: tr
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: ko
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ Downloading Language: zh-tw
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ Downloading Language: ru
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ Downloading Language: en-us
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ Downloading Language: id
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for v1.12-whats-new
[14:14:56]: ▸ Downloading Language: en-us
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ Downloading Language: pt-br
[14:14:56]: ▸ No translation for app_store_keywords
[14:14:56]: ▸ No translation for app_store_desc
[14:14:56]: ▸ No translation for v1.12-whats-new

config/Version.public.xcconfig Outdated Show resolved Hide resolved
fastlane/download_metadata.swift Show resolved Hide resolved

// Public long version example: 1_12_0_1. The last 1 means the first build for
// this version
VERSION_LONG=11202
VERSION_LONG=1.12.0.2
Copy link
Contributor

Choose a reason for hiding this comment

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

I worry this change won't go well with Apple 😞 A way to test this would be to ship a new build to TestFlight.

In f174a5b I reverted a similar change because App Store Connect rejected the build with message

This bundle is invalid. The value for key CFBundleVersion
[1.11.1.0] in the Info.plist file must contain a higher version than
that of the previously uploaded version [11103].

I wonder if we may need to bump the build number even more, i.e. adding another leading 1? But maybe that wouldn't work with GlotPress?

This was causing issues when updating the Metadata GlotPress Key.

It might be that we need to do some extra work on the plugin side.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jleandroperez

I haven't found where is it, exactly, that VERSION_LONG is updated. Is that a manual step?

Yes, it's a manual step right now 😳

Co-authored-by: Gio Lodi <giovanni.lodi42@gmail.com>
@jleandroperez
Copy link
Contributor Author

jleandroperez commented Jul 30, 2020

@mokagio Missing language files would be expected (since we do have a few missing translations).

Okay, I've been over this issue for a while:

This bundle is invalid. The value for key CFBundleVersion [1.11.1.0] in the Info.plist file must contain a higher version than that of the previously uploaded version [11103].

I'm thinking that... rather than changing the Release Toolkit, so that it accommodates this scheme, the CLEANEST way to address this is bumping up the major version to 2.0.0.0. That should fix the string comparison, in a single shot.

Since this next release adds localizations (and completed the UX overhaul), it'd be appropriate perhaps.

WDYT?

@jleandroperez
Copy link
Contributor Author

@mokagio checked with the team, okay with bumping up the release version.

This should also fix the codefreeze script that bumps up the release number (I believe!!). Please let me know if everything looks good on your end.

Reason why I'm thinking 2.00.0.0 version would work is that... I've tried comparing both strings in Swift, and indeed 11103 < 2.00.0.0 evaluates as true.

As far as I can tell, the comparison appears to happen based on the first digit, so it should be good.

Thank you!!

Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

Bumping the version to 2.0 sounds like a plan 👍 .

And you know what, while it's not really a breaking change, adding localization it's still a big change so it sounds appropriate, too, despite being a workaround. 👌

The only suggestion I have is to use 2.0.0.0, that is, avoiding the double 00.

That's what WordPress WooCommerce iOS do, e.g.


As an aside, 00 reminds me of the flour we use to make home made pasta 🤣 Must be because I'm reviewing this close to lunch time

config/Version.public.xcconfig Outdated Show resolved Hide resolved
config/Version.public.xcconfig Outdated Show resolved Hide resolved
jleandroperez and others added 2 commits July 30, 2020 23:06
Co-authored-by: Gio Lodi <giovanni.lodi42@gmail.com>
Co-authored-by: Gio Lodi <giovanni.lodi42@gmail.com>
@jleandroperez
Copy link
Contributor Author

@mokagio RIGHT!!! What was I thinking!!!

I hope this change makes all the things go smooth (in theory VERSION_LONG will be bumped by fastlane code_freeze AFAIK right?).

Ready on your mark. Thank you Gio!! Wooooo 2.0 !!!

Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

I hope this change makes all the things go smooth (in theory VERSION_LONG will be bumped by fastlane code_freeze AFAIK right?).

Correct.

Go Mark 2!

GIF with the surface check of the Iron Man Mark II

@jleandroperez
Copy link
Contributor Author

You got it ... that's PRECISELY where I took Mark from 😄

Thank you Gio!!!

@jleandroperez jleandroperez merged commit 5cc9bb8 into develop Aug 3, 2020
@jleandroperez jleandroperez deleted the issue/8-fastlane-finalize-release branch August 3, 2020 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n All things Internationalization. tooling Related to anything that supports the building & maintaining of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants