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

feat: translations integration tests #210

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bhearsum
Copy link
Contributor

@bhearsum bhearsum commented Dec 10, 2024

This adds support for running the translations training pipeline as part of integration tests. The first two commits, which add support for fetching upstream tasks that didn't run as part of a decision task and support for rewriting dependencies to the yet-to-be-scheduled tasks are the interesting parts. The other few commits are pretty boring, and simply fix a minor bug and enable the translations tests.

Note that these depends on #228, a yet to be opened PR in https://github.com/mozilla/translations to add a pipeline cronjob. It's currently running against the staging repository and working well though.

@bhearsum
Copy link
Contributor Author

/taskcluster integration

1 similar comment
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 1533737 to 7ed60d4 Compare December 10, 2024 17:43
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 4b3955e to 772cbc8 Compare December 10, 2024 17:46
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from ae81007 to a00d42d Compare December 10, 2024 17:52
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 266add0 to b1c9bd2 Compare December 10, 2024 17:55
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from e290224 to 797676f Compare December 10, 2024 21:39
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 797676f to f86a21c Compare December 10, 2024 21:43
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from f86a21c to 2b31466 Compare December 12, 2024 15:53
@bhearsum
Copy link
Contributor Author

/taskcluster integration

2 similar comments
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 2b31466 to ee36134 Compare December 12, 2024 16:58
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from aa6e1da to df10b2b Compare December 12, 2024 17:16
@bhearsum
Copy link
Contributor Author

/taskcluster integration

bhearsum added a commit to bhearsum/fxci-config that referenced this pull request Dec 12, 2024
The old version is causing issues in mozilla-releng#210, because `get_ancestors` is not properly memoized.
bhearsum added a commit to bhearsum/fxci-config that referenced this pull request Dec 12, 2024
The old version is causing issues in mozilla-releng#210, because `get_ancestors` is not properly memoized.
@bhearsum bhearsum force-pushed the translations-integration-cron branch 2 times, most recently from 347f64d to 037b86d Compare December 20, 2024 17:43
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 037b86d to 65a4e01 Compare December 20, 2024 18:01
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 65a4e01 to 3df9d12 Compare December 20, 2024 18:04
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 3df9d12 to b62891a Compare December 20, 2024 18:46
@bhearsum
Copy link
Contributor Author

@ahal - this is ready for review again, but I'm going to leave it in Draft until I'm able to update the new kind entries to point at production. I've fixed the things you noted, but I also want to call attention to the most recent two commits, which are workarounds for things that came up when retesting this.

I have integration tests running in https://stage.taskcluster.nonprod.cloudops.mozgcp.net/tasks/groups/Vb5IURGhS5mLQy5np8IOAg (the only change between what that's running from and the latest is some updates to comments and commit messages).

@bhearsum bhearsum requested a review from ahal December 20, 2024 18:58
@bhearsum bhearsum force-pushed the translations-integration-cron branch 2 times, most recently from 498ab38 to d2ab427 Compare January 6, 2025 18:18
@bhearsum
Copy link
Contributor Author

bhearsum commented Jan 6, 2025

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from d2ab427 to b2f9a79 Compare January 6, 2025 18:28
@bhearsum
Copy link
Contributor Author

bhearsum commented Jan 6, 2025

/taskcluster integration

@bhearsum bhearsum marked this pull request as ready for review January 6, 2025 18:50
@bhearsum
Copy link
Contributor Author

bhearsum commented Jan 6, 2025

@ahal - this is ready for review again, but I'm going to leave it in Draft until I'm able to update the new kind entries to point at production. I've fixed the things you noted, but I also want to call attention to the most recent two commits, which are workarounds for things that came up when retesting this.

I have integration tests running in https://stage.taskcluster.nonprod.cloudops.mozgcp.net/tasks/groups/Vb5IURGhS5mLQy5np8IOAg (the only change between what that's running from and the latest is some updates to comments and commit messages).

I've updated to point at production, and a fresh round of integration tests are running in https://stage.taskcluster.nonprod.cloudops.mozgcp.net/tasks/groups/WQwObYW7RmOWREX_YUPpXQ. Nothing notable has changed since I wrote the quoted comment and now.

@bhearsum bhearsum force-pushed the translations-integration-cron branch from b2f9a79 to 94d3f2c Compare January 10, 2025 14:41
@bhearsum
Copy link
Contributor Author

/taskcluster integration

There's a lot here, but the essence of this is using `get_ancestors` to find tasks that are upstream of those in `task-graph.json` that we should also rerun in staging. This necessitates some massaging of the task definitions we receive from `get_ancestors` to get them in a similar form, but is other straightforward and unremarkable.

