Skip to content

ci(size-diff): post comment when the artifact extracts flat (single app)#1555

Merged
onedr0p merged 1 commit into
mainfrom
ci/fix-size-diff-comment-layout
Jun 29, 2026
Merged

ci(size-diff): post comment when the artifact extracts flat (single app)#1555
onedr0p merged 1 commit into
mainfrom
ci/fix-size-diff-comment-layout

Conversation

@onedr0p

@onedr0p onedr0p commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Problem

The size-diff comment (added in #1553) never posts on single-app PRs — confirmed on #1554 (jackett) and #1440 (esphome). The Size Diff Comment workflow_run job ran, downloaded the artifact, and exited green having posted nothing.

Root cause

actions/download-artifact extracts a single matching artifact's files directly into the target path, but lands multiple artifacts in per-artifact subdirs (path/<artifact-name>/). The size-diff-<app> artifact contains app + body.md at its root, so for a single-app PR they end up directly in DIR:

$DIR/app
$DIR/body.md          # ← not $DIR/size-diff-jackett/...

The comment loop only iterated subdirectories (if (!isDirectory()) continue), so both files were skipped, nothing was posted, and — since no code path errored — the job stayed green and logged nothing. Multi-app PRs happened to work (download-artifact uses subdirs there to avoid app/body.md name collisions).

Verified the layout directly: the artifact's internal structure is app + body.md at the root, and the download step logs Starting download of artifact to: …/size-diff (no per-artifact subdir for the single match).

Fix

Iterate DIR itself plus its immediate subdirectories, so both extraction layouts work, and core.warning if nothing was posted so a silent miss can't recur. Tested locally against both layouts:

layout old loop new loop
flat (single artifact) [] [jackett]
subdirs (multiple artifacts) [jackett, sonarr] [jackett, sonarr]

Validation note

This is the workflow_run path that can only run from the default branch, so it's first exercised after this merges. Once merged, re-running #1440's Pull Request workflow (or the next release PR) will confirm the comment posts end-to-end.

actions/download-artifact extracts a SINGLE matching artifact's files
directly into the target dir, but lands MULTIPLE artifacts in per-artifact
subdirs. The comment loop only iterated subdirectories, so single-app PRs
(the common case — every release PR) had app/body.md sitting directly in DIR,
failed the isDirectory() filter, and the job went green having posted nothing
(observed on #1554 and #1440).

Iterate DIR itself plus its immediate subdirs so both layouts work, and warn
when nothing was posted so a silent miss can't recur.
@onedr0p onedr0p merged commit f0512c9 into main Jun 29, 2026
5 checks passed
@onedr0p onedr0p deleted the ci/fix-size-diff-comment-layout branch June 29, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant