Skip to content

Allow extra refs to be marked as optional in run-task#935

Open
Eijebong wants to merge 1 commit intotaskcluster:mainfrom
Eijebong:make-notes-optional
Open

Allow extra refs to be marked as optional in run-task#935
Eijebong wants to merge 1 commit intotaskcluster:mainfrom
Eijebong:make-notes-optional

Conversation

@Eijebong
Copy link
Copy Markdown
Contributor

@Eijebong Eijebong commented Apr 15, 2026

This will help preventing failures if a fork doesn't have any notes at refs/notes/decision-parameters. I chose to pay for the ls-remote time if an optional ref failed to fetch to avoid having to parse the stderr from git fetch which felt very fragile. It adds a potential ~1.5s to fetches per optional remote that is missing which isn't ideal, but I don't have anything better at this point in time. The new log message is slightly misleading since technically ls-remote might find one ref but not another and it'd be reported that both are missing but I don't want to have to ls-remote for each ref, adding 1.5s each time, to fix this.

@Eijebong Eijebong requested a review from a team as a code owner April 15, 2026 13:59
@Eijebong Eijebong requested a review from bhearsum April 15, 2026 13:59
Comment thread src/taskgraph/run-task/run-task
@Eijebong Eijebong force-pushed the make-notes-optional branch from 4d26abc to b644e55 Compare April 15, 2026 14:10
Comment on lines +763 to 767
for ref in extra_refs or []:
optional = ref.startswith("?")
if optional:
ref = ref[1:]
git_fetch(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid calling git_fetch once per ref?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so? Cause we cannot extract what ref failed to fetch, so we'd have to check them all after the fact

@Eijebong Eijebong force-pushed the make-notes-optional branch from b644e55 to 0c9f3b1 Compare April 15, 2026 14:14
This prevents failures if a fork doesn't have any notes at
`refs/notes/decision-parameters`. I chose to pay for the `ls-remote`
time if an optional ref failed to fetch to avoid having to parse the
stderr from git fetch which felt very fragile. It adds a potential ~1.5s
to fetches per optional remote that is missing which isn't ideal, but I
don't have anything better at this point in time. The new log message is
slightly misleading since technically ls-remote might find one ref but
not another and it'd be reported that both are missing but I don't want
to have to ls-remote for each ref, adding 1.5s each time, to fix this.
@Eijebong Eijebong force-pushed the make-notes-optional branch from 0c9f3b1 to 7031852 Compare April 15, 2026 14:16
@Eijebong
Copy link
Copy Markdown
Contributor Author

(I dropped the taskcluster.yml change and pushed empty notes to my fork to get CI green, I'll re-add the ? change in a followup and delete notes from my fork to test properly)


if extra_refs:
for ref in extra_refs or []:
optional = ref.startswith("?")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, I think I'd rather these just never fail, and if there's some use case where we absolutely need the extra ref fetched, then we can deal with it then

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.

3 participants