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

product-details: don't ask hg.mozilla.org for data we already have (bug 1936479) #1586

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

jcristau
Copy link
Contributor

The l10n data for a shipped release is immutable, so there's no point gathering it over and over.

This means get_primary_builds() needs to look at old_product_details as well.

Fixes #1582

…ug 1936479)

The l10n data for a shipped release is immutable, so there's no point
gathering it over and over.

This means get_primary_builds() needs to look at old_product_details as
well.

Fixes mozilla-releng#1582
@jcristau
Copy link
Contributor Author

Output from local testing:

$ docker exec -ti shipit_api_1 /bin/bash
app@afd2542b9914:~$ DEBUG=1 poetry run shipit_rebuild_product_details --database-url="postgresql://shipituser:shipitpassword@db/shipitdb" --channel production
Product details are building ...
2024-12-11 13:42:56,611 - INFO: Getting latest product details from https://github.com/mozilla-releng/product-details.
2024-12-11 13:42:56,611 - DEBUG: Running command: git clone -b production https://github.com/mozilla-releng/product-details product-details, {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp')}
2024-12-11 13:43:01,965 - DEBUG: Running command: git config http.postBuffer 12M, {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
2024-12-11 13:43:01,971 - DEBUG: Running command: git config user.email [email protected], {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
2024-12-11 13:43:01,980 - DEBUG: Running command: git config user.name Release Services Robot, {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
2024-12-11 13:43:01,984 - INFO: Breakpoint version is 114
2024-12-11 13:43:01,985 - INFO: Reading old product details from /tmp/product-details/public
2024-12-11 13:43:02,246 - INFO: Getting old releases from the database
2024-12-11 13:43:02,286 - INFO: Getting the current nightly version from the database
2024-12-11 13:43:02,289 - INFO: Getting locales from hg.mozilla.org for each release from database
2024-12-11 13:43:02,295 - DEBUG: Fetching https://hg.mozilla.org/releases/mozilla-beta/raw-file/9fb87e89c26069198ce2a59a0a790a264d225169/browser/locales/l10n-changesets.json
2024-12-11 13:43:02,295 - DEBUG: Fetching https://hg.mozilla.org/releases/mozilla-release/raw-file/7ed49fe90e846a6d836cf434ba175068e977dc8e/browser/locales/l10n-changesets.json
2024-12-11 13:43:04,071 - DEBUG: Fetched https://hg.mozilla.org/releases/mozilla-release/raw-file/7ed49fe90e846a6d836cf434ba175068e977dc8e/browser/locales/l10n-changesets.json
2024-12-11 13:43:05,377 - DEBUG: Fetched https://hg.mozilla.org/releases/mozilla-beta/raw-file/9fb87e89c26069198ce2a59a0a790a264d225169/browser/locales/l10n-changesets.json
2024-12-11 13:43:05,452 - DEBUG: Fetching https://hg.mozilla.org/mozilla-central/raw-file/default/browser/locales/l10n-changesets.json
2024-12-11 13:43:05,452 - DEBUG: Fetching https://hg.mozilla.org/comm-central/raw-file/default/mail/locales/l10n-changesets.json
2024-12-11 13:43:05,703 - DEBUG: Fetched https://hg.mozilla.org/comm-central/raw-file/default/mail/locales/l10n-changesets.json
2024-12-11 13:43:07,525 - DEBUG: Fetched https://hg.mozilla.org/mozilla-central/raw-file/default/browser/locales/l10n-changesets.json
2024-12-11 13:43:08,756 - DEBUG: Fetched https://whattrainisitnow.com/api/release/schedule/?version=135
2024-12-11 13:43:08,894 - DEBUG: Fetched https://whattrainisitnow.com/api/release/schedule/?version=134
2024-12-11 13:43:09,145 - DEBUG: Fetched https://whattrainisitnow.com/api/release/schedule/?version=135
2024-12-11 13:43:09,283 - DEBUG: Fetched https://whattrainisitnow.com/api/release/schedule/?version=134
2024-12-11 13:43:10,816 - DEBUG: Running command: git add ., {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
2024-12-11 13:43:10,942 - DEBUG: Running command: git status --short, {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
2024-12-11 13:43:11,021 - DEBUG: Running command: git commit -m Updating product details, {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
2024-12-11 13:43:11,056 - DEBUG: Running command: git push origin production, {'stdin': -3, 'stdout': -1, 'stderr': -1, 'cwd': PosixPath('/tmp/product-details')}
Username for 'https://github.com': ^Z
[1]+  Stopped                 DEBUG=1 poetry run shipit_rebuild_product_details --database-url="postgresql://shipituser:shipitpassword@db/shipitdb" --channel production
app@afd2542b9914:~$ cd /tmp/product-details
app@afd2542b9914:/tmp/product-details$ git status
On branch production
Your branch is ahead of 'origin/production' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
app@afd2542b9914:/tmp/product-details$ git show --stat | cat
commit 5b4a4e7fa4c702b4030caa97827691fac5421741
Author: Release Services Robot <[email protected]>
Date:   Wed Dec 11 13:43:11 2024 +0000

    Updating product details

 public/1.0/all.json                                |  27 ++
 public/1.0/devedition.json                         |   9 +
 public/1.0/firefox.json                            |  18 +
 .../1.0/firefox_history_development_releases.json  |   3 +-
 public/1.0/firefox_history_stability_releases.json |   3 +-
 public/1.0/firefox_primary_builds.json             | 412 ++++++++++-----------
 public/1.0/firefox_versions.json                   |   8 +-
 public/1.0/l10n/Firefox-133.0.3-build1.json        | 316 ++++++++++++++++
 public/1.0/l10n/Firefox-134.0b8-build1.json        | 316 ++++++++++++++++
 public/1.0/l10n/index.html                         |   2 +
 public/1.0/mobile_android.json                     |   9 +
 public/1.0/mobile_details.json                     |   2 +-
 public/1.0/mobile_versions.json                    |   2 +-
 13 files changed, 913 insertions(+), 214 deletions(-)

@@ -211,11 +211,19 @@ async def fetch_l10n_data(
session: aiohttp.ClientSession, release: shipit_api.common.models.Release, raise_on_failure: bool, use_cache: bool = True
) -> typing.Tuple[shipit_api.common.models.Release, typing.Optional[ReleaseL10ns]]:
# Fenix and some thunderbird on the betas don't have l10n in the repository
# XXX: for some reason we didn't generate l10n for devedition in old_product_details
Copy link
Contributor

Choose a reason for hiding this comment

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

Obviously this is not a new thing, but we should probably get this on file at the very least. I imagine we could either backfill (and start generating these in the future), or possibly just use the Firefox-xxxx.json files for DevEdition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed as #1588.

locales = ["en-US"]
if release in releases_l10n:
locales += releases_l10n[release].keys()
elif f"1.0/l10n/{release.name}.json" in old_product_details:
Copy link
Contributor

Choose a reason for hiding this comment

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

It's annoying that there's two places that we have to consult old_product_details :(. In some ideal world, releases_l10n would have combined the two data sources already, but I don't think that refactor makes sense in the immediate term. Maybe file for a future improvement, if you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed as #1587.

@jcristau jcristau merged commit cb45c55 into mozilla-releng:main Dec 11, 2024
6 checks passed
@jcristau jcristau deleted the bug1936479 branch December 11, 2024 14:19
bhearsum added a commit to bhearsum/shipit that referenced this pull request Dec 13, 2024
It looks like this broke in prod for DevEdition :(

https://mozilla.sentry.io/issues/6138643868/?alert_rule_id=14011861&alert_type=issue&notification_uuid=26c35ba9-1f19-46fc-98b1-28e22632153a&project=6262522&referrer=slack

```
ClickException: Too few firefox primary builds for FIREFOX_DEVEDITION
  File "aioamqp/protocol.py", line 312, in run
    await self.dispatch_frame()
  File "aioamqp/protocol.py", line 268, in dispatch_frame
    await channel.dispatch_frame(frame)
  File "aioamqp/channel.py", line 114, in dispatch_frame
    await methods[frame.name](frame)
  File "aioamqp/channel.py", line 546, in basic_deliver
    await callback(self, body, envelope, properties)
  File "/app/src/src/shipit_api/admin/worker.py", line 27, in rebuild_product_details_async
    await rebuild(flask.current_app.db.session, app_channel, git_repo_url, folder_in_repo, breakpoint_version)
  File "/app/src/src/shipit_api/admin/product_details.py", line 1266, in rebuild
    sanity_checks(product_details)
  File "/app/src/src/shipit_api/admin/product_details.py", line 1091, in sanity_checks
    sanity_check_firefox_builds(
  File "/app/src/src/shipit_api/admin/product_details.py", line 1063, in sanity_check_firefox_builds
    raise click.ClickException(f"Too few firefox primary builds for {version_key}")
```
@bhearsum
Copy link
Contributor

It looks like this broke in prod for DevEdition :(

https://mozilla.sentry.io/issues/6138643868/?alert_rule_id=14011861&alert_type=issue&notification_uuid=26c35ba9-1f19-46fc-98b1-28e22632153a&project=6262522&referrer=slack

ClickException: Too few firefox primary builds for FIREFOX_DEVEDITION
  File "aioamqp/protocol.py", line 312, in run
    await self.dispatch_frame()
  File "aioamqp/protocol.py", line 268, in dispatch_frame
    await channel.dispatch_frame(frame)
  File "aioamqp/channel.py", line 114, in dispatch_frame
    await methods[frame.name](frame)
  File "aioamqp/channel.py", line 546, in basic_deliver
    await callback(self, body, envelope, properties)
  File "/app/src/src/shipit_api/admin/worker.py", line 27, in rebuild_product_details_async
    await rebuild(flask.current_app.db.session, app_channel, git_repo_url, folder_in_repo, breakpoint_version)
  File "/app/src/src/shipit_api/admin/product_details.py", line 1266, in rebuild
    sanity_checks(product_details)
  File "/app/src/src/shipit_api/admin/product_details.py", line 1091, in sanity_checks
    sanity_check_firefox_builds(
  File "/app/src/src/shipit_api/admin/product_details.py", line 1063, in sanity_check_firefox_builds
    raise click.ClickException(f"Too few firefox primary builds for {version_key}")

I'm reverting this in #1590 for now.

bhearsum added a commit that referenced this pull request Dec 13, 2024
It looks like this broke in prod for DevEdition :(

https://mozilla.sentry.io/issues/6138643868/?alert_rule_id=14011861&alert_type=issue&notification_uuid=26c35ba9-1f19-46fc-98b1-28e22632153a&project=6262522&referrer=slack

```
ClickException: Too few firefox primary builds for FIREFOX_DEVEDITION
  File "aioamqp/protocol.py", line 312, in run
    await self.dispatch_frame()
  File "aioamqp/protocol.py", line 268, in dispatch_frame
    await channel.dispatch_frame(frame)
  File "aioamqp/channel.py", line 114, in dispatch_frame
    await methods[frame.name](frame)
  File "aioamqp/channel.py", line 546, in basic_deliver
    await callback(self, body, envelope, properties)
  File "/app/src/src/shipit_api/admin/worker.py", line 27, in rebuild_product_details_async
    await rebuild(flask.current_app.db.session, app_channel, git_repo_url, folder_in_repo, breakpoint_version)
  File "/app/src/src/shipit_api/admin/product_details.py", line 1266, in rebuild
    sanity_checks(product_details)
  File "/app/src/src/shipit_api/admin/product_details.py", line 1091, in sanity_checks
    sanity_check_firefox_builds(
  File "/app/src/src/shipit_api/admin/product_details.py", line 1063, in sanity_check_firefox_builds
    raise click.ClickException(f"Too few firefox primary builds for {version_key}")
```
@jcristau
Copy link
Contributor Author

I can reproduce #1586 (comment), if there's a devedition release without corresponding firefox release, as was the case for ~20 minutes on Friday (Devedition-134.0b10-build1 was marked as shipped at 16:40 UTC, Firefox-134.0b10-build1 at 16:59).
I think we should remove devedition from this sanity_check_firefox_builds function, since there's no devedition_primary_builds file, and firefox_primary_builds only has regular firefox beta.

@bhearsum
Copy link
Contributor

I can reproduce #1586 (comment), if there's a devedition release without corresponding firefox release, as was the case for ~20 minutes on Friday (Devedition-134.0b10-build1 was marked as shipped at 16:40 UTC, Firefox-134.0b10-build1 at 16:59). I think we should remove devedition from this sanity_check_firefox_builds function, since there's no devedition_primary_builds file, and firefox_primary_builds only has regular firefox beta.

That sounds reasonable to me; the check seems to have outlived whatever value it used to provide.

@jcristau
Copy link
Contributor Author

Looking at this some more... sanity_check_firefox_builds comes from mozilla/release-services#1987. devedition was then added to get_primary_builds in mozilla/release-services#2111. So it seems plausible that bedrock needs the FIREFOX_DEVEDITION version to show up in firefox_primary_builds.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product-details did not update with 133.0.1
2 participants