Skip to content
Open
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
172 changes: 172 additions & 0 deletions pipelines/enterprise-contract/0.1/enterprise-contract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Copyright The Conforma Contributors

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] document-format

Missing YAML document separator ('---') at the top of the file. All existing Tekton resource files in tasks/ start with '---' before the copyright header.

Suggested fix: Add '---' as the first line of the file, before the copyright comment.

#
# 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

# The purpose of this pipeline is to execute the verify-enterprise-contract-v2 task for container

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] license-header

The new pipeline file is missing the standard Apache-2.0 license header. Every existing YAML definition in tasks/ starts with the Copyright The Conforma Contributors / Apache-2.0 / SPDX-License-Identifier block. The Makefile's addlicense check covers all tracked files and pipelines/ is not in the ignore list, so CI will flag this.

Suggested fix: Add the standard Apache-2.0 license header at the top of the file, before the purpose comment, matching the format in tasks/*.yaml.

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] stale-reference

The header comment says 'execute the verify-enterprise-contract-v2 task' but the actual task referenced is verify-enterprise-contract (no v2 suffix). No v2 variant exists in the repository.

Suggested fix: Change the comment to say 'verify-enterprise-contract task'.

# images that are built but not automatically released in order to provide early feedback to users.

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] stale-reference

The comment states 'execute the verify-enterprise-contract-v2 task' but the pipeline's taskRef references 'verify-enterprise-contract' (without '-v2'). No task named 'verify-enterprise-contract-v2' exists in the repository.

Suggested fix: Change the comment to reference 'verify-enterprise-contract' instead of 'verify-enterprise-contract-v2'.

# When auto release is enabled, the task is executed by the release pipeline immediately after the
# container images are built, thus it is not necessary to execute the task via this pipeline.
Comment on lines +17 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. Stale v2 task comment 🐞 Bug ⚙ Maintainability

The pipeline header comment says it runs verify-enterprise-contract-v2, but the Pipeline actually
resolves and runs verify-enterprise-contract, which can mislead maintainers and cause incorrect
updates/debugging.
Agent Prompt
### Issue description
The pipeline header comment references `verify-enterprise-contract-v2`, but the pipeline taskRef resolves `verify-enterprise-contract`.

### Issue Context
This is a documentation mismatch that can confuse future maintenance (e.g., someone searching for “v2” or trying to bump the wrong task).

### Fix Focus Areas
- pipelines/enterprise-contract/0.1/enterprise-contract.yaml[1-4]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:

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] metadata-annotations

The pipeline metadata has no annotations block. All existing Tekton definitions in this repo include tekton.dev/displayName, tekton.dev/pipelines.minVersion, and tekton.dev/tags annotations.

Suggested fix: Add annotations: tekton.dev/displayName: Enterprise Contract, tekton.dev/pipelines.minVersion: '0.19', tekton.dev/tags: ec, chains, signature, conftest.

name: enterprise-contract
Comment thread
coderabbitai[bot] marked this conversation as resolved.
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] metadata-labels

Missing app.kubernetes.io/version: '0.1' label. All existing definitions in tasks/ include this standard Kubernetes label.

Suggested fix: Add app.kubernetes.io/version: '0.1' to the labels block.

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] metadata-consistency

The pipeline metadata lacks annotations (tekton.dev/displayName, tekton.dev/pipelines.minVersion, tekton.dev/tags) and the app.kubernetes.io/version label that all task definitions in this repo include.

build.appstudio.redhat.com/pipeline: "enterprise-contract"
Comment on lines +23 to +26

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational

2. Missing pipeline catalog metadata 🐞 Bug ⚙ Maintainability

The enterprise-contract Pipeline lacks the standard Tekton metadata used on tasks in this repo
(e.g., app.kubernetes.io/version and tekton.dev/displayName/tags/minVersion), reducing
discoverability and consistency for publishing/consuming it as a versioned catalog artifact.
Agent Prompt
### Issue description
The pipeline is stored under a versioned directory (`pipelines/.../0.1/`) but its `metadata` does not include the common catalog metadata (version label and Tekton display/tags/minVersion annotations) that the repo’s tasks include.

### Issue Context
Tasks in `tasks/*/0.1/*.yaml` consistently set these fields; adding the same style to the pipeline improves consistency and downstream catalog UX.

### Fix Focus Areas
- pipelines/enterprise-contract/0.1/enterprise-contract.yaml[7-10]
- tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[20-28]
- tasks/collect-keyless-params/0.1/collect-keyless-params.yaml[20-27]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

spec:
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] api-contract

The pipeline does not expose or pass the task's SINGLE_COMPONENT_CUSTOM_RESOURCE_NS parameter. When SINGLE_COMPONENT=true, the task will use its default (empty string). Not a functional failure, but an incomplete interface for the single-component flow.

Suggested fix: Add a SINGLE_COMPONENT_CUSTOM_RESOURCE_NS parameter to the pipeline for interface completeness, or document that the pipeline relies on the task's default namespace behavior.

- 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:latest"
}
]
}
Each "containerImage" in the "components" array is validated.
- name: POLICY_CONFIGURATION
type: string
description: |

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] api-contract

The POLICY_CONFIGURATION description refers to 'EnterpriseContractConfiguration object' but the correct type name is 'EnterpriseContractPolicy', used consistently throughout the codebase and in the downstream task's own description.

Suggested fix: Change 'EnterpriseContractConfiguration' to 'EnterpriseContractPolicy'.

Name of the policy configuration (EnterpriseContractConfiguration
object) to use. `namespace/name` or `name` syntax supported. If

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] api-contract

The POLICY_CONFIGURATION parameter description refers to 'EnterpriseContractConfiguration object', but the underlying task describes the same parameter as 'EnterpriseContractPolicy resource'. The pipeline uses a different type name that does not match the actual Kubernetes CRD kind consumed by the task.

Suggested fix: Align the description with the task's description, using 'EnterpriseContractPolicy resource'.

namespace is omitted the namespace where the task runs is used.

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

The POLICY_CONFIGURATION default value is unquoted (default: enterprise-contract-service/default) while the established pattern in existing task definitions consistently quotes string defaults.

Suggested fix: Change to default: "enterprise-contract-service/default".

default: enterprise-contract-service/default
- name: SSL_CERT_DIR
Comment on lines +42 to +49

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational

3. Misleading param descriptions 🐞 Bug ⚙ Maintainability

Pipeline param documentation diverges from the underlying verify-enterprise-contract task (e.g.,
POLICY_CONFIGURATION is described as an EnterpriseContractConfiguration object, while the task
describes an EnterpriseContractPolicy resource), increasing the risk of misconfiguration by pipeline
consumers.
Agent Prompt
### Issue description
The Pipeline’s parameter descriptions are not consistent with the task it invokes, which can mislead users configuring the Pipeline.

### Issue Context
`POLICY_CONFIGURATION` is passed directly into the `verify-enterprise-contract` task, so the Pipeline should document the same semantics/value format as the task.

### Fix Focus Areas
- pipelines/enterprise-contract/0.1/enterprise-contract.yaml[26-33]
- pipelines/enterprise-contract/0.1/enterprise-contract.yaml[70-73]
- tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[49-57]
- tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml[198-210]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

type: string
description: |
Path to a directory containing SSL certs to be used when communicating
with external services. This is useful when using the integrated registry
and a local instance of Rekor on a development cluster which may use
certificates issued by a not-commonly trusted root CA. In such cases,
"/var/run/secrets/kubernetes.io/serviceaccount" is a good value. Multiple
paths can be provided by using the ":" separator.
default: ""
- name: PUBLIC_KEY
type: string
default: "k8s://openshift-pipelines/public-key"
description: |
Public key used to verify signatures. Must be a valid k8s cosign
reference, e.g. k8s://my-space/my-secret where my-secret contains
the expected cosign.pub attribute.
- name: WORKERS
type: string
description: Number of parallel workers to use for policy evaluation.
default: "1"
- name: CA_TRUST_CONFIGMAP_NAME
type: string
description: The name of the ConfigMap to read CA bundle data from.
default: "trusted-ca"
- name: CA_TRUST_CONFIG_MAP_KEY
type: string
description: The name of the key in the ConfigMap that contains the CA bundle data.
default: "ca-bundle.crt"
- name: EXTRA_RULE_DATA
type: string
description: Merge additional Rego variables into the policy data. Use syntax "key=value,key2=value2..."
default: ""
- name: SINGLE_COMPONENT
type: string
description: Reduce the Snapshot to only the component whose build caused the Snapshot to be created
default: "false"
- name: SINGLE_COMPONENT_CUSTOM_RESOURCE
type: string
description: PipelineRun ID
default: "pr/$(context.pipelineRun.name)"
- name: STRICT
type: string
description: |
A boolean flag that determines whether the result of the test will mark the TaskRun as passing or not.
Swap to false to make the IntegrationTestScenario informative.

Setting to false is useful on specific conditions but will always mark the integration test as successful and
humans will tend to ignore the test results if they failed. Use with caution.
default: "true"
- name: EFFECTIVE_TIME
type: string
description: Run policy checks with the provided time. Expects a
RFC3339 formatted value, e.g. "2026-06-24T00:00:00Z"
default: "now"
results:
- name: TEST_OUTPUT
value: "$(tasks.verify.results.TEST_OUTPUT)"
tasks:
- name: collect-keyless-params
taskRef:
resolver: bundles
params:
- name: bundle
value: quay.io/conforma/tekton-task:konflux
- name: name
value: collect-keyless-params
- name: kind
value: task
- name: verify
runAfter:
- collect-keyless-params
params:
- name: POLICY_CONFIGURATION
value: "$(params.POLICY_CONFIGURATION)"
- name: IMAGES
value: "$(params.SNAPSHOT)"
- name: SSL_CERT_DIR
value: "$(params.SSL_CERT_DIR)"
- name: STRICT
value: "$(params.STRICT)"

- name: PUBLIC_KEY
# PUBLIC_KEY will be ignored if any of the CERTIFICATE_* params are present
value: "$(params.PUBLIC_KEY)"
- name: IGNORE_REKOR
# Set this true because Chains in default Konflux does not create Rekor entries
# when signing things. It will be ignored if any of the CERTIFICATE_* params
# because keyless verification does require Rekor.
value: "true"

- name: CERTIFICATE_OIDC_ISSUER
value: "$(tasks.collect-keyless-params.results.defaultOIDCIssuer)"
- name: CERTIFICATE_IDENTITY
value: "$(tasks.collect-keyless-params.results.tektonChainsIdentity)"
- name: TUF_MIRROR
value: "$(tasks.collect-keyless-params.results.tufUrl)"
- name: REKOR_HOST
value: "$(tasks.collect-keyless-params.results.rekorUrl)"
Comment on lines +108 to +147

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
rg -n 'CERTIFICATE_IDENTITY_REGEXP|buildIdentityRegexp' -g '*.yaml'

Repository: conforma/cli

Length of output: 150


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file existence and relevant snippets =="
if [ -f pipelines/enterprise-contract/0.1/enterprise-contract.yaml ]; then
  nl -ba pipelines/enterprise-contract/0.1/enterprise-contract.yaml | sed -n '1,180p'
else
  echo "missing pipelines/enterprise-contract/0.1/enterprise-contract.yaml"
fi

echo
echo "== tracked yaml files mentioning relevant params/results =="
rg -n 'collect-keyless-params|buildIdentityRegexp|CERTIFICATE_IDENTITY_REGEXP|tektonChainsIdentity|defaultOIDCIssuer' -g '*.yaml' || true

echo
echo "== repository-wide occurrences =="
rg -n 'collect-keyless-params|buildIdentityRegexp|CERTIFICATE_IDENTITY_REGEXP|tektonChainsIdentity|defaultOIDCIssuer' || true

Repository: conforma/cli

Length of output: 233


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file existence =="
test -f pipelines/enterprise-contract/0.1/enterprise-contract.yaml && echo "present" || echo "missing"
test -d pipelines/enterprise-contract/0.1 && echo "dir present" || echo "dir missing"
find pipelines -maxdepth 3 -type f 2>/dev/null || true

echo
echo "== relevant snippets using cat -n =="
if [ -f pipelines/enterprise-contract/0.1/enterprise-contract.yaml ]; then
  cat -n pipelines/enterprise-contract/0.1/enterprise-contract.yaml | sed -n '1,180p'
fi

echo
echo "== tracked yaml files mentioning relevant params/results =="
rg -n 'collect-keyless-params|buildIdentityRegexp|CERTIFICATE_IDENTITY_REGEXP|tektonChainsIdentity|defaultOIDCIssuer' -g '*.yaml' . || true

echo
echo "== repository-wide occurrences =="
rg -n 'collect-keyless-params|buildIdentityRegexp|CERTIFICATE_IDENTITY_REGEXP|tektonChainsIdentity|defaultOIDCIssuer' . || true

Repository: conforma/cli

Length of output: 25892


Wire collect-keyless-params.buildIdentityRegexp into verify.

collect-keyless-params reads and emits buildIdentityRegexp, and verify-enterprise-contract supports CERTIFICATE_IDENTITY_REGEXP for regex-based keyless identity matching, but this pipeline only passes tektonChainsIdentity as CERTIFICATE_IDENTITY. Clusters/configs that rely on the regex identity are using an exact match instead.

Proposed fix
         - name: CERTIFICATE_IDENTITY
           value: "$(tasks.collect-keyless-params.results.tektonChainsIdentity)"
+        - name: CERTIFICATE_IDENTITY_REGEXP
+          value: "$(tasks.collect-keyless-params.results.buildIdentityRegexp)"
         - name: TUF_MIRROR
           value: "$(tasks.collect-keyless-params.results.tufUrl)"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: collect-keyless-params
taskRef:
resolver: bundles
params:
- name: bundle
value: quay.io/conforma/tekton-task:konflux
- name: name
value: collect-keyless-params
- name: kind
value: task
- name: verify
runAfter:
- collect-keyless-params
params:
- name: POLICY_CONFIGURATION
value: "$(params.POLICY_CONFIGURATION)"
- name: IMAGES
value: "$(params.SNAPSHOT)"
- name: SSL_CERT_DIR
value: "$(params.SSL_CERT_DIR)"
- name: STRICT
value: "$(params.STRICT)"
- name: PUBLIC_KEY
# PUBLIC_KEY will be ignored if any of the CERTIFICATE_* params are present
value: "$(params.PUBLIC_KEY)"
- name: IGNORE_REKOR
# Set this true because Chains in default Konflux does not create Rekor entries
# when signing things. It will be ignored if any of the CERTIFICATE_* params
# because keyless verification does require Rekor.
value: "true"
- name: CERTIFICATE_OIDC_ISSUER
value: "$(tasks.collect-keyless-params.results.defaultOIDCIssuer)"
- name: CERTIFICATE_IDENTITY
value: "$(tasks.collect-keyless-params.results.tektonChainsIdentity)"
- name: TUF_MIRROR
value: "$(tasks.collect-keyless-params.results.tufUrl)"
- name: REKOR_HOST
value: "$(tasks.collect-keyless-params.results.rekorUrl)"
- name: collect-keyless-params
taskRef:
resolver: bundles
params:
- name: bundle
value: quay.io/conforma/tekton-task:konflux
- name: name
value: collect-keyless-params
- name: kind
value: task
- name: verify
runAfter:
- collect-keyless-params
params:
- name: POLICY_CONFIGURATION
value: "$(params.POLICY_CONFIGURATION)"
- name: IMAGES
value: "$(params.SNAPSHOT)"
- name: SSL_CERT_DIR
value: "$(params.SSL_CERT_DIR)"
- name: STRICT
value: "$(params.STRICT)"
- name: PUBLIC_KEY
# PUBLIC_KEY will be ignored if any of the CERTIFICATE_* params are present
value: "$(params.PUBLIC_KEY)"
- name: IGNORE_REKOR
# Set this true because Chains in default Konflux does not create Rekor entries
# when signing things. It will be ignored if any of the CERTIFICATE_* params
# because keyless verification does require Rekor.
value: "true"
- name: CERTIFICATE_OIDC_ISSUER
value: "$(tasks.collect-keyless-params.results.defaultOIDCIssuer)"
- name: CERTIFICATE_IDENTITY
value: "$(tasks.collect-keyless-params.results.tektonChainsIdentity)"
- name: CERTIFICATE_IDENTITY_REGEXP
value: "$(tasks.collect-keyless-params.results.buildIdentityRegexp)"
- name: TUF_MIRROR
value: "$(tasks.collect-keyless-params.results.tufUrl)"
- name: REKOR_HOST
value: "$(tasks.collect-keyless-params.results.rekorUrl)"
🤖 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 `@pipelines/enterprise-contract/0.1/enterprise-contract.yaml` around lines 92 -
131, Update the verify task parameters to pass the collect-keyless-params
buildIdentityRegexp result as CERTIFICATE_IDENTITY_REGEXP. Keep the existing
CERTIFICATE_IDENTITY mapping to tektonChainsIdentity unchanged, so verify
receives both exact and regex-based keyless identity configuration.


- name: WORKERS
value: "$(params.WORKERS)"
- name: CA_TRUST_CONFIGMAP_NAME
value: "$(params.CA_TRUST_CONFIGMAP_NAME)"
- name: CA_TRUST_CONFIG_MAP_KEY
value: "$(params.CA_TRUST_CONFIG_MAP_KEY)"
- name: EXTRA_RULE_DATA
value: "$(params.EXTRA_RULE_DATA)"
- name: SINGLE_COMPONENT
value: "$(params.SINGLE_COMPONENT)"
- name: SINGLE_COMPONENT_CUSTOM_RESOURCE
value: "$(params.SINGLE_COMPONENT_CUSTOM_RESOURCE)"
- name: EFFECTIVE_TIME
value: "$(params.EFFECTIVE_TIME)"
taskRef:
resolver: bundles
params:
- name: bundle
value: quay.io/conforma/tekton-task:konflux
- name: name
value: verify-enterprise-contract
- name: kind
value: task
timeout: 4h
Loading