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

run-task sometimes fails to check out git repositories when base_ref is set #380

Open
bhearsum opened this issue Dec 5, 2023 · 0 comments

Comments

@bhearsum
Copy link
Contributor

bhearsum commented Dec 5, 2023

This can happen when base_ref is set to a branch like refs/heads/test, we end up with errors like:

[taskcluster 2023-12-04 20:41:36.381Z] === Task Starting ===
[setup 2023-12-04T20:41:38.720Z] run-task started in /
[vcs 2023-12-04T20:41:38.722Z] WARNING: vcs checkout path (/builds/worker/checkouts/src) not in cache or volume; performance will likely suffer
[setup 2023-12-04T20:41:38.722Z] running as worker:worker
[vcs 2023-12-04T20:41:38.722Z] executing ['git', 'clone', 'https://github.com/mozilla/firefox-translations-training', '/builds/worker/checkouts/src']
[vcs 2023-12-04T20:41:38.725Z] Cloning into '/builds/worker/checkouts/src'...
[vcs 2023-12-04T20:41:39.580Z] executing ['git', 'fetch', 'origin', 'refs/heads/train-en-ca']
[vcs 2023-12-04T20:41:39.776Z] From https://github.com/mozilla/firefox-translations-training
[vcs 2023-12-04T20:41:39.776Z]  * branch            train-en-ca -> FETCH_HEAD
[vcs 2023-12-04T20:41:39.783Z] executing ['git', 'checkout', 'refs/heads/train-en-ca']
[vcs 2023-12-04T20:41:39.786Z] error: pathspec 'refs/heads/train-en-ca' did not match any file(s) known to git
[vcs 2023-12-04T20:41:41.789Z] executing ['git', 'checkout', 'refs/heads/train-en-ca']
[vcs 2023-12-04T20:41:41.792Z] error: pathspec 'refs/heads/train-en-ca' did not match any file(s) known to git
[vcs 2023-12-04T20:41:45.796Z] executing ['git', 'checkout', 'refs/heads/train-en-ca']
[vcs 2023-12-04T20:41:45.800Z] error: pathspec 'refs/heads/train-en-ca' did not match any file(s) known to git

The known workaround at the moment is to shorten the base_ref to only include the branch name, eg: with something like:

             short_base_ref:
                  $if: 'base_ref[:11] == "refs/heads/"'
                  then: {$eval: 'base_ref[11:]'}
                  else: ${base_ref}
bhearsum added a commit to bhearsum/firefox-translations-training that referenced this issue Dec 5, 2023
…itory

This fixes a regression caused by mozilla#276 that has caused decision tasks to fail for non `main` branches in this repository.

The "fix" is to refer to these branches by their short name (rather than `refs/heads/foo`). (This is not a great fix...but it's what we have to do to work around taskcluster/taskgraph#380 for now.)
bhearsum added a commit to mozilla/firefox-translations-training that referenced this issue Dec 5, 2023
…itory (#287)

This fixes a regression caused by #276 that has caused decision tasks to fail for non `main` branches in this repository.

The "fix" is to refer to these branches by their short name (rather than `refs/heads/foo`). (This is not a great fix...but it's what we have to do to work around taskcluster/taskgraph#380 for now.)
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

No branches or pull requests

1 participant