mozilla-releng / mozilla-releng/scriptworker
verify_cot fails to validate pull requests on repos that are forks
@ahal is already working on this.
Since Apr 26, 2024.
- Dominant language
- Python
- Stars
- 5
- Forks
- 39
- Avg merge
- 4h 18m
- Merged PRs (30d)
- 6
Description
While testing some bitrisescript changes on staging-firefox-ios, @isabelrios discovered a CoT failure:
https://firefox-ci-tc.services.mozilla.com/tasks/C4i1LZAQS1iLhBbATtJBBw/runs/0/logs/public/logs/chain_of_trust.log
This is a json-e rendering error:
jsone.shared.InterpreterError: InterpreterError at template.tasks[0].repoUrl: infix: . expects objects
It happens because the .taskcluster.yml evaluates event.pull_request.head.repo.html_url (which is standard in all our .taskcluster.yml files), but the Github context that verfiy_cot resolves has:
pull_request:
head:
repo: None
I believe this is happening because staging-firefox-ios is a fork of firefox-ios, so it means we hit this condition:
https://github.com/mozilla-releng/scriptworker/blob/cd0aac0510f69386b28a375656b5cc070dc2fb7f/src/scriptworker/cot/verify.py#L1179
This causes us to use mozilla-mobile/firefox-ios as the head repository instead, and my theory is this causes the pull_request.head.repo to be None as the pull request in question doesn't exist over there.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.