Skip to content

Read the releases with two flags gh refuses together (#88) - #359

Merged
iderex merged 2 commits into
masterfrom
ci/the-release-reading-cannot-use-two-flags-together
Sep 4, 2026
Merged

iderex merged 2 commits into
masterfrom
ci/the-release-reading-cannot-use-two-flags-together

Conversation

@iderex

@iderex iderex commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Refs #88

This finishes no issue, so it declares no relation. It repairs the check that landed in #358, which carries the third condition of #88 and does not close it.

What was wrong

channel-freshness.yml read this repository's releases with --paginate --slurp and --jq in one gh api call. Those cannot be combined, and the message is a usage dump rather than a comparison:

gh api "repos/Flowfin/jellyfin-plugin-metadata-sync/releases" --paginate --slurp --jq 'add'
the `--slurp` option is not supported with `--jq` or `--template`

How it was found

By dispatching the workflow once after #358 merged, rather than by reading the file. Run 33929205469:

gh run view 33929205469 --repo Flowfin/jellyfin-plugin-metadata-sync --json jobs \
  --jq '.jobs[].steps[] | "  \(.name) -> \(.conclusion)"'
  Set up job -> success
  Check out the comparison and the plugin manifest -> success
  The address read here is the address the readme gives an operator -> success
  Prove the comparison bites, in each direction -> success
  Read the releases this repository has published -> failure
  Read the catalogue as an operator's server reads it -> skipped
  Compare the catalogue with the releases -> skipped

The half that is worth reading is that the six fixture cases passed on the runner, so the comparison itself is good and it is the live reading that never happened. That is the shape a scheduled report fails in most quietly: it is red either way, and the reason is a flag rather than the channel.

The repair

gh api "repos/$GITHUB_REPOSITORY/releases" --paginate --slurp | jq 'add // []' > releases.json

Run against this repository rather than reasoned about:

gh api "repos/Flowfin/jellyfin-plugin-metadata-sync/releases" --paginate --slurp | jq 'add // []' > rel.json
jq 'length' rel.json
2
jq -r '.[] | "\(.tag_name) draft=\(.draft) pre=\(.prerelease)"' rel.json
0.1.1.0-stable draft=false pre=false
0.1.0.0-stable draft=false pre=false

// [] is there for the one case the comparison is meant to refuse with a reason: a repository with no release slurps to one empty page, add answers that as null, and the comparison is owed an array. Without it the exit-2 refusal that says "this repository has published no release" would be reached with a null on the way in.

What was not changed

The comparison script, its six fixture cases, and every other step. This is one line and the comment above it.

git diff --name-only origin/master...HEAD
.github/workflows/channel-freshness.yml

What is still not proved

That the workflow completes on a runner. The next dispatch after this merges is what shows it, and it will be red for the live reason recorded on #88 - the catalogue advertises 0.1.0.0 while 0.1.1.0 is published - rather than for a fault in the check. I will say which it was on #88 rather than leaving the two indistinguishable.

No second reader

This change has had no second reader. The runs above stand in place of one.

The step that reads this repository's releases passed `--paginate --slurp` and
`--jq` in one call. `gh api` refuses that pair, so the step exited 1 with a usage
message and the two steps after it were skipped:

    gh api "repos/Flowfin/jellyfin-plugin-metadata-sync/releases" --paginate --slurp --jq 'add'
    the `--slurp` option is not supported with `--jq` or `--template`

The pages are flattened after the call instead:

    gh api "repos/Flowfin/jellyfin-plugin-metadata-sync/releases" --paginate --slurp | jq 'add // []'

which returns the two releases this repository has published. `// []` is there
because a repository with no release slurps to one empty page and `add` answers
that as null, and the comparison is owed an array rather than a null in the one
case it is meant to refuse for a stated reason.

Found by dispatching the workflow once after it merged rather than by reading
it. The run is 33929205469: the proof step passed on the runner and the live
reading never happened, which is the shape a scheduled report fails in most
quietly - it goes red and the reason is a flag rather than the channel.

Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
@iderex iderex added bug Something isn't working ci labels Sep 4, 2026
@iderex iderex self-assigned this Sep 4, 2026
@iderex
iderex merged commit 0afffdd into master Sep 4, 2026
14 checks passed
@iderex
iderex deleted the ci/the-release-reading-cannot-use-two-flags-together branch September 4, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant