Skip to content

CI: Re-pin linting to v0.6.0 and surface its new inputs - #61

Merged
tykeal merged 5 commits into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:feat/linting-v0.6.0
Oct 5, 2026
Merged

tykeal merged 5 commits into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:feat/linting-v0.6.0

Conversation

@ModeSevenIndustrialSolutions

Copy link
Copy Markdown
Member

Summary

Brings the deployed linting workflow up to the executor it should be calling. The pin sat at v0.4.2, two releases behind, so linting.yaml on main carried none of the fixes released since — and its documentation described limitations that had already been closed.

Four atomic commits:

Commit What
ec0e663 Re-pin to v0.6.0, correct the stale #143/#156 prose
bc8e8a2 Surface per_hook_runs
a1e04fd Surface commit_range
9a9d963 Record the measured Contents API ceiling — closes #53

The pin was the blocker

What v0.4.2 was missing:

Release Change
v0.5.0 refuses a hook no run can reach; runs a selection in one invocation; guards prek_version and config_sha256
v0.6.0 commit_range, so commit-msg hooks reach CI

The one that matters is the first. A task naming a hook at an unreachable stage used to collect a tick for it. Under the old pin, a repository with gitlint in ci.skip came back green having not run it — so auditing repositories for cleanliness against that pin would have been auditing against a check that did not yet mean what it appears to.

The documentation claimed otherwise before it was true; it now matches:

That holds with or without an exclusion in play, so a green check no longer depends on which inputs a caller happened to set.

The plan job's stage warning keeps its place with its scope narrowed rather than its text left to rot: it speaks for the run-all shape, which names no hooks and so gives the executor nothing to refuse.

Two new inputs

per_hook_runs is named as the executor names it rather than folded into split_hooks, because they divide different things:

divides
split_hooks a selection across matrix jobs
per_hook_runs the prek invocations inside one job

commit_range is how gitlint reaches CI. It is validated here as well as in the executor — the value reaches a command line in both, and neither should trust the other to have looked. Control characters first, since grep -qE ^...$ anchors per line; then one .. exactly; then each side held to [A-Za-z0-9][A-Za-z0-9._/~^-]* so a leading - cannot read as an option.

[abc123..def456]   accepted      [a..b..c]     REJECTED: takes one '..'
[main..HEAD]       accepted      [..b]         REJECTED: invalid revision
[v1.0.0..HEAD~2]   accepted      [-rf..HEAD]   REJECTED: invalid revision: -rf
[HEAD]             REJECTED      [a..b\nevil]  REJECTED: control characters

#53 — measured, and the premise was false

The issue suspected the Contents API stops returning base64 above 1,000,000 bytes while MAX_CONFIG_BYTES allows 1,048,576, leaving a window where the organisation fallback and config_url disagree. I said then it needed measuring rather than assuming. Measured, against real files either side of both candidates:

    995,588  base64
  1,013,732  base64      <- above 1,000,000, so that boundary is wrong
  1,039,256  base64
  1,049,481  encoding 'none', content empty

The cut sits between 1,039,256 and 1,049,481, which brackets 1,048,576 alone — the value MAX_CONFIG_BYTES already carries. The two agree; there was nothing to fix. Recorded at the constant so the next reader meeting "1 MB" in the API docs need not re-derive which megabyte it means.

#52 is not closed here, deliberately

Investigating it turned up something that reframes the issue: every url-task URL arrives as a workflow input already — inputs.config_url, or inside inputs.plan. The matrix is a second copy of a value the run already holds.

So removing it from the matrix is defence in depth, not closure. Closing it properly means either refusing credential-bearing URLs outright, or the artifact redesign the issue describes — and a partial fix that looks like closure would be worse than the documented limitation that stands today. I have added the analysis to #52 rather than shipping half of it.

Validation

  • actionlint — clean
  • prek run --all-files — clean
  • 171 + 87 fixtures pass
  • markdown-table-fixer — clean
  • zizmor --persona=auditor — no findings (1 ignored)

After this

standalone-linting-action has no open issues. In this repository, #52 stays open with its analysis sharpened, and #23 (Gerrit required-verify) is unrelated to linting.

The pin sat at v0.4.2, two releases behind, so the deployed workflow
carried none of the fixes released since. The one that matters is
v0.5.0: a task naming a hook no run can reach used to collect a tick
for it, and the executor now refuses the run and names the stage.

That closes the gap this pin's own comment described as open. The
refusal holds with or without an exclusion in play, so a green check
no longer depends on which inputs a caller happened to set -- which
is what the documentation claimed before it was true.

The plan job's stage warning keeps its place, with its scope
narrowed rather than its text left to rot: it speaks for the run-all
shape, which names no hooks and so gives the executor nothing to
refuse. Where a task does name hooks, the executor decides, and it
asks prek rather than reading the configuration, so the remote
manifest blind spot does not reach it.

v0.6.0 also adds commit_range, which this workflow does not yet
forward. Hooks at the commit-msg stage therefore still do not run
through it; a later commit on this branch surfaces the input.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
The executor gained per_hook_runs in v0.5.0 and this workflow had no
way to ask for it, so a caller wanting one summary row per hook had
to call the action directly and give up the plan job.

