Skip to content

fix(shellcheck-run-steps): pass all pipeline dirs via --pipeline-dirs - #38

Draft
dannf wants to merge 1 commit into
mainfrom
dannf/compile-pipeline-dirs
Draft

dannf wants to merge 1 commit into
mainfrom
dannf/compile-pipeline-dirs

Conversation

@dannf

@dannf dannf commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The problem

Commit 399c363 (#36) tried to let the hook find pipelines that live outside a package's own directory. It did this by passing several --pipeline-dir flags to melange compile. But melange compile declares --pipeline-dir as a single string. Repeated flags collapse to the last one. For an enterprise package, that last flag is ./pipelines/os. A package that uses a pipeline from ./pipelines/ still fails, with the error unable to load pipeline: open pipelines/test/manylinux.yaml: file does not exist. This was verified against chainguard-dev/stereo#330877 with melange v0.60.0:

--pipeline-dir=./pipelines/                      rc=0
--pipeline-dir=./enterprise-packages/pipelines/  rc=1
three flags as passed by 399c363                 rc=1

The change

chainguard-dev/melange#2656 is merged. It adds --pipeline-dirs to melange compile, the same comma-separated list flag that melange build already has. _pipeline_dirs_for now returns one --pipeline-dirs=a,b,c flag, and the fallback for unknown directories uses the same flag.

Do not merge before the image has the flag

The hook runs cgr.dev/chainguard/melange:latest. Until that image includes melange#2656, melange compile rejects --pipeline-dirs as an unknown flag, and the hook fails for every package. Check with:

docker run --rm cgr.dev/chainguard/melange:latest compile --help | grep pipeline-dirs

Evidence

This was tested with a melange binary built from #2656. Running melange compile --pipeline-dirs=./enterprise-packages/pipelines/,./pipelines/,./pipelines/os enterprise-packages/libvpx.yaml compiles the package from stereo#330877 that fails today. The function's output for each package tier:

enterprise-packages/libvpx.yaml  --pipeline-dirs=./enterprise-packages/pipelines/,./pipelines/,./pipelines/os
extra-packages/foo.yaml          --pipeline-dirs=./extra-packages/pipelines/,./pipelines/os
os/zlib.yaml                     --pipeline-dirs=./os/pipelines/
other/bar.yaml                   --pipeline-dirs=./other/pipelines

🤖 Generated with Claude Code

Commit 399c363 passed each pipeline directory with its own
--pipeline-dir flag. `melange compile` treats that flag as a single
string, so repeated flags collapse to the last one. For enterprise
packages, that leaves only ./pipelines/os. A package that uses a
pipeline from ./pipelines/ still fails with "unable to load pipeline",
which is the error commit 399c363 set out to fix.

chainguard-dev/melange#2656 adds --pipeline-dirs to `melange compile`.
This flag takes a comma-separated list, the same format `melange build`
already uses. Pass the directories through --pipeline-dirs instead. The
fallback for unknown directories uses the same flag, so one code path
covers both cases.

This fix needs the melange:latest image to include that change. An
older image rejects --pipeline-dirs as an unknown flag, and the hook
then fails for every package.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
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.

1 participant