taskcluster / taskgraph

Generates task dependency graphs for Taskcluster CI
Mozilla Public License 2.0
15 stars 41 forks source link

cookiecutter .taskcluster.yml for github doesn't work for pushes to non-main branches #242

Open bhearsum opened 1 year ago

bhearsum commented 1 year ago

The cookiecutter file sets base_ref and base_rev. This puts us into this block of run-task which ultimately runs a command like: git fetch origin refs/heads/dev-enable-more-branches - which fails, because only the main branch of a repository has an entry in refs/heads. Anywhere that I've found that has pushes to non-main branches ends up omitting these parameters altogether, eg: Mozilla VPN.

Full log of a failed decision task included for completeness:

[vcs 2023-05-15T19:57:56.490Z] executing ['git', 'clone', 'https://github.com/mozilla-releng/staging-firefox-translations-training', '/builds/worker/checkouts/src']
[vcs 2023-05-15T19:57:56.493Z] Cloning into '/builds/worker/checkouts/src'...
[vcs 2023-05-15T19:57:56.886Z] executing ['git', 'fetch', 'origin', 'refs/heads/dev-enable-more-branches']
[vcs 2023-05-15T19:57:57.031Z] From https://github.com/mozilla-releng/staging-firefox-translations-training
[vcs 2023-05-15T19:57:57.031Z]  * branch            dev-enable-more-branches -> FETCH_HEAD
[vcs 2023-05-15T19:57:57.035Z] executing ['git', 'checkout', 'refs/heads/dev-enable-more-branches']
[vcs 2023-05-15T19:57:57.038Z] error: pathspec 'refs/heads/dev-enable-more-branches' did not match any file(s) known to git
jcristau commented 1 year ago

Is the issue here that we should be passing --base-ref=dev-enabled-more-branches instead of --base-ref=refs/heads/dev-enable-more-branches?

bhearsum commented 1 year ago

Yeah, that's another possible solution. run-task might be able to cope with the scenario better as well. (I haven't given this too much thought - just wanted to get it on file.)