Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/checks-codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ permissions:
jobs:

Test:
if: false # skipped for POC branch

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Replace the constant job conditions with one lint-valid POC gate.

actionlint rejects each constant if: false condition. Use the same non-constant repository or workflow variable gate for all three jobs. Keep the gate false for the POC.

  • .github/workflows/checks-codecov.yaml#L37-L37: update the Test job condition.
  • .github/workflows/checks-codecov.yaml#L100-L100: update the Acceptance job condition.
  • .github/workflows/checks-codecov.yaml#L169-L169: update the Upload job condition.
🧰 Tools
🪛 actionlint (1.7.12)

[error] 37-37: constant expression "false" in condition. remove the if: section

(if-cond)

📍 Affects 1 file
  • .github/workflows/checks-codecov.yaml#L37-L37 (this comment)
  • .github/workflows/checks-codecov.yaml#L100-L100
  • .github/workflows/checks-codecov.yaml#L169-L169
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/checks-codecov.yaml at line 37, Replace the constant if:
false conditions for the Test, Acceptance, and Upload jobs with the same
non-constant repository or workflow variable gate that evaluates false for the
POC, ensuring actionlint accepts all three conditions. Update
.github/workflows/checks-codecov.yaml at lines 37-37, 100-100, and 169-169.

Source: Linters/SAST tools

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

The if: false additions unconditionally disable the Test, Acceptance, and Upload jobs in the checks-codecov workflow. This is the only workflow that runs make test and make acceptance. The PR targets main, so merging this disables all unit test, acceptance test, and coverage gating for every subsequent PR and push to main/release-* branches.

Suggested fix: Remove the if: false additions, or use a branch-conditional expression (e.g., if: github.ref != 'refs/heads/reqd-task-its-poc') to limit the skip to the POC branch only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false to the Test, Acceptance, and Upload jobs disables all test and coverage CI for every PR and push to main. The release workflow (release.yaml) triggers on workflow_run with conclusion=='success'. Since the Tools job still runs and skipped jobs do not fail the workflow, the overall conclusion will be 'success', meaning releases could proceed on every main push without any test validation.

Suggested fix: Do not merge if: false on the main branch. Keep these changes on a separate POC branch, use path-based conditions, or disable the release workflow trigger as well.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] scope-creep

Disabling all three CI jobs is beyond the stated intent of adding a dummy task/pipeline. The PR is marked [DNM] but is not a draft, increasing the risk of accidental merge. No documented cleanup plan or expiration date exists for the POC artifacts.

Suggested fix: Remove CI workflow changes from this PR, or convert to a draft PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

All three CI jobs (Test, Acceptance, Upload) are unconditionally disabled with if: false. This workflow runs on PRs and pushes to main and release-* branches. If merged, all Go unit tests, integration tests, acceptance tests, code generation checks, and code coverage uploads would be permanently disabled for all future PRs and pushes to main.

Suggested fix: Do not merge the if: false changes to main. If this POC branch needs to skip these checks, use a branch-specific condition or keep this change on a non-main branch only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] protected-path

This PR modifies a file under the .github/ protected path. The PR has no linked GitHub issue and the description does not explain why CI jobs need to be disabled. Changes to governance and infrastructure files require human approval.

Suggested fix: Create a linked GitHub issue explaining the rationale for disabling CI jobs, or move this change to a non-main branch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

All three CI jobs (Test, Acceptance, Upload) are unconditionally disabled with if: false. The PR is not marked as draft and targets main. If merged, all unit tests, integration tests, acceptance tests, and code coverage uploads from this workflow are disabled for subsequent PRs. The [DNM] title convention is not enforced by branch protection.

Suggested fix: Mark this PR as a draft to prevent accidental merge, or remove the CI-disabling changes from this PR entirely.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

All three CI jobs (Test, Acceptance, Upload) are unconditionally disabled with 'if: false'. This workflow runs on pull_request and push to main and release-* branches. If merged to main, all subsequent PRs will lack unit test, acceptance test, and code-coverage CI signal. No other workflow provides equivalent coverage.

Suggested fix: Do not merge these 'if: false' guards to main. Either scope the skip to the POC branch with a conditional expression, or remove the guards before merging.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false unconditionally disables the Test, Acceptance, and Upload jobs for all branches, including PRs to main. The comment says 'skipped for POC branch' but if: false is not branch-scoped — if merged, all automated testing and coverage gates are removed.

Suggested fix: Scope the skip to the POC branch only (e.g., if: github.ref != 'refs/heads/reqd-task-its-poc'), or do not merge these workflow changes to main.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] ci-safety-guard-disabled

All CI test jobs (Test, Acceptance, Upload) are unconditionally disabled with if: false. If accidentally merged or cherry-picked, CI protection for the repository is silently removed.

Suggested fix: Use a branch-conditional guard (e.g., if: github.ref != 'refs/heads/reqd-task-its-poc') instead of if: false.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false unconditionally disables the Test, Acceptance, and Upload jobs in the checks-codecov workflow. This workflow gates unit tests, acceptance tests, and code coverage on PR and push to main/release branches. If merged, all subsequent changes would land without these checks. The PR is not in draft state and targets main.

Suggested fix: Mark the PR as draft or use a branch-scoped condition (e.g., if: github.head_ref != 'reqd-task-its-poc') instead of unconditional false.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] protected-path

