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

Draft
wants to merge 9 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
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 84ac1f8 to 2e835cf Compare January 21, 2025 01:30
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from 2e835cf to f6766e8 Compare January 21, 2025 15:03
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum marked this pull request as draft January 22, 2025 01:17
@bhearsum
Copy link
Contributor Author

(Whoops, should've moved this back to draft awhile ago. Some tasks that expired uncovered some edge cases here that are proving tricky to work through.)

@bhearsum bhearsum force-pushed the translations-integration-cron branch from f6766e8 to 69680e9 Compare January 22, 2025 02:01
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from f2ac6de to f542db5 Compare January 22, 2025 02:21
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from b1a3d68 to 2367f90 Compare January 22, 2025 02:31
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch from cf5dc54 to 544c3f6 Compare January 22, 2025 15:35
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum bhearsum force-pushed the translations-integration-cron branch 2 times, most recently from b093a37 to d6d7273 Compare January 24, 2025 16:08
@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.
…xci-artifact tasks

This work uncovered a small bug in the `firefoxci_artifact` transform where fetches would not be mirrored for tasks without a docker image; this is being fixed here as well.
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 d6d7273 to 21cf563 Compare January 24, 2025 16:34
@bhearsum
Copy link
Contributor Author

/taskcluster integration

@bhearsum
Copy link
Contributor Author

Latest testing is having two issues:

I'm going to try this all again on Monday.

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