verify_cot fails to validate pull requests on repos that are forks

Open
#645 4 comments 0 reactions 1 assignee View on GitHub

@ahal is already working on this.

Since Apr 26, 2024.

Assessment

This issue has not been assessed yet.

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.

Dominant language
Python
Stars
5
Forks
39
Avg merge
4h 18m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla-releng/scriptworker

All issues in mozilla-releng/scriptworker

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.