Files under the protected .github/ path are modified (.github/workflows/checks-codecov.yaml, .github/workflows/codeql.yaml). The PR has no linked GitHub issue and does not provide explicit justification for modifying governance/infrastructure files. Human approval is required for all protected-path changes.

Suggested fix: Link a GitHub issue that authorizes the CI workflow modifications, or remove the .github/ changes from this PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI-coverage-regression

Adding if: false unconditionally disables the Test, Acceptance, and Upload jobs for all pull requests and pushes to main/release branches. If merged, every subsequent PR would lose unit test, acceptance test, and code coverage CI signal.

Suggested fix: Use a branch-scoped condition such as if: github.head_ref != 'reqd-task-its-poc', or remove the CI changes entirely.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] scope-creep

Disabling all CI quality gates via if: false is a significant scope expansion beyond what a POC for testing pipelines and artifacts in Konflux would require.

Suggested fix: Remove the if: false additions from the CI workflow files.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false to the Test, Acceptance, and Upload jobs unconditionally disables all unit tests, acceptance tests, and code coverage uploads. If merged, code could land on main without test or coverage signal. The if: false approach is branch-unaware.

Suggested fix: Replace if: false with a branch-conditional guard or move POC artifacts to a separate branch without modifying shared CI workflows.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false unconditionally disables the Test, Acceptance, and Upload Coverage jobs. This workflow provides unit test, integration test, acceptance test, and code coverage gate signal on PRs and pushes to main/release-* branches. If merged, all PRs and pushes to main would land without these CI checks.

Suggested fix: Use a branch-name condition instead of if: false, or move CI-disabling to a separate workflow file on the POC branch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] scope-coherence

Disabling CI jobs with if: false is scope creep beyond the POC's stated purpose of testing Tekton pipelines and artifacts in Konflux.

Suggested fix: Remove the if: false additions or use branch-level filtering in workflow triggers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] protected-path

Protected path modified: .github/workflows/checks-codecov.yaml and .github/workflows/codeql.yaml are under the .github/ protected path. The PR has no linked GitHub issue and does not explain why CI workflow files need to be modified. Human approval is always required for changes to governance and infrastructure files.

Suggested fix: Link a GitHub issue authorizing the CI workflow changes, or remove the if: false modifications from the protected workflow files.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

if: false unconditionally disables the Test, Acceptance, and Upload jobs. These guards are not branch-scoped, so accidental merge would disable all tests and coverage for the repository.

Suggested fix: Use a branch-scoped condition like if: github.head_ref != reqd-task-its-poc rather than if: false.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] scope-creep

Disabling CI workflows is outside the PRs stated scope of add dummy task, pipeline, and ITS for EC-2011 POC.

Suggested fix: Remove the if: false guards. Use [skip ci] in individual commit messages if CI is too slow for iteration.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] protected-path

PR modifies files under the protected .github/ path (.github/workflows/checks-codecov.yaml, .github/workflows/codeql.yaml). No linked issue exists and the PR description does not specifically explain why CI workflow files are being modified. Human approval is always required for protected-path changes.

Suggested fix: Link a GitHub issue authorizing the CI workflow changes, or remove the workflow modifications from this PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

Adding if: false unconditionally disables the Test, Acceptance, and Upload jobs for all branches. The comment says 'skipped for POC branch' but if: false is not branch-conditional, so if merged it would disable CI for all branches.

Suggested fix: Replace if: false with a branch-scoped condition or keep these changes out of the workflow files entirely.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] scope-mismatch

CI disabling is a significant scope expansion beyond the stated intent of adding dummy task/pipeline/ITS. The CI changes are unnecessary for the POC goal.

Suggested fix: Remove the if: false additions. Use per-commit skip mechanisms instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

All three jobs (Test, Acceptance, Upload) are unconditionally disabled with if: false, removing unit tests, acceptance tests, and code coverage uploads for all PRs and pushes to main/release branches.

Suggested fix: Remove the CI workflow changes. CI failures on a draft POC branch are acceptable; blanket if: false is unnecessary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] scope-creep

Disabling all CI checks goes beyond the stated intent of adding a dummy task, pipeline, and ITS for EC-2011 POC. CI disabling is a separate concern from adding test pipeline artifacts.

Suggested fix: Remove the if: false additions from the CI workflow files.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI-coverage-regression

All three jobs (Test, Acceptance, Upload) are disabled with if: false, removing unit test, integration test, and acceptance test CI gates for PRs targeting main and release branches. If merged, PRs to main would lose test and coverage CI signal.

Suggested fix: Use branch-scoped conditions (e.g., if: github.head_ref != 'poc-branch-name') or keep these changes out of the PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] scope-creep

Disabling all CI jobs (tests, coverage, CodeQL) goes beyond the stated scope of 'add dummy task, pipeline, and ITS.' This represents significant scope expansion.

Suggested fix: Remove the CI-disabling changes or use branch-level workflow filtering.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI-coverage-regression

Adding if: false unconditionally disables the Test, Acceptance, and Upload jobs. These jobs gate unit tests, acceptance tests, code generation checks, and coverage uploads. If merged, subsequent PRs to main would land without this CI signal.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

if: false unconditionally disables the Test, Acceptance, and Upload Coverage jobs for all PRs and pushes to main/release-* branches.

