fix: VSA generation issues in verify-conforma-konflux-ta task#3118
fix: VSA generation issues in verify-conforma-konflux-ta task#3118arewm wants to merge 2 commits intoconforma:mainfrom
Conversation
Review Summary by QodoAdd missing sourceDataArtifact parameter to trusted artifact task
WalkthroughsDescription• Add missing sourceDataArtifact parameter to trusted artifact task • Fixes basename error when pushing trusted artifacts • Properly sets sourceDataArtifact from previous task results Diagramflowchart LR
A["Task Parameters"] -->|missing sourceDataArtifact| B["basename Error"]
C["Previous Task Results"] -->|sourceDataArtifact.path| D["Task Execution"]
B -->|fix applied| D
File Changes1. tasks/verify-conforma-konflux-ta/0.1/verify-conforma-konflux-ta.yaml
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
I encountered the error when trying to push a trusted artifact ```bash DDEBUG /usr/local/bin/create-archive.71: basename basename: missing operand Try 'basename --help' for more information. DEBUG /usr/local/bin/create-archive.71: artifact_name= ``` This was due to the fact that we were not properly setting the sourceDataArtifact. Signed-off-by: arewm <arewm@users.noreply.github.com>
8a8b30b to
728022f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Patch looks reasonable. I don't think I understand the motivation though. What/where is /usr/local/bin/create-archive ? What is a sourceDataArtifact in this context, and what are you doing with the VSA content? |
|
/ok-to-test |
|
I found we do have some test coverage for this task in |
I did some rftm, and I know what this is now. 😅 Is your plan to consume the VSA as a "trusted artifact" input in another task? |
|
I am still working on some additional changes when testing locally. I moved this PR to draft until I finish working on it. |
|
I did a sanity check on the bash, seems good: |
There was a problem hiding this comment.
🤷
| VSA_LOCAL_PATH=$(echo "$(params.VSA_UPLOAD)" | grep -oE 'local@[^ ]+' | sed 's/^local@//' | head -n1) | |
| VSA_LOCAL_PATH=$(echo "$(params.VSA_UPLOAD)" | grep -oE '^local@[^ ]+' | sed 's/^local@//' | head -n1) |
Three fixes for the verify-conforma-konflux-ta task: 1. Write VSA output to /tmp/vsa-output then copy to workdir. The ec CLI requires --attestation-output-dir to be under /tmp or cwd, so writing directly to /var/workdir/vsa was silently rejected. 2. Use echo -n for VSA_GENERATED result to avoid trailing newlines that break Tekton When Expression matching in downstream tasks. 3. Only pass --vsa-upload for dsse format since the local backend requires a signing key. Assisted-by: Claude Code (Opus 4.6)
The upstream verify-conforma-konflux-ta task had several issues when VSA generation is enabled. This local copy fixes them while an upstream PR (conforma/cli#3118) is pending. The ec CLI requires --attestation-output-dir to be under /tmp or cwd, so VSA output is written to /tmp/vsa-output then copied to the workdir for trusted artifact archival. Results use echo -n to avoid trailing newlines that broke Tekton When Expression matching downstream. The --vsa-upload flag is only passed for dsse format since the local backend requires a signing key. The conforma JSON report is included in the trusted artifact for downstream SLSA VSA generation. The taskRef is hardcoded to this repo to bypass the ec-defaults ConfigMap injection (see konflux-ci/konflux-ci#5375). Assisted-by: Claude Code (Opus 4.6)
Summary
Fixes three issues with the
verify-conforma-konflux-tatask when VSA generation is enabled:sourceDataArtifactparam: Thecreate-trusted-artifactstep was not receiving thesourceDataArtifactparam, causingbasename ""to fail with "missing operand"--attestation-output-dirmust point to a path under/tmpor the current working directory. Writing directly to/var/workdir/vsawas silently rejected, producing an empty directory. Fixed by writing to/tmp/vsa-outputthen copying to the workdir for trusted artifact archivalecho "true"writes"true\n"which doesn't match"true"in Tekton When Expressions, causing downstream tasks to be skipped. Fixed withecho -n--vsa-uploadonly for dsse format: Thelocal@backend requires a signing key, so it should only be passed whenATTESTATION_FORMAT=dsseTest plan
🤖 Generated with Claude Code