-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Bug 1635488 - add Fenix version-bump task. #16361
Conversation
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.
Thanks for this first stab at the patch. This is just a preliminary review I'm making. I'm going to test it end-to-end on my own fork. I just made the comments below in order to remind me about the things I may have to change to get this patch fully tested. No need to address these comments now 🙂
Required("paths"): [text_type], | ||
} | ||
], | ||
Optional("dontbuild"): bool, |
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'd say: no need to support DONTBUILD
yet. It's just supported for HG, so far https://hg.mozilla.org/ci/taskgraph/file/4c4d72d32c5ec36a3d0187bf792ac08f1348f9fa/src/taskgraph/decision.py#l190
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.
Agreed. Also TIL taskgraph supports DONTBUILD
at that level 👍
@payload_builder( | ||
"scriptworker-tree", | ||
schema={ | ||
# FIXME: do we need upstream artifacts? |
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 don't think we do.
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 was trying to get rid of upstream-artifacts and wasn’t sure how. But I realized in the meantime, upstream-artifacts is being added in my task given https://github.com/mozilla-mobile/fenix/blob/master/taskcluster/fenix_taskgraph/transforms/multi_dep.py#L74 so I can simply switch in the payload from Required to Optional for now.
task_def['payload'] = {'actions': []} | ||
actions = task_def['payload']['actions'] | ||
if worker['tags']: | ||
# TODO: add tags logic here |
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 don't think we need to support tags, at the moment. Githubscript implicitly creates one whenever a github release is made.
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, so we solve this problem in github-release
task concurrently from this, makes sense.
taskcluster/ci/version-bump/kind.yml
Outdated
kind-dependencies: | ||
- github-release | ||
|
||
primary-dependency: github-release # FIXME: should we block on pushapk instead or both? |
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.
push-apk
is a good idea. github-release
doesn't depend on the state of the tree so both tasks can run at the same time, in my opinion.
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.
Agreed, changed to depend on pushapk
instead.
Codecov Report
@@ Coverage Diff @@
## master #16361 +/- ##
============================================
- Coverage 29.97% 29.92% -0.05%
+ Complexity 1224 1223 -1
============================================
Files 457 457
Lines 18770 18802 +32
Branches 2582 2586 +4
============================================
+ Hits 5626 5627 +1
- Misses 12704 12735 +31
Partials 440 440
Continue to review full report at Codecov.
|
7a281d8
to
8a2641f
Compare
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 managed to test this patch end-to-end. It required a few changes that are unnecessary on prod. I tested:
- A version bump from shipit: https://firefox-ci-tc.services.mozilla.com/tasks/L71svzYuTyqbI88_p-wJ3Q/runs/1
- A version bump from github-releases: https://firefox-ci-tc.services.mozilla.com/tasks/cOrQjiFjT1G7AqeJg8_Ybw
- A wrong version number, which is failing as expected https://firefox-ci-tc.services.mozilla.com/tasks/AuxX3sTMSmWnVjduyvqSLA/runs/0
I'm feeling confident we can land this on Monday and test the next release with it. @st3fan, when is the first 84 beta planned?
@MihaiTabara, feel free to take a look, if you have enough time.
@@ -243,7 +243,7 @@ tasks: | |||
# Note: This task is built server side without the context or tooling that | |||
# exist in tree so we must hard code the hash | |||
image: | |||
mozillareleases/taskgraph:decision-mobile-6607973bc60e32323a541861cc5856cd6a0f51ea9fd664ef7d43bca8df53db47@sha256:8c471aacc469ea8e7bb4846c16efe086f7350a5cc1df570cc6c86b22895a2456 | |||
mozillareleases/taskgraph:decision-mobile-682fbaa1ef17e70ddfe3457da3eaf8e776c4a20fe5bfbdbeba0641fd5bceae2a@sha256:bbb2613aaab79d17e590fbd78c072d0643be40fd1237195703f84280ecc3b302 |
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 didn't remember how to publish a new docker image. I'll write some documentation because I think only Tom, Callek, and I knew the procedure.
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.
Good point on adding docs! I think we have some for image_builders in https://moz-releng-docs.readthedocs.io/en/latest/taskcluster/uploading_an_image.html - it might be worth refreshing that or adding another section there?
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.
Quick question, why do we need to bump this image?
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.
If I understand correctly, the python packages are baked in the image. Bumping taskgraph
above doesn't update them.
taskcluster/scripts/decision-install-sdk.sh && | ||
ln -s /builds/worker/artifacts artifacts && | ||
~/.local/bin/taskgraph action-callback | ||
else: > | ||
PIP_IGNORE_INSTALLED=0 pip install --user /builds/worker/checkouts/taskgraph && | ||
PIP_IGNORE_INSTALLED=0 pip install --user arrow taskcluster pyyaml && |
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.
pyyaml
is already embedded in taskgraph, so no need to reinstall it: https://hg.mozilla.org/ci/taskgraph/file/2b2622598df02bde211d8cedb334b7b22fb883a4/requirements/base.in#l5
arrow
and taskcluster
were used pre-taskgraph. I checked: we don't need them anymore.
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.
Nice cleanup 👍
@@ -261,12 +261,13 @@ tasks: | |||
$if: 'tasks_for == "action"' | |||
then: > | |||
PIP_IGNORE_INSTALLED=0 pip install --user /builds/worker/checkouts/taskgraph && | |||
PIP_IGNORE_INSTALLED=0 pip install --user mozilla-version && |
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.
mozilla-version is used mainly to support github-releases. We may be able to remove it once we drop support.
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.
Nit: should we add a quick TODO to revisit this once we drop support for github-releases
?
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'm unsure whether we could remove it. I'd say: let's not put a misleading TODO for now. I'll revisit once I know more.
"3": true | ||
# If you set the following line to true, you need to grant write access | ||
# to https://github.com/mozilla-release-automation-bot-staging on your | ||
# fork. |
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.
Doing so enabled me to get this kind of staging commits JohanLorenzo@f493a3a
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.
Thanks for the comment, that's useful to know!
parameters["target_tasks_method"] = "release" | ||
|
||
|
||
def resolve_release_type(head_tag): |
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 function is not useful anymore since we can rely on https://github.com/mozilla-releng/mozilla-version. That library knows how to detect a beta version from a release one.
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.
mozilla-version FTW!
|
||
version = FenixVersion.parse(version_string) | ||
if version.is_beta: | ||
next_version = version.bump("beta_number") |
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.
In order to prevent mismatch, we need github-releases to bump version.txt
too. Shipit knows how to provide what the next version is. We have to replicate this logic on github-release, while we support this use case.
RELEASE_PROMOTION_PROJECTS = ( | ||
"https://github.com/JohanLorenzo/fenix", |
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.
My fork may be needed in the future, but we don't need it to be whitelisted on the main repo.
parameters['release_type'] = resolve_release_type(parameters['head_tag']) | ||
version_string = parameters['version'] | ||
if version_string != version_in_file: | ||
raise ValueError("Version given in tag ({}) does not match the one in version.txt ({})".format(version_string, version_in_file)) |
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 error should never happen, but it prevents shipit from being regressed.
parameters['next_version'] = input['next_version'] | ||
|
||
version = FenixVersion.parse(version_string) | ||
if version.is_beta: |
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 could have factorized this behavior with what we have in parameters.py
. Although, I intend that logic to be gone by the end of the year.
This is why, I'm okay to have a little bit of code duplication here.
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.
Makes sense 👍
@@ -1 +1 @@ | |||
4.0.0-beta.2 | |||
84.0.0-beta.1 |
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.
v83 is already on its stabilization branch and will ship sometimes next week. As far as I understand, 84 is what's on the master branch.
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.
Can't wait to test this in production!
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.
@JohanLorenzo Just to confirm, if this patch merges, along with the scriptworker-scripts - we will have the ability to trigger staging releases and to version bumps vs github-releases
. But we still need to turn-on the Fenix into Ship-it + potentially give mobile folks access to Ship-it, right?
@@ -243,7 +243,7 @@ tasks: | |||
# Note: This task is built server side without the context or tooling that | |||
# exist in tree so we must hard code the hash | |||
image: | |||
mozillareleases/taskgraph:decision-mobile-6607973bc60e32323a541861cc5856cd6a0f51ea9fd664ef7d43bca8df53db47@sha256:8c471aacc469ea8e7bb4846c16efe086f7350a5cc1df570cc6c86b22895a2456 | |||
mozillareleases/taskgraph:decision-mobile-682fbaa1ef17e70ddfe3457da3eaf8e776c4a20fe5bfbdbeba0641fd5bceae2a@sha256:bbb2613aaab79d17e590fbd78c072d0643be40fd1237195703f84280ecc3b302 |
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.
Good point on adding docs! I think we have some for image_builders in https://moz-releng-docs.readthedocs.io/en/latest/taskcluster/uploading_an_image.html - it might be worth refreshing that or adding another section there?
@@ -8,7 +8,7 @@ tasks: | |||
- $let: | |||
taskgraph: | |||
branch: taskgraph | |||
revision: 12992b0f984884ec2b0a7bdedc3b3ba467363eb4 | |||
revision: 2b2622598df02bde211d8cedb334b7b22fb883a4 |
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.
Note to self: I reckon this is to get https://hg.mozilla.org/ci/taskgraph/rev/2b2622598df02bde211d8cedb334b7b22fb883a4 baked it. I see the previous taskgraph revision 12992b0f984884ec2b0a7bdedc3b3ba467363eb4 was the one right after kaniko update so I think this is fine, we already have the public/docker-contexts
exposed.
@@ -243,7 +243,7 @@ tasks: | |||
# Note: This task is built server side without the context or tooling that | |||
# exist in tree so we must hard code the hash | |||
image: | |||
mozillareleases/taskgraph:decision-mobile-6607973bc60e32323a541861cc5856cd6a0f51ea9fd664ef7d43bca8df53db47@sha256:8c471aacc469ea8e7bb4846c16efe086f7350a5cc1df570cc6c86b22895a2456 | |||
mozillareleases/taskgraph:decision-mobile-682fbaa1ef17e70ddfe3457da3eaf8e776c4a20fe5bfbdbeba0641fd5bceae2a@sha256:bbb2613aaab79d17e590fbd78c072d0643be40fd1237195703f84280ecc3b302 |
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.
Quick question, why do we need to bump this image?
@@ -261,12 +261,13 @@ tasks: | |||
$if: 'tasks_for == "action"' | |||
then: > | |||
PIP_IGNORE_INSTALLED=0 pip install --user /builds/worker/checkouts/taskgraph && | |||
PIP_IGNORE_INSTALLED=0 pip install --user mozilla-version && |
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.
Nit: should we add a quick TODO to revisit this once we drop support for github-releases
?
taskcluster/scripts/decision-install-sdk.sh && | ||
ln -s /builds/worker/artifacts artifacts && | ||
~/.local/bin/taskgraph action-callback | ||
else: > | ||
PIP_IGNORE_INSTALLED=0 pip install --user /builds/worker/checkouts/taskgraph && | ||
PIP_IGNORE_INSTALLED=0 pip install --user arrow taskcluster pyyaml && |
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.
Nice cleanup 👍
parameters["target_tasks_method"] = "release" | ||
|
||
|
||
def resolve_release_type(head_tag): |
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.
mozilla-version FTW!
version_string = parameters["version"] | ||
version_in_file = read_version_file() | ||
if version_string != version_in_file: | ||
raise ValueError("Version given in tag ({}) does not match the one in version.txt ({})".format(version_string, version_in_file)) |
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 to confirm I get this right - if for some reason the next two-three releases are done via github-releases instead of Ship-it, wouldn't that mean we have to manually bump the version.txt
file?
version_string = parameters["version"] | ||
version_in_file = read_version_file() | ||
if version_string != version_in_file: | ||
raise ValueError("Version given in tag ({}) does not match the one in version.txt ({})".format(version_string, version_in_file)) |
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.
Later edit: nevermind the above. Regardless of it being triggered from Ship-it or via github-release
, the task group that we generate, both contain the version-bump
tasks so we can't fall behind.
parameters['next_version'] = input['next_version'] | ||
|
||
version = FenixVersion.parse(version_string) | ||
if version.is_beta: |
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.
Makes sense 👍
@@ -1 +1 @@ | |||
4.0.0-beta.2 | |||
84.0.0-beta.1 |
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.
Can't wait to test this in production!
To trigger real releases.
Correct. |
Goal is to add the
version-bump
task that's supposed to update theversion.txt
file in the repository.I need to double check the arguments against mozilla-releng/scriptworker-scripts#289 to see which payload arguments we keep for
git
and which we don't.Following that I can also ammend ci-admin and ci-config + adding SOPS/cloudops-infra configs for the
mobile-{1,3}-tree
worker.CC @JohanLorenzo