runs-on: ubuntu-latest
steps:
- name: Harden Runner
Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
retention-days: 1

Acceptance:
if: false # skipped for POC branch
runs-on: ubuntu-latest
steps:
# Disabled until we figure out the "Could not resolve host: github.com" in
Expand Down Expand Up @@ -164,6 +166,7 @@ jobs:

Upload:
name: "Upload Coverage Statistics"
if: false # skipped for POC branch
runs-on: ubuntu-latest
needs: [Test, Acceptance]
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ permissions:

jobs:
analyze:
if: false # skipped for POC branch

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression / Security scanning bypass

Adding if: false unconditionally disables CodeQL security analysis for all branches and the weekly schedule, removing automated SAST scanning coverage.

Suggested fix: Scope the condition to the POC branch or do not merge this workflow change to main.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] ci-safety-guard-disabled

CodeQL security scanning is disabled via if: false on the analyze job. If merged, the repository would lose automated SAST for Go code on pushes, pull requests, and scheduled scans.

Suggested fix: Use a branch-conditional guard instead of if: false, or leave the workflow unmodified.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false unconditionally disables the CodeQL security analysis job, removing SAST scanning for all PRs and pushes to main plus the weekly scheduled scan. If merged, Go code changes would land without CodeQL security analysis.

Suggested fix: Use a branch-scoped condition or mark PR as draft to prevent accidental merge.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI-coverage-regression

The if: false unconditionally disables CodeQL security analysis for all PRs and pushes to main, as well as the weekly scheduled scan.

Suggested fix: Scope the skip condition to this branch only, or remove the CI modification.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI-security-regression

Disabling CodeQL removes automated static analysis security scanning for the repository if merged.

Suggested fix: Do not disable CodeQL scanning on the main branch. Use branch-specific conditions or keep changes on a non-protected branch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

The CodeQL security analysis job is unconditionally disabled with if: false. This removes static security scanning for any branch carrying this commit, including the weekly scheduled scan on main.

Suggested fix: Use a branch-conditional guard or avoid modifying shared CI workflows in POC branches.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI coverage regression

Adding if: false disables the CodeQL security analysis job. This workflow runs on PRs to main, pushes to main, and on a weekly schedule. If merged, it would eliminate static analysis security scanning and the weekly scheduled scan entirely.

Suggested fix: Use a branch-specific condition or keep CI modifications out of the PR entirely.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

if: false unconditionally disables CodeQL security analysis. Same accidental-merge risk as the checks-codecov workflow.

Suggested fix: Use a branch-scoped condition or remove this change entirely.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

Adding if: false unconditionally disables the CodeQL security analysis job for all triggers including the weekly cron.

Suggested fix: Use a branch-conditional skip or remove this change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

The CodeQL security analysis job is unconditionally disabled with if: false, removing SAST coverage for all PRs, pushes to main, and the scheduled weekly scan.

Suggested fix: Remove this change from the PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] CI-coverage-regression

CodeQL security analysis job disabled with if: false, removing static security analysis for all PRs and pushes to main, including scheduled weekly scans.

Suggested fix: Use branch-scoped conditions or keep this change off the PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI-coverage-regression

Adding if: false unconditionally disables the CodeQL security analysis job. If merged, no CodeQL scanning would run for future PRs, pushes, or the weekly schedule.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] CI coverage regression

if: false disables CodeQL security scanning for all branches and the weekly schedule.

name: Analyze
runs-on: ubuntu-latest
permissions:
Expand Down
104 changes: 104 additions & 0 deletions hack/create-dummy-its.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env bash
# Copyright The Conforma Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] pattern-inconsistency

License header URL indentation uses 5 spaces vs repo convention of 6 spaces. Affects all 3 new files.

#

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] license-header-formatting

License header uses 5-space indentation for URL line. Dominant convention (60+ files) uses 6-space indentation.

Suggested fix: Add one space to URL indentation.

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

# Creates (or deletes) the dummy IntegrationTestScenario for the EC-2011 POC.
#
# This script ONLY manages the IntegrationTestScenario object. The ITS pipeline's
# attest-test-result step also needs push access, which requires patching the
# shared konflux-integration-runner ServiceAccount — a separate, security-
# sensitive, namespace-wide change handled by hack/modify-sa-for-dummy-its.sh.
# Run that script after this one to grant push access.

set -euo pipefail

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] Shell option style

Uses short-form set -euo pipefail while the majority of shell scripts in hack/ use the long-form convention (set -o errexit, set -o nounset, set -o pipefail, one per line).

Suggested fix: Replace with the long-form convention for consistency.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-idiom

Uses short-form set -euo pipefail whereas the established convention in hack/ scripts is long-form set -o errexit, set -o nounset, set -o pipefail on separate lines.


Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] naming-convention

Script uses set -euo pipefail but repo convention is long-form (set -o errexit; set -o nounset; set -o pipefail).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] shell set-option idiom

The script uses set -euo pipefail (compact form), but every existing script in hack/ uses the long-form set -o errexit, set -o nounset, set -o pipefail on separate lines.

Suggested fix: Replace set -euo pipefail with separate set -o errexit, set -o nounset, set -o pipefail lines.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell set-options idiom

Uses compact set -euo pipefail; convention in hack/ is long-form set -o errexit, set -o nounset, set -o pipefail.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-idiom

