Skip to content

ci: handle missing comment artifact in GnuComment - #14657

Merged
sylvestre merged 1 commit into
uutils:mainfrom
krosci:fix/ci-gnucomment-artifact
Sep 18, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
krosci:fix/ci-gnucomment-artifact

Conversation

@krosci

@krosci krosci commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

When GnuTests fails before producing the comment artifact, GnuComment crashes attempting to access properties of undefined. This adds a check for the artifact before downloading and unzips only if present.

@krosci

krosci commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@cakebaker Could you take a look at it? Thanks!

@xtqqczze

Copy link
Copy Markdown
Contributor

Right, I assume this is the error that this PR is fixing:

TypeError: Cannot read properties of undefined (reading 'id')
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v9/dist/index.js:64949:16), <anonymous>:17:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async main (/home/runner/work/_actions/actions/github-script/v9/dist/index.js:65100:20)
Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'id')

Thanks for taking care of this! It would be really nice to no longer have that workflow showing up in red on the GitHub Actions dashboard.

return artifact.name == "comment"
})[0];
if (!matchArtifact) {
core.info("No comment artifact found; skipping.");

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.

Should we explain here that the it was likely because the workflow that was expected to produce it failed?

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.

Updated the log message to make it explicit that the artifact is likely missing because GnuTests failed or was cancelled.

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.

On second thoughts, would it make more sense to only run this workflow if the previous workflow succeeded, i.e.:

if: ${{ github.event.workflow_run.conclusion == 'success' }}

https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow

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 we should restrict it to conclusion == 'success'. When a PR introduces GNU test failures or regressions, GnuTests intentionally exits with code 1 (failure), but it uploads the comment artifact via if: success() || failure() so GnuComment can still report the diff to the PR. If we require success, we wouldn't get comments on failing runs where the report is most needed.

The artifact is only missing when GnuTests fails early before reaching the comparison step (or is cancelled), which is why checking if (!matchArtifact) matches SizeComment and gracefully handles that case.

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.

You're absolutely right, although we can at least exclude cancelled workflows by adding:

if: |
  github.event.workflow_run.conclusion == 'success' ||
  github.event.workflow_run.conclusion == 'failure'

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.

Makes sense! Added the condition to ensure we only trigger when the workflow conclusion is
either success or failure.

Comment thread .github/workflows/GnuComment.yml Outdated
return artifact.name == "comment"
})[0];
if (!matchArtifact) {
core.info("No 'comment' artifact found (likely because GnuTests failed or was cancelled); skipping.");

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.

you can update this comment now we know the conclusion could not have been "cancelled"

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.

Updated! Removed the mention of cancelled runs from the log message.

Comment thread .github/workflows/GnuComment.yml Outdated
@xtqqczze

Copy link
Copy Markdown
Contributor

LGTM, thanks!

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/misc/write-errors was skipped on 'main' but is now failing.

@krosci

krosci commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

From 18 failed jobs to 1.

@krosci
krosci requested a review from xtqqczze September 17, 2026 22:23
@xtqqczze

This comment was marked as outdated.

@krosci

krosci commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

cc @sylvestre

Comment thread .github/workflows/GnuComment.yml Outdated
@krosci
krosci force-pushed the fix/ci-gnucomment-artifact branch from f0a83b8 to a93777a Compare September 18, 2026 10:46
@krosci
krosci force-pushed the fix/ci-gnucomment-artifact branch from a93777a to d448100 Compare September 18, 2026 10:51
@sylvestre
sylvestre merged commit 41c3451 into uutils:main Sep 18, 2026
97 checks passed
@krosci
krosci deleted the fix/ci-gnucomment-artifact branch September 18, 2026 12:20
@xtqqczze

Copy link
Copy Markdown
Contributor

@krosci Since this change could be tested per se, please keep an eye on the Actions dashboard to make sure everything runs as expected.

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