Make a failed pr dispatch comment carry no ref time

Open Beginner friendly
#544 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
64/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions
Domain
ci-cd

Research direction

Start in .github/workflows/benchmark.yml at the comment job of the workflow_dispatch path and find where the <!-- elfuse-benchmark-ref-time: ... --> marker is built into each posted comment. Compare it with the #543 change in .github/workflows/bench-report.yml, which writes that marker only when measurements exist, and with the PR_TIME guard used when refusing to replace a comment. Done means the dispatch job writes the ref time only when report is set, leaving the incoming-side check intact.

Written by the indexing model from the issue text.

Description

Problem

The comment job of .github/workflows/benchmark.yml, for a workflow_dispatch run with pr, writes <!-- elfuse-benchmark-ref-time: ... --> into every comment it posts, including "The benchmark did not complete at this commit, so it has no measurements." Since #543, .github/workflows/bench-report.yml writes the ref time only into a comment that carries measurements. Both writers refuse to replace a comment whose ref time is later than their own. So the report of an earlier pull_request run replaces a "did not complete" comment that a later pull_request run left, but not one that a later pr dispatch left. For that to happen, the dispatch would have to fail (for example in a step before the measurement) and post its comment before the earlier run reports; that run's report is then dropped with the notice "Comment N reports a merge ref from ...". Found by reading daf19f0; not run.

The dispatch job does not have the case that made #543 change bench-report.yml: its if requires !cancelled(), so a dispatch run replaced while pending posts nothing.

Proposal

Write the ref time in the dispatch job only when report is set, and keep the PR_TIME check on the incoming side, so that both writers follow one rule: a comment with no measurements keeps out no report.

Alternatives

Keep the dispatch job as it is, on the ground that a later merge ref that failed matters more than an earlier one's measurements, and then say so in both writers' comments.

Origin

Follow-up from #543 (https://github.com/sysprog21/elfuse/pull/543).

Dominant language
C
Stars
287
Forks
33
Avg merge
2d 17h
Merged PRs (30d)
18

Getting set up

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 sysprog21/elfuse

All issues in sysprog21/elfuse

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.