Note that the massaging is done in `util/integration.py` to centralize it, and make the return value consistent regardless of where the tasks came from.
…egration tests

This ensures that any tasks which will be run in the staging cluster that are upstream of other tasks will be referred to correctly in the downstream tasks.
`attrmatch` will always return true if `kwargs` is empty; therefore we can't call it unless we have excludes, otherwise we'll reject all tasks.
This came up during some additional testing of translations integration tests where the deadline of the `all-pipeline` task was set further in the future than the staging cluster allows. Another commit in this PR already ensures that datestamps are approriate for any ancestor tasks found - there's no harm in doing the same for tasks that come from `task-graph.json`. (Arguably, it's even a feature that we lower the expiration time, as these tasks outlive their usefulness very quickly.)
This might be the most hacky thing we're doing here so far, but it's necessary for translations integration tests, where cached ancestor tasks will have a `REV` that doesn't match the `REF`, leading to errors such as:
```
[vcs 2024-12-20T16:35:08.992Z] executing ['git', 'config', '--global', '--add', 'safe.directory', '/builds/worker/checkouts/vcs']
[vcs 2024-12-20T16:35:08.994Z] executing ['git', 'clone', 'https://github.com/mozilla-releng/staging-firefox-translations-training', '/builds/worker/checkouts/vcs']
[vcs 2024-12-20T16:35:08.995Z] Cloning into '/builds/worker/checkouts/vcs'...
[vcs 2024-12-20T16:35:10.747Z] executing ['git', 'fetch', '--tags', '--force', 'https://github.com/mozilla-releng/staging-firefox-translations-training', 'refs/heads/main']
[vcs 2024-12-20T16:35:10.949Z] From https://github.com/mozilla-releng/staging-firefox-translations-training
[vcs 2024-12-20T16:35:10.949Z]  * branch            main       -> FETCH_HEAD
[vcs 2024-12-20T16:35:10.955Z] executing ['git', 'fetch', '--no-tags', 'https://github.com/mozilla-releng/staging-firefox-translations-training', 'refs/heads/main']
[vcs 2024-12-20T16:35:11.128Z] From https://github.com/mozilla-releng/staging-firefox-translations-training
[vcs 2024-12-20T16:35:11.128Z]  * branch            main       -> FETCH_HEAD
[vcs 2024-12-20T16:35:11.133Z] executing ['git', 'checkout', '-f', '-B', 'refs/heads/main', '876ad1a2de046271a45c979551c8650e5e1b75a2']
[vcs 2024-12-20T16:35:11.135Z] fatal: reference is not a tree: 876ad1a2de046271a45c979551c8650e5e1b75a2
```

Removing the `REV` will cause the `REF` to be used without issues:
```
[vcs 2024-12-20T18:15:48.936Z] executing ['git', 'config', '--global', '--add', 'safe.directory', '/builds/worker/checkouts/vcs']
[vcs 2024-12-20T18:15:48.938Z] executing ['git', 'clone', 'https://github.com/mozilla-releng/staging-firefox-translations-training', '/builds/worker/checkouts/vcs']
[vcs 2024-12-20T18:15:48.939Z] Cloning into '/builds/worker/checkouts/vcs'...
[vcs 2024-12-20T18:15:50.544Z] executing ['git', 'fetch', '--tags', '--force', 'https://github.com/mozilla-releng/staging-firefox-translations-training', 'refs/heads/main']
[vcs 2024-12-20T18:15:50.758Z] From https://github.com/mozilla-releng/staging-firefox-translations-training
[vcs 2024-12-20T18:15:50.758Z]  * branch            main       -> FETCH_HEAD
[vcs 2024-12-20T18:15:50.763Z] executing ['git', 'fetch', '--no-tags', 'https://github.com/mozilla-releng/staging-firefox-translations-training', 'refs/heads/main']
[vcs 2024-12-20T18:15:50.926Z] From https://github.com/mozilla-releng/staging-firefox-translations-training
[vcs 2024-12-20T18:15:50.926Z]  * branch            main       -> FETCH_HEAD
[vcs 2024-12-20T18:15:50.931Z] executing ['git', 'checkout', '-f', '-B', 'refs/heads/main', 'FETCH_HEAD']
[vcs 2024-12-20T18:15:51.929Z] Switched to a new branch 'refs/heads/main'
```
@bhearsum bhearsum force-pushed the translations-integration-cron branch from 94d3f2c to da526ed Compare January 10, 2025 21:11
@bhearsum
Copy link
Contributor Author

/taskcluster integration

1 similar comment
@bhearsum
Copy link
Contributor Author

/taskcluster integration

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.

2 participants