-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update CI Workflow #15273
Update CI Workflow #15273
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APKs: |
The base branch was automatically changed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes look good to me. I think it'd be best to test this after the upcoming code freeze, so I am skipping that for now.
Temporarily allow force-push on the
release/18.1
branch in the GitHub Settings, revert the last 2 commits (translations update and version bump), and forbid force-push in the branch settings again
I think we should just create revert commits instead of force pushing. I don't think the extra few commits is bad enough to worth the hassle.
P.S: Should we have a prefix for the release toolkit lanes or the internal ones, it's very difficult to know which is which, so I keep having to look things up. Also the lack of static typing is just unbearable to me, so I appreciate you working on these @AliSoftware 🙇
Yep good point, revert-commits would be better 👍 (updated the instructions)
Agreed, I still have to look up sometimes to see if it's an internal lane or a release-toolkit action. All of our release-toolkit actions for Android start with the prefix
Oh yeah I miss the static typing as well!! This is also why (1) I split my plan to do those Fastfile and toolkit changes in very small increments so we can test changes little by little in real world (2) I am really hoping to find some time to get to paaHJt-1Zs-p2 at some point to help a bit with that (even if still not perfect) and why we opened wordpress-mobile/release-toolkit#201 a while ago 😅 . But so far it still always feels like dangerous territory every time I touch the toolkit… |
Reminder to self:
As this is an issue that is related to CI (since we use that override for Installable Builds built from CI) it would make sense for me to fix this during this PR. |
@oguzkocer Figured it'd only take a couple of seconds after all so implemented it in 900f65d to avoid forgetting about it.
|
@AliSoftware That looks good to me, thanks for fixing it! 🙇 |
We don't want to have to specify app: when calling those lanes in the CLI anymore. Some of the release-toolkit actions still require an app: parameter even if they don't use it – because we are still WIP on cleaning things up there – so for those we just pass a dummy empty value instead. Which will also allow us to check during the next run that this value indeed doesn't matter, before removing it completely
- Replace 'app' with dummy value where appropriate (e.g. version-related actions) - But keep it where needed (e.g. to know which bundle and variant to build)
Co-authored-by: Oguz Kocer <[email protected]>
b7eb2ed
to
627c08f
Compare
627c08f
to
17c85c8
Compare
17c85c8
to
bebbe1b
Compare
PR Update: New changes
This parallelization was planned to be for a separate PR, but since it have become a blocker I've now included it into this one. Status
The solution for the OOM issues will be to migrate the Release jobs to BuildKite, but that's part of a quite different project, so I'm ok with living with it for a couple of sprints until we get to that – even if that means I'll likely have to retry one of the 3 jobs most of the time when I do a beta or release, that's still way better than the state of things prior to that PR. ReviewAs the last changes I made work, this should be ready for another review. \cc @oguzkocer |
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks solid to me without having tested – just left one note.
versionName versionProperties.getProperty("alpha.versionName") | ||
versionCode versionProperties.getProperty("alpha.versionCode").toInteger() | ||
versionName project.findProperty("installableBuildVersionName") ?: versionProperties.getProperty("alpha.versionName") | ||
versionCode 1 // Fixed versionCode because those builds are not meant to be uploaded to the PlayStore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking about this one – by doing this we lose the ability to install newer installable builds overtop of older ones. Do we care about that?
I'm not sure how big those numbers can get, but could we work around this by having the versionCode
be new Date().to_int()
or similar? Or is that just overthinking it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question.
Note though that this was already the case (having the versionCode ne the same for multiple installable builds) before that change, because versionCode
is only bumped during new betas but there are many PRs done (especially on develop
) between two betas (and between two merges of the release
branch to develop
after a beta). So all those PRs' Installable Builds were already using the same versionCode
(the one from the last beta since PR was opened), and it didn't seem to have been a problem so far? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what @jkmassel means is that (correct me if I am wrong), since the previous installable build versions had a higher version code, developers won't be able to update them without first deleting the existing build once. After that, I agree that the same version code should allow updates, but I haven't tested the behavior.
I don't think it's a big issue since these are just test builds, but I do like the date idea 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah indeed I think people might need to delete old installable builds before installing the ones which will be versionCode 1.
I don't think that's a big issue as it's one time thing; and was also already the case if you tested a PR 1234 first and then test PR 987 which was cut from develop before 1234 and with a potentially older versionCode. In fact now having versionCode 1 for all of them might even solve that case (after the initial deletion past this PR)? 🤔
(Which the date trick won't solve btw—even if it could be worth considering for other reasons than this, ie to easily identify the build date for those?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am good either way. If it turns out to be an issue, it's easy enough to improve since we are all aware of it. So, whatever you want to go with, it's a 👍 from me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops made comments earlier this morning… but didn't realize they were pending and waiting for me to submit review 😅 Here they are.
if [[ ${APP_VERSION} == *"-rc-"* ]]; then | ||
bundle exec fastlane build_beta app:<< parameters.app >> skip_confirm:true skip_prechecks:true create_release:false upload_to_play_store:false | ||
else | ||
bundle exec fastlane build_and_upload_release app:<< parameters.app >> skip_confirm:true skip_prechecks:true create_release:false upload_to_play_store:false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_release:false upload_to_play_store:false
are from the temporary commit bebbe1b made for testing the PR, and which will be reverted before merge. (Ditto for lines 127 and 137)
versionName versionProperties.getProperty("alpha.versionName") | ||
versionCode versionProperties.getProperty("alpha.versionCode").toInteger() | ||
versionName project.findProperty("installableBuildVersionName") ?: versionProperties.getProperty("alpha.versionName") | ||
versionCode 1 // Fixed versionCode because those builds are not meant to be uploaded to the PlayStore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah indeed I think people might need to delete old installable builds before installing the ones which will be versionCode 1.
I don't think that's a big issue as it's one time thing; and was also already the case if you tested a PR 1234 first and then test PR 987 which was cut from develop before 1234 and with a potentially older versionCode. In fact now having versionCode 1 for all of them might even solve that case (after the initial deletion past this PR)? 🤔
(Which the date trick won't solve btw—even if it could be worth considering for other reasons than this, ie to easily identify the build date for those?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed these final test instructions that were verified by @AliSoftware on Slack:
- Trigger a release build on this branch using
bundle exec fastlane trigger_release_build branch_to_build:jetpack-infra/ci
- Check that the CI builds WordPress Zalpha, WordPress Vanilla and Jetpack Vanilla all in parallel, and succeeds the builds(†)
- Verify that Installable Builds for both WP and JP are still properly built and created with the expected version.
The release builds were all green. The installable build was in a failed state due to cancellation, so I restarted the build and then tested both apks and verified the version number. Here is the one from WordPress:
This is part of project paaHJt-2s8-p2
ℹ️ This PR targets release/18.2. I've made this choice so that it gives me the opportunity to use it for the current release cycle (and test it in real conditions ASAP), assuming it's approved and merged before the end of Sprint.
What it does
.circleci/config.yml
to build Jetpack Vanilla in the same workflow (and single API trigger) that it builds Wordpress Zalpha and WordPress VanillaFastfile
to adapt thetrigger_release_build
lane accordinglyFastfile
to stop requiring passing theapp:
parameter when using lanes for usual release duties (code_freeze
,new_beta_release
, etc)app:
parameter of version-management-related actions called fromFastlane
to a dummy valuewp_jp
app:
param for those actions don't have any impact anymore, as per Update Android versioning helpers to use unified versions for JP/WP release-toolkit#298 changes. If we confirm after this PR that things continue working, that would confirm we can delete theapp:
param completely for those actions in the release-toolkit during next iteration.app:
param is still present and used for some other lanes, likebuild_bundle
and friends, as it is used by the.circleci/config.yml
to know which app to build; so that param will stay even after the refactor. This is why not allapp:
params have been changed to dummy values, but only the relevant onesWhat it does not (yet)
This will be addressed in a subsequent PR, as it feels safer to do those kind of changes incrementally – especially to the lack of type-checking in the Fastfile and toolkit there makes me be quite cautious 😉 .
To test
bundle exec fastlane new_beta_release
and check that it updates the translations, bumps the version correctly in theversion.properties
with a single common value for JP and WP, lint the project only for WP (since both are using same strings), then trigger a release build on CIrelease/18.2
branch on CI, which doesn't have the changes in theFastfile
nor.circleci/config.yml
jetpack-infra/ci
branch, and cherry-pick the version bump that was made in the last step inrelease/18.2
branch, and push it to the remote.bundle exec fastlane trigger_release_build branch_to_build:<your-branch-name>
Notes
(†) Given p1631035422011900-slack-C020B5ME5L0, there is a chance that one of the 3 jobs in the workflow will fail with an Out of Memory (Gradle Daemon Disappeared) issue, and you will have to restart just the failed job ("Restart from failed") to finally get it green. This is a known issue, that was deemed acceptable to live with until we find time for the BuildKite migration (and not doing parallelization led to the recent
aapt2
crash anyway, so at least it's still better)(‡) Last commit bebbe1b disables the upload to PlayStore and GitHub Release creation, in order to facilitate testing (allowing you to trigger release builds using API multiple times without risking the duplicate versionCode issue or spamming GH releases while testing). I intend to revert bebbe1b before merging that PR.
Cleanup
.aab
(alpha and beta) in "App Bundler Explorer" tab, and also discard the 2 release drafts (alpha and beta).aab
for beta and the beta release draft