Uses set -euo pipefail (short form), while the overwhelming majority of hack/ scripts use long-form set -o errexit, set -o nounset, set -o pipefail.

Suggested fix: Replace with long-form set options to match project convention.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-options-idiom

Uses set -euo pipefail (short-form) while all other hack/ scripts use long-form (set -o errexit, set -o nounset, set -o pipefail).

Suggested fix: Replace with long-form flags matching hack/ convention.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-strict-mode

Uses set -euo pipefail shorthand while the predominant convention in hack/ scripts is long-form (set -o errexit, set -o nounset, set -o pipefail).

Suggested fix: Replace with three separate long-form lines for consistency with existing scripts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-idiom

Uses short-form set -euo pipefail while the majority (30 of 34) of hack/ scripts use long-form (set -o errexit, set -o nounset, set -o pipefail).

Suggested fix: Use long-form set flags for consistency with the existing codebase.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] naming-convention

Uses short-form set -euo pipefail where repo convention is long-form (set -o errexit, etc.).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-idiom-consistency

Script uses set -euo pipefail while every other hack/ script uses long-form set -o errexit; set -o nounset; set -o pipefail on separate lines.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-idiom-consistency

Uses set -euo pipefail while all other hack/ scripts use the expanded set -o errexit, set -o nounset, set -o pipefail form.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell-options-idiom

Uses compact set -euo pipefail vs. dominant verbose convention (set -o errexit, set -o pipefail, set -o nounset on separate lines).

Suggested fix: Replace with three separate set -o lines.

NAMESPACE="${NAMESPACE:-rhtap-contract-tenant}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] injection

oc apply heredoc interpolates environment variables directly into YAML without escaping.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] shell style idiom

Uses short-form set -euo pipefail while other hack/ scripts use long-form set -o errexit, set -o nounset, set -o pipefail.

Suggested fix: Use long-form for consistency.

APPLICATION="${APPLICATION:-ec-main}"
ITS_NAME="${ITS_NAME:-reqd-task-poc-ec2011}"

GIT_URL="${GIT_URL:-https://github.com/simonbaird/conforma-cli}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] permission-expansion

The IntegrationTestScenario defaults GIT_URL to a personal fork and GIT_REVISION to a mutable branch. The ITS instructs Konflux to fetch and execute pipeline definitions from this external source.

Suggested fix: Pin GIT_REVISION to a specific commit SHA.

GIT_REVISION="${GIT_REVISION:-reqd-task-its-poc}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] Hardcoded personal reference

