Skip to content

Feat: Add the ci-management-verify workflow - #108

Merged
ModeSevenIndustrialSolutions merged 5 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-106
Nov 1, 2026
Merged

ModeSevenIndustrialSolutions merged 5 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-106

Conversation

@lf-releng-code-monkey-bot

@lf-releng-code-monkey-bot lf-releng-code-monkey-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #106

Authored by an AI agent; human review required
Command Exit
bash tests/test-ci-management-verify-plan.sh 0
bash tests/test-tox-verify-plan.sh 0
prek run --files .github/workflows/ci-management-verify.yaml tests/test-ci-management-verify-plan.sh docs/ci-management-verify.md 0
uvx zizmor --offline --persona auditor .github/workflows/ci-management-verify.yaml .github/workflows/ci-management-verify-action.yaml examples/ci-management/gerrit-ci-management-verify.yaml 0
aislop scan --base 716174e950e70d185093f33ef34fdcb76e5616e4 --json 0
git log --raw --format=%h 716174e950e70d185093f33ef34fdcb76e5616e4..HEAD 0

The github-code-monkey-bot workflow opened this pull request.
Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds; a maintainer must act on any finding that remains after that, and reviews every round before merge.

Round 2 of revision, on its base.


What this does

Adds .github/workflows/ci-management-verify.yaml, the reusable verify workflow for ci-management repositories (#106, design in #77). It replaces gerrit-ci-management-verify.yaml, gerrit-compose-ci-management-verify.yaml and composed-ci-management-verify.yaml in lfit/releng-reusable-workflows.

[gerrit] -> plan -> Lint
                 -> JJB
  • gerrit (Gerrit mode only) resolves the change ref with change-isolation.yaml's script.
  • plan validates path_prefix, jjb_path and the hardening inputs. It fails closed and does not check anything out.
  • Lint runs every hook in the change's .pre-commit-config.yaml through lfreleng-actions/standalone-linting-action v0.10.1 (a00b2feb…). It passes no_checkout: 'true' and run_all_hooks: 'true', and passes no github_token. In Gerrit mode it also passes cache_hooks: 'false', which turns off both prek's cache and setup-uv's cache.
  • JJB checks the change out with submodules and runs lfreleng-actions/jjb-action v0.0.1 in test mode.
  • Credentials: both legs remove the persisted checkout credentials before running the change's code. That covers every submodule's git directory as well as the superproject. tox-verify.yaml uses the same script.

Commits:

  1. The workflow, its prek hook, and tests/test-ci-management-verify-plan.sh (offline fixtures, including a submodule fixture built at run time).
  2. The ci-management-verify-action.yaml self-caller, its fixture under tests/fixtures/ci-management/, and the actionlint ignore.
  3. examples/ci-management/gerrit-ci-management-verify.yaml and its zizmor entries.
  4. docs/ci-management-verify.md, including the migration section.
  5. README updates.

This round (2)

  • uv cache poisoning (thread): fixed. The pin moves from standalone-linting-action v0.10.0 to v0.10.1 (a00b2febdcb6da5332f77e829dfdc131a91b8fce, verified against the tag). In that release cache_hooks: 'false' also turns off setup-uv's cache (Fix: Make cache_hooks stop the uv cache too standalone-linting-action#205). The existing Gerrit-mode value therefore covers the finding with no other change. The workflow comment, the fixture-script comment and the cache paragraph in docs/ci-management-verify.md now say that both caches are off. This was amended into commit 1 and commit 4.
  • Linked global-jjb fixture (thread): answered in round 1 and left open for a maintainer, as instructed. The publisher cannot commit a symlink. jjb-action's own testing.yaml covers the linked layout.

Checks run

  • bash tests/test-ci-management-verify-plan.sh: 70 fixtures passed.
  • bash tests/test-tox-verify-plan.sh: 77 fixtures passed.
  • prek run --files on the changed files passed, and gitlint passed on the amended commits.
  • zizmor --offline --persona auditor on the workflow, the self-caller and the example: no findings.
  • aislop scan --base 716174e: no diagnostics.
  • Every harden-runner@ pin is 46b06cea… (v2.22.3).

Still to check

  • These could not run here: Gerrit mode, a real submodule fetch on the Gerrit path, and a real vote. The self-caller exercises GitHub mode only.
  • prek runs a configuration's hooks from the git top level. The self-test's Lint leg therefore runs the fixture's hooks over this whole repository, not only the fixture.
  • The self-test does not cover the linked global-jjb layout (see the open thread).

This comment was marked as outdated.

This comment was marked as outdated.

lf-releng-code-monkey-bot Bot and others added 5 commits November 1, 2026 20:04
Add a reusable workflow that verifies a ci-management change: a Lint
leg runs every hook in the change's pre-commit configuration through
standalone-linting-action, and a JJB leg checks the change out with
its submodules and generates the jobs with jjb-action in test mode.
It replaces the three ci-management verify workflows in
lfit/releng-reusable-workflows, follows tox-verify.yaml's shape, and
casts no vote.

Both legs run the change's own code. actions/checkout v7.0.1 points
every submodule's config at the same persisted credentials file, so
the credential removal now walks each git directory under
.git/modules as well as the superproject, and its final check reads
each one's effective configuration. tox-verify.yaml takes the same
script, and the new fixtures fail when the copies drift.

A Gerrit verify is dispatched on the default branch, whose cache
scope trusted runs share, so the Lint leg pins
standalone-linting-action v0.10.1 and passes cache_hooks 'false' in
Gerrit mode: the change's hooks can then neither restore nor save
prek's hook environments or setup-uv's cache. GitHub mode keeps the
default.

tests/test-ci-management-verify-plan.sh extracts the Gerrit, plan and
credential-removal scripts and runs them offline, against a
submodule fixture it builds at run time, and fails if the Lint leg's
cache_hooks stops being 'false' in Gerrit mode; a prek hook runs it.

Review round 1 (Copilot): Gerrit runs could poison the shared prek
cache later restored by trusted runs. Fixed with cache_hooks as
above, and a fixture guards it.

Review round 2 (Copilot): v0.10.0's cache_hooks did not reach the
action's setup-uv step, whose cache stays on for workflow_dispatch,
so a Gerrit change could still poison the default branch's uv cache.
Fixed by pinning v0.10.1, where cache_hooks 'false' turns setup-uv's
cache off too; the existing Gerrit-mode value needs no change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Call the reusable ci-management verify workflow from this
repository's pull requests, in block mode, against a fixture shaped
like a consumer: a JJB tree holding one job template and one
project, a sibling global-jjb/, and a pre-commit configuration with
check-yaml and the actionlint hook every consumer is asked to add.

The publisher cannot commit a symlink, and the reusable's JJB leg
cannot create one, so the fixture carries no jjb/global-jjb link and
the project uses its own template. jjb-action's own suite covers the
linked layout. prek runs a configuration's hooks from the git top
level, so the Lint leg runs the fixture's hooks across this whole
repository.

Add the actionlint ignore for the '$/' call, as for the other
self-callers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Add examples/ci-management/gerrit-ci-management-verify.yaml, built
from the Gerrit tox verify example: visibility gate, vote clearing,
the reusable call, and the vote. Its header states that a copy must
keep 'gerrit' and 'verify' in its file name and not 'required', or
gerrit_to_platform will not dispatch it. There is no GitHub example:
every consumer runs on Gerrit.

Exempt the placeholder SHA and the voting key's secret references in
.github/zizmor.yml, line by line, as for the other examples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Add docs/ci-management-verify.md: the job graph, the inputs and the
plan's path rules, the repository layout the JJB leg expects, why the
checkout credentials go before either leg runs the change's content,
including from every submodule, why the Lint leg turns off the prek
and uv caches in Gerrit mode, the egress allow-lists, and what the
offline fixtures and the self-test cover and cannot. For the linked
global-jjb layout it points to jjb-action's own suite rather than a
follow-up here.

Its migration section maps the legacy inputs, asks every consumer to
add the actionlint-py hook, and lists what ONAP, O-RAN-SC, lfit,
FD.io and akraino each change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Add a section for the ci-management verify reusable with a minimal
caller, name its self-test caller and its Gerrit example in the
caller filename rules, and count it with change isolation and tox
verify among the reusables that check a Gerrit change out.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>

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.

🔵 Needs a closer look

The security-sensitive production Gerrit checkout, submodule refresh, credential removal, and caller voting path have only synthetic coverage and require human runtime validation before merge.

1 open issue

Review effort: Balanced

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 43522b7 into lfreleng-actions:main Nov 1, 2026
45 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-106 branch November 1, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Add the ci-management-verify reusable workflow

2 participants