Named as the executor names it rather than folded into split_hooks,
because the two divide different things and a shared name would read
as one knob: split_hooks divides a selection across matrix JOBS,
per_hook_runs divides the prek invocations inside one job. They
compose, and the documentation sets them side by side.

Rendered to a string explicitly at the call site. The input arrives
here as a true boolean and the executor takes a string, so letting
the expression stringify it would leave the conversion implicit at
the one place a reader checks it.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Hooks at the commit-msg stage -- gitlint being the one that matters
-- could not run through this workflow. The executor gained
commit_range in v0.6.0 and nothing forwarded it, so a repository
declaring gitlint had the hook refused as unreachable with no way to
ask for it.

Setting it runs the selected hooks at the commit-msg stage as well,
once per commit in the range. The executor fetches full history for
it, and refuses a range whose endpoints are missing, whose ends reach
a shallow boundary, or that selects no commits -- linting part of a
range would be the silent green under another name.

Validated here as well as in the executor, because the value reaches
a command line in both and neither should trust the other to have
looked. Control characters first, since 'grep -qE ^...$' anchors per
line; then one '..' exactly, and each side held to
[A-Za-z0-9][A-Za-z0-9._/~^-]* so a leading '-' cannot read as an
option.

The example in the input description spells the range out in prose
rather than as an expression. actionlint parses one wherever it
appears, a description included, and rejects a context unavailable
at that point.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
The organisation fallback reads its file through the GitHub Contents
API, which stops returning base64 above a limit documented as '1 MB'.
That could have meant 1,000,000, in which case a configuration
between there and MAX_CONFIG_BYTES would be refused through the
fallback while the identical bytes were accepted through config_url.

Measured against real files either side of both candidates:

    995,588  base64
  1,013,732  base64      (above 1,000,000)
  1,039,256  base64
  1,049,481  encoding 'none', content empty

So the cut sits between 1,039,256 and 1,049,481, which brackets
1,048,576 alone -- the value MAX_CONFIG_BYTES already carries. The
two agree, and there is nothing to fix.

Recorded at the constant rather than in the issue alone, so the next
reader meeting '1 MB' in the API documentation does not have to
re-derive which megabyte it means.

Closes lfreleng-actions#53

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>

This comment was marked as resolved.

One dedicated commit for the round, since the findings span all four
commits on this branch and amending each would mean rewriting signed
history four times.

The planner ignored commit_range. Its stage sets were fixed at
{pre-commit} and {pre-commit, manual}, so a configuration declaring
gitlint still drew 'this run does not reach' even with the range set
and the executor about to run the hook -- a warning and a refusal
disagreeing about one hook. The range now reaches the resolver and
joins both sets, mirroring the executor's own rule rather than
restating it loosely. Fixtures cover both task shapes, since one set
gaining commit-msg and not the other leaves half the bug.

The commit_range grammar moves into an extracted function. It was an
inline block in a 'run:' step, which no fixture in this repository
can reach, and the value is security-sensitive on both sides of the
call. Twenty-one table-driven cases: the shapes a caller legitimately
passes, both option-shaped sides, shell metacharacters, and control
characters. One of them corrected my own expectation -- 'a...b' is
refused as a bad revision rather than as a duplicate separator, and
the fixture now records which.

per_hook_runs no longer promises what it cannot give. Two shapes
ignore it: a run-all task has no selection to divide, and the
commit-msg stage runs once per commit whatever it says. The input
description, the README and docs/linting.md each said otherwise.

The consumer example still told readers that naming a commit-msg
hook buys an unearned green check. It fails the run now, and
commit_range is the way to run one, so the template says that and
lists both new inputs.

The size-ceiling note claimed more than the samples support. They
disprove 1,000,000 and bracket the cut to 1,039,257..1,049,480; no
public file could be found inside that window, so 1,048,576 is an
inference from the bracket rather than a measurement. Recorded as
such, with the residual disagreement bounded at ~9 KiB.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ModeSevenIndustrialSolutions added a commit that referenced this pull request Oct 5, 2026
Advance every pinned action and reusable-workflow call to the commit
of its latest release, and move the harden-runner-block-action
allow-list pins to lfreleng-actions/.github v0.16.4.

The allow-list at v0.16.4 is identical to the head of .github main.
Pinning the tagged commit keeps the version comment truthful and
satisfies gha-workflow-linter's release-based staleness check.

Workflow pins were advanced by gha-workflow-linter honouring the
repository's seven-day Dependabot cooldown; nothing newer was held
back. The examples/ callers sit outside the linter's discovery, so
their real pins were moved by hand to the same targets. The all-zero
REPLACE placeholders are left for callers to fill in.

linting.yaml and examples/linting/github.yaml are deliberately left
alone: open PR #61 rewrites both, and touching them here would
force a merge conflict on one PR or the other.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
@tykeal
tykeal merged commit 0ed9c16 into lfreleng-actions:main Oct 5, 2026
19 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the feat/linting-v0.6.0 branch October 7, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI CI and tests updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: org fallback size limit may disagree with config_url

4 participants