The default for GIT_URL is a personal fork (https://github.com/simonbaird/conforma-cli). This is consistent with the POC nature but should be updated to the organization URL before any production use.

Suggested fix: Consider using the organization URL as the default.

PIPELINE_PATH="${PIPELINE_PATH:-pipelines/dummy-integration-test/0.1/dummy-integration-test.yaml}"

usage() {
cat <<EOF
Usage: $(basename "$0") [--revert] [--help]

(no args) Create the dummy IntegrationTestScenario.
--revert Delete the dummy IntegrationTestScenario.

Grant/revoke the push access the ITS pipeline needs separately, with
hack/modify-sa-for-dummy-its.sh.

Environment overrides: NAMESPACE, APPLICATION, ITS_NAME, GIT_URL, GIT_REVISION,
PIPELINE_PATH.
EOF
}

create_its() {
echo "Creating IntegrationTestScenario '${ITS_NAME}' in namespace '${NAMESPACE}'"
echo " Application: ${APPLICATION}"
echo " Git URL: ${GIT_URL}"
echo " Revision: ${GIT_REVISION}"
echo " Pipeline: ${PIPELINE_PATH}"
echo ""

oc apply -f - <<EOF
apiVersion: appstudio.redhat.com/v1beta2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] Injection / Shell command injection via environment variables

The script interpolates environment variables directly into YAML heredoc and JSON patch payloads without sanitization. Theoretical YAML/JSON injection risk, though practical exploitation requires controlling the operator's environment.

kind: IntegrationTestScenario
metadata:
name: ${ITS_NAME}
namespace: ${NAMESPACE}
labels:
test.appstudio.openshift.io/optional: "true"
Comment on lines +65 to +66

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- script ---'
cat -n hack/create-dummy-its.sh

printf '%s\n' '--- related references ---'
rg -n -i --glob '!vendor/**' --glob '!node_modules/**' \
  'reqd-task-poc-ec2011|test\.appstudio\.openshift\.io/optional|optional.*IntegrationTestScenario|IntegrationTestScenario|required task|required-task' .

Repository: conforma/cli

Length of output: 2721


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- dummy integration-test pipeline ---'
cat -n pipelines/dummy-integration-test/0.1/dummy-integration-test.yaml

printf '%s\n' '--- enterprise-contract guidance ---'
sed -n '70,110p' pipelines/enterprise-contract/0.1/enterprise-contract.yaml

printf '%s\n' '--- all optional-label and informative references ---'
rg -n -i 'test\.appstudio\.openshift\.io/optional|informative|required.*task|task.*required|IntegrationTestScenario' \
  README.md docs hack pipelines internal config .github 2>/dev/null || true

Repository: conforma/cli

Length of output: 7294


🌐 Web query:

Konflux IntegrationTestScenario test.appstudio.openshift.io/optional label required task semantics

💡 Result:

The label test.appstudio.openshift.io/optional in Konflux is used to control whether an IntegrationTestScenario is mandatory for the release process [1][2]. Its semantics are as follows: - Purpose: It specifies whether the result of a PipelineRun created by the IntegrationTestScenario must be successful for an application snapshot to be considered valid [1][3]. - Values: - "true": The integration test is marked as optional. If the test fails, it does not block the release or promotion of the application snapshot [1][4][3]. - "false": The integration test is mandatory (required). If the test fails, the application snapshot is marked as failed, which prevents its release [1][4][3]. - Default Behavior: If the label is not explicitly defined in an IntegrationTestScenario custom resource, the Konflux Integration Service defaults its value to "false", meaning all integration tests are mandatory by default [1][5][3]. - Propagation: When a test runs, this label is copied from the IntegrationTestScenario resource to the resulting PipelineRun [1][2]. By marking a test as optional, users can allow specific, non-critical tests to fail without hindering the overall automated release process [4][3].

Citations:


Remove the optional label from the required-task scenario.

The reqd-task-poc-ec2011 scenario must be mandatory to enforce required-task behavior. Remove test.appstudio.openshift.io/optional: "true".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/create-dummy-its.sh` around lines 25 - 26, In the reqd-task-poc-ec2011
required-task scenario, remove the test.appstudio.openshift.io/optional label so
the scenario is treated as mandatory. Leave the remaining scenario configuration
unchanged.

spec:
application: ${APPLICATION}
contexts:
- description: Application testing
name: application

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] command-injection

PULL_SECRET is interpolated into inline Python code via shell string expansion. A crafted value containing a single quote could break out of the Python string context and execute arbitrary Python code.

Suggested fix: Pass PULL_SECRET as an environment variable and access with os.environ['PULL_SECRET'] in the Python code.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] injection

PULL_SECRET env var is interpolated directly into inline Python code via shell expansion. A single quote in the value would break Python syntax and could enable code execution. Same pattern at line 53. PUSH_SECRET is also interpolated into grep pattern and JSON patch.

Suggested fix: Pass via environment variable and read with os.environ. Validate all env inputs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] command-injection

Shell variable ${PULL_SECRET} interpolated directly into inline Python string literal. Default value is safe; narrow attack surface for a hack/ script.

Suggested fix: Pass values via environment variables read inside Python (e.g., os.environ['PULL_SECRET']).

resolverRef:
resolver: git

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] TOCTOU race

SA_JSON is fetched once and reused after oc patch modifies the ServiceAccount. The second grep check operates on a stale snapshot.

resourceKind: pipeline
params:
- name: url
value: ${GIT_URL}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] Shell injection

PULL_SECRET is bash-expanded directly inside an inline Python string literal. A crafted override value with single quotes could escape the string context.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] race-condition

The script captures ServiceAccount JSON once, then computes an index for oc patch against the live object. Concurrent modification would produce incorrect results.

- name: revision
value: ${GIT_REVISION}
- name: pathInRepo
value: ${PIPELINE_PATH}
EOF

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] shell-injection

The inline Python code interpolates ${PULL_SECRET} directly into the Python source via a heredoc. A value containing a single quote would break the Python string literal and could cause unexpected behavior or code execution.

Suggested fix: Pass PULL_SECRET as an environment variable to the Python subprocess and access it via os.environ.


echo ""
echo "Done. Verify with:"
echo " oc get integrationtestscenario ${ITS_NAME} -n ${NAMESPACE} -o yaml"
echo ""
echo "Next: grant push access with hack/modify-sa-for-dummy-its.sh"
}

revert_its() {
echo "Deleting IntegrationTestScenario '${ITS_NAME}' from namespace '${NAMESPACE}'"
oc delete integrationtestscenario "${ITS_NAME}" -n "${NAMESPACE}" --ignore-not-found
echo ""
echo "Done. If push access was granted, revoke it with:"
echo " hack/modify-sa-for-dummy-its.sh --revert"
}

case "${1:-}" in
--revert) revert_its ;;
--help | -h) usage ;;
"") create_its ;;
*) echo "Unknown argument: $1" >&2; echo ""; usage; exit 1 ;;
esac
142 changes: 142 additions & 0 deletions hack/modify-sa-for-dummy-its.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#!/usr/bin/env bash
# Copyright The Conforma Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

# Grants (or revokes) push access for the EC-2011 POC ITS pipeline by patching
# the shared konflux-integration-runner ServiceAccount.
#
# The integration service runs all ITS pipelines using the
# konflux-integration-runner ServiceAccount. There's currently no way to
# specify a per-ITS ServiceAccount, so we have to patch the shared SA to
# include the push secret needed by the attest-test-result step action.
#
# NOTE: This is a security hazard, not just a broad-scope inconvenience. ITS
# pipelines are BYO/arbitrary by design, so any secret on the shared runner SA
# is a secret handed to untrusted code. This patch is acceptable only for this
# POC under a "trusted pipeline" assumption; a real solution must keep push
# credentials off the runner SA entirely (e.g. platform-side push). It is kept
# in its own script (separate from create-dummy-its.sh) precisely because it is
# a shared, namespace-wide, security-sensitive change.
#
# TODO: Ideally only specific ITS pipelines that need push access should
# get it, not every ITS in the namespace. This requires either:
# - A per-ITS ServiceAccount field in the IntegrationTestScenario spec
# (integration-service is one field away: the `if ServiceAccountName == ""`
# guard in tekton/integration_pipeline.go already exists, nothing feeds it)
# - A dedicated SA created and wired up per pipeline
# For now we accept the broader scope for this POC.

set -euo pipefail

NAMESPACE="${NAMESPACE:-rhtap-contract-tenant}"
INTEGRATION_SA="konflux-integration-runner"
PUSH_SECRET="${PUSH_SECRET:-imagerepository-for-ec-main-cli-main-image-push}"

# The pull-only secret "ec-main-pull" covers the same registry path as the
# push secret. Tekton merges all SA secrets into a single docker config, and
# if the pull-only credential wins the merge for that registry, oras attach
# fails with "unauthorized". Removing the pull-only secret avoids the
# conflict — the push secret includes pull permission so nothing is lost.
#
# NOTE: select-oci-auth (used by the oras attach step action) does NOT avoid
# this. Both secrets key their auth at the identical repo path, so Tekton's
# merge keeps only one token; select-oci-auth only disambiguates across
# *different* keys and runs after the merge. So this removal is still required.
PULL_SECRET="${PULL_SECRET:-ec-main-pull}"

usage() {
cat <<EOF
Usage: $(basename "$0") [--revert] [--help]

(no args) Grant push access: remove the conflicting pull-only secret and add
the push secret to the ${INTEGRATION_SA} ServiceAccount.
--revert Restore the pull-only state: remove the push secret and re-add the
pull-only secret.

Environment overrides: NAMESPACE, PUSH_SECRET, PULL_SECRET.
EOF
}

# Returns 0 if the integration SA already lists the named secret.
sa_has_secret() {
local secret="$1"
oc get sa "${INTEGRATION_SA}" -n "${NAMESPACE}" -o json | python3 -c "
import json, sys
secret = sys.argv[1]
secrets = [s['name'] for s in json.load(sys.stdin).get('secrets', [])]
sys.exit(0 if secret in secrets else 1)
" "${secret}"
}

# Link the named secret to the integration SA (no-op if already present).
link_secret() {
local secret="$1"
if sa_has_secret "${secret}"; then
echo "Secret '${secret}' already linked to SA '${INTEGRATION_SA}'"
else
echo "Adding secret '${secret}' to SA '${INTEGRATION_SA}'"
oc patch sa "${INTEGRATION_SA}" -n "${NAMESPACE}" --type=json \
-p="[{\"op\":\"add\",\"path\":\"/secrets/-\",\"value\":{\"name\":\"${secret}\"}}]"
fi
}

# Unlink the named secret from the integration SA (no-op if absent).
unlink_secret() {
local secret="$1"
if ! sa_has_secret "${secret}"; then
echo "Secret '${secret}' not present on SA '${INTEGRATION_SA}' (nothing to remove)"
return
fi
echo "Removing secret '${secret}' from SA '${INTEGRATION_SA}'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] TOCTOU

unlink_secret has a time-of-check-to-time-of-use gap between checking for a secret's presence and patching the ServiceAccount.

Suggested fix: Combine into single get+patch or use optimistic locking.

local index
index=$(oc get sa "${INTEGRATION_SA}" -n "${NAMESPACE}" -o json | python3 -c "
import json, sys
secret = sys.argv[1]
for i, s in enumerate(json.load(sys.stdin).get('secrets', [])):
if s['name'] == secret:
print(i)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] error-handling-gap

The unlink_secret function performs two separate oc get sa calls (TOCTOU race). If the SA is modified between calls, the index variable will be empty, causing the oc patch command to use an invalid JSON Patch path /secrets/.

break

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] error handling gap

If the python3 index-finding script doesn't find the secret, index is empty, causing an unhelpful API error in the subsequent oc patch.

Suggested fix: Add a guard on empty index before patching.

" "${secret}")
oc patch sa "${INTEGRATION_SA}" -n "${NAMESPACE}" --type=json \
-p="[{\"op\":\"remove\",\"path\":\"/secrets/${index}\"}]"
}

grant_push() {
echo "Granting push access on SA '${INTEGRATION_SA}' in namespace '${NAMESPACE}'"
echo ""
unlink_secret "${PULL_SECRET}"
link_secret "${PUSH_SECRET}"
echo ""
echo "Done. Verify with:"
echo " oc get sa ${INTEGRATION_SA} -n ${NAMESPACE} -o yaml"
}

revoke_push() {
echo "Restoring pull-only state on SA '${INTEGRATION_SA}' in namespace '${NAMESPACE}'"
echo ""
unlink_secret "${PUSH_SECRET}"
link_secret "${PULL_SECRET}"
echo ""
echo "Done. Verify with:"
echo " oc get sa ${INTEGRATION_SA} -n ${NAMESPACE} -o yaml"
}

case "${1:-}" in
--revert) revoke_push ;;
--help | -h) usage ;;
"") grant_push ;;
*) echo "Unknown argument: $1" >&2; echo ""; usage; exit 1 ;;
esac
102 changes: 102 additions & 0 deletions pipelines/dummy-integration-test/0.1/dummy-integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Copyright The Conforma Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] license-header-formatting

License header uses 5-space indentation for URL line vs. 6-space convention.

Suggested fix: Add one space to URL indentation.

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: reqd-task-poc-ec2011
labels:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] naming-coherence

Directory is dummy-integration-test but Pipeline resource name is reqd-task-poc-ec2011. Existing convention uses the same name for directory and resource.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] naming-convention

Pipeline/task name reqd-task-poc-ec2011 encodes Jira ticket number and abbreviation. Diverges from existing descriptive naming pattern.

build.appstudio.redhat.com/pipeline: "reqd-task-poc-ec2011"
spec:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] naming-inconsistency

The pipeline is named reqd-task-poc-ec2011, encoding a Jira ticket identifier, while existing pipelines use descriptive functional names.

params:
- name: SNAPSHOT
type: string
description: |
Spec section of an ApplicationSnapshot resource. Not all fields of the
resource are required. A minimal example:
{
"components": [
{
"containerImage": "quay.io/example/repo@sha256:abc123..."
}
]
}
Each "containerImage" in the "components" array is validated.
- name: RESULT
type: string
description: >-
The desired result of the dummy check. Must be one of: SUCCESS,
FAILURE, WARNING, ERROR, or SKIPPED.
default: "SUCCESS"
results:
- name: TEST_OUTPUT

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] fragile JSON parsing

parse-snapshot uses grep -oP for JSON parsing, which is fragile for minified or escaped JSON and may not be portable across all container images.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] edge-case

The parse-snapshot step uses grep -oP (PCRE) to extract containerImage from JSON. The -P flag may not be available in the ubi9/ubi-minimal image, and the regex will produce incorrect results for values containing escaped characters.

value: "$(tasks.dummy-check.results.TEST_OUTPUT)"
tasks:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] runtime failure

The parse-snapshot step uses grep -oP with the PCRE-specific \K operator on ubi9/ubi-minimal. The -P flag requires libpcre2 which may not be present on the minimal image, causing grep to fail with 'The -P option is not supported'.

Suggested fix: Replace with a portable alternative such as sed -n 's/.*"containerImage"\s*:\s*"\([^"]*\)".*/\1/p' or python3 -c.

- name: parse-snapshot

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] runtime failure / portability

parse-snapshot step uses grep -oP (PCRE) with \K lookbehind. ubi9/ubi-minimal may not have PCRE support compiled. Additionally, parsing JSON with grep is fragile.

Suggested fix: Use POSIX-compatible grep or use jq/python3 for JSON parsing.

taskSpec:
params:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] Fragile regex parsing

parse-snapshot uses grep regex to extract containerImage. If the image reference lacks an @ digest separator, IMAGE_DIGEST receives the entire image string.

- name: SNAPSHOT
type: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] runtime-failure

The parse-snapshot task uses grep -oP (PCRE regex) on ubi9/ubi-minimal:latest, which ships grep-minimal without PCRE support. This will fail at runtime.

Suggested fix: Replace with a PCRE-free alternative using sed or pure bash string manipulation.

results:
- name: image-url
- name: image-digest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] grep -oP portability

The parse-snapshot step uses grep -oP (PCRE with \K lookbehind) to extract containerImage from SNAPSHOT JSON. While ubi9/ubi-minimal ships GNU grep with -P support, parsing structured JSON with regex is fragile and may break on multi-line or reordered JSON.

Suggested fix: Consider using jq for JSON parsing if available in the image.

steps:
- name: parse
image: quay.io/konflux-ci/task-runner:v3
env:
- name: SNAPSHOT
value: $(params.SNAPSHOT)
script: |
#!/usr/bin/env bash
set -euo pipefail

IMAGE=$(jq -r '.components[0].containerImage // empty' <<<"${SNAPSHOT}")
if [[ -z "${IMAGE}" ]]; then
echo "ERROR: No containerImage found in SNAPSHOT" >&2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] supply-chain

Pipeline resolves dummy-check task from personal fork (simonbaird/conforma-cli) at mutable branch reqd-task-its-poc. The hack/create-dummy-its.sh script defaults to the same fork. Existing project pipelines use organization-owned bundle resolvers.

Suggested fix: Pin to an immutable commit SHA and reference the organizational repository.

exit 1
fi

IMAGE_URL="${IMAGE%%@*}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] personal-fork-references

Pipeline and task reference personal fork repos. Acceptable for DNM/POC but would need updating if promoted.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] External dependency pinning / supply chain

The dummy-check task is referenced from a personal repository (simonbaird/conforma-cli) on a named branch (reqd-task-its-poc) rather than a pinned SHA. Branch references are mutable.

Suggested fix: Pin to a specific commit SHA.

IMAGE_DIGEST="${IMAGE##*@}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] edge-case

The parse-snapshot step uses grep -oP which requires PCRE support. The ubi9/ubi-minimal image may not include PCRE, causing the step to fail.

Suggested fix: Replace the Perl regex with a POSIX-compatible alternative or use jq.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] Injection / Regex-based parsing

The parse-snapshot step uses grep with regex to extract containerImage from JSON rather than using a proper JSON parser like jq.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] supply chain / mutable reference

The pipeline's dummy-check task references an external repository (https://github.com/simonbaird/conforma-cli) pinned by branch name (reqd-task-its-poc), not by commit hash. Branch references are mutable and subject to supply chain attacks if the personal repository is compromised.

Suggested fix: Pin the revision parameter to a specific commit SHA. Consider hosting the task in the organization-owned repository.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] supply-chain-integrity

The pipeline's taskRef uses a mutable branch name (reqd-task-its-poc) rather than a pinned commit SHA from a personal GitHub repository.

Suggested fix: Pin the revision to a specific commit SHA.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] runtime failure

The parse-snapshot step uses grep -oP (Perl-compatible regex with \K lookbehind) on the ubi9/ubi-minimal:latest image. ubi-minimal ships grep-minimal, compiled without PCRE support. This will fail at runtime, preventing the pipeline from executing.

Suggested fix: Replace the PCRE regex with a POSIX-compatible approach (e.g., sed, awk, or python3).

echo "Parsed image-url: ${IMAGE_URL}"
echo "Parsed image-digest: ${IMAGE_DIGEST}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] Missing validation

parse-snapshot splits containerImage on @. If the image lacks @ (tag-only reference), both IMAGE_URL and IMAGE_DIGEST are set to the full string, producing an invalid digest.

Suggested fix: Add digest format validation after the split.


echo -n "${IMAGE_URL}" > "$(results.image-url.path)"
echo -n "${IMAGE_DIGEST}" > "$(results.image-digest.path)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] edge-case

If the containerImage value in the SNAPSHOT does not contain an @ separator, the parameter expansion IMAGE_DIGEST=${IMAGE##*@} will set IMAGE_DIGEST to the entire image string rather than an actual digest.

Suggested fix: Add a guard to verify the image contains @ and the digest is valid.

params:
- name: SNAPSHOT
value: "$(params.SNAPSHOT)"
- name: dummy-check
runAfter:
- parse-snapshot
params:
- name: RESULT
value: "$(params.RESULT)"
- name: image-url
value: "$(tasks.parse-snapshot.results.image-url)"
- name: image-digest
value: "$(tasks.parse-snapshot.results.image-digest)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] supply chain / unpinned dependency

The pipeline dummy-check taskRef resolves from https://github.com/simonbaird/conforma-cli at mutable branch reqd-task-its-poc. A force-push or branch deletion would alter or break pipeline behavior.

Suggested fix: Pin the revision parameter to a specific commit SHA.

taskRef:
resolver: git

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] external-dependency-pinning

Pipeline resolves task from personal fork (simonbaird/conforma-cli, branch reqd-task-its-poc) via mutable branch ref. Architecturally inconsistent with existing pipeline pattern using bundles resolver. Creates supply-chain trust gap since the branch content can change at any time.

Suggested fix: Either resolve from the same repo, use inline taskSpec, or pin to a specific commit SHA.

params:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] Hardcoded personal fork reference

The pipeline's dummy-check taskRef resolver references https://github.com/simonbaird/conforma-cli on branch reqd-task-its-poc. This creates a runtime dependency on a personal fork that may be deleted or force-pushed. The task definition is being added to this same repository. The same pattern appears in hack/create-dummy-its.sh.

Suggested fix: Update the git resolver URL to https://github.com/conforma/cli and reference the branch/revision where the task will exist after merge. Update hack/create-dummy-its.sh defaults similarly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] Supply chain / Untrusted external code reference

The pipeline's dummy-check task references a task definition from a personal GitHub repository (simonbaird/conforma-cli) using a mutable branch name (reqd-task-its-poc). The Tekton git resolver will fetch whatever is at HEAD of that branch at resolution time.

Suggested fix: Pin the revision to an immutable commit SHA. For any non-POC use, migrate the task definitions to the official organization repository.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] fork-reference

Pipeline task references personal fork (simonbaird/conforma-cli) at branch reqd-task-its-poc rather than the canonical conforma/cli repository.

Suggested fix: Document follow-up to migrate to canonical repo before any production use.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] permission-expansion

The task resolver uses a mutable branch reference (reqd-task-its-poc) from a personal fork. The task definition could change after deployment, executing different code with the mounted push credentials.

Suggested fix: Pin the task resolver to a specific commit SHA rather than a branch name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] hardcoded-fork-reference

The dummy-check taskRef uses a personal fork (simonbaird/conforma-cli) at a feature branch (reqd-task-its-poc).

- name: url
value: https://github.com/simonbaird/conforma-cli

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] secret-exposure

Pipeline resolves the dummy-check task from a personal fork (simonbaird/conforma-cli) on a mutable branch (reqd-task-its-poc).

Suggested fix: Pin to an immutable commit SHA or use the upstream repository.

- name: revision

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] supply chain / untrusted code source

All git resolver references across the pipeline, task, and helper script point to personal forks (simonbaird/conforma-cli and simonbaird/step-actions) on mutable branches rather than canonical org repos or pinned SHAs. This includes the attestation-creation step which is security-critical. Fork branches can be force-pushed, deleted, or compromised without review.

Suggested fix: Point references to org repos or pin to commit SHAs. At minimum, add prominent comments documenting that these are temporary POC references.

value: reqd-task-its-poc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[high] secret-exposure

The pipeline resolves the dummy-check task from a personal fork repository (https://github.com/simonbaird/conforma-cli) at a mutable branch reference (reqd-task-its-poc), not a pinned commit SHA. This creates a supply chain risk — the task code that runs with cluster access can be changed without review.

Suggested fix: Pin all git resolver references to specific commit SHAs rather than branch names.

- name: pathInRepo
value: tasks/dummy-check/0.1/dummy-check.yaml
Loading
Loading