Skip to content

test: run ITS pipeline e2e checks on pull requests - #3574

Draft
dheerajodha wants to merge 1 commit into
conforma:mainfrom
dheerajodha:codex/ec-1943-its-pr-ci
Draft

dheerajodha wants to merge 1 commit into
conforma:mainfrom
dheerajodha:codex/ec-1943-its-pr-ci

Conversation

@dheerajodha

Copy link
Copy Markdown
Contributor

Changes to the enterprise-contract ITS pipeline currently have no dedicated pre-merge E2E run. Add a Pipelines-as-Code trigger for PRs targeting main that change the ITS pipeline or this trigger. It runs only the ITS suite and reports the result on the CLI PR.

The test runner and suite are pinned independently of the pipeline under test. The ITS definition is resolved from the PR source URL and exact commit SHA, including fork PRs. The pipeline retains its task bundle references; this check does not build a custom CLI image.

Depends on conforma/e2e-tests#12 (EC-1943). Keep this PR in draft until that change is merged. Both runner/test pins currently reference its commit 715c96ced8341ce10f5ab5b800ddcdec8b3d9e79; if it is squash-merged, replace both with the resulting upstream commit before testing/merging this PR.

Validation: Tekton Pipeline and PipelineRun validation passed using the E2E repository's Tekton API types. Parameter propagation from the trigger through the runner to the ITS environment was checked. The ITS suite compiles and all three scenarios are selected in a dry run. A live run could not be performed because the configured cluster hostname does not resolve.

Rollout still required: demonstrate a passing run and a failing run with an intentionally broken task bundle reference. Confirm both results belong to the CLI PR head SHA. This PR creates the check; it does not change GitHub merge rules. Because the trigger is path-filtered, do not add it as an unconditional required check without arranging a reported result for unrelated PRs. Complete that merge-rule integration before closing EC-1943.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: low (1/5)

Details

Single small Tekton PipelineRun config file (54 lines) added under .tekton/. No protected paths, no security-sensitive content per the metadata script, no dependency changes, no GitHub Actions workflow changes. Author is a known human contributor. Tier 2 applies the all-files-new moderate baseline of 2. Weighted composite (Tier 1 62% x 1.125 + Tier 2 38% x 2) = 1.46, rounds to 1 (low). Note: this baseline score does not reflect the fork-code-execution risk raised as a high finding, which is qualitative and outside the Tier 1 signal set.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

High

  • [supply-chain / unmerged-dependency-pin] .tekton/cli-its-pull-request.yaml:50 — Both spec.params[revision] (line 26) and spec.pipelineRef.params[revision] (line 50) pin the runner and the ITS pipeline resolver to conforma/e2e-tests SHA 715c96ced8341ce10f5ab5b800ddcdec8b3d9e79, which is the HEAD of the still-open PR feat: add e2e test coverage for the ITS pipeline e2e-tests#12. That commit has not landed on the e2e-tests main branch, so the pipeline being executed here has not cleared its own repo's review/merge gate. If Acceptance tests #12 is squash-merged (GitHub's default), the resulting merge commit will have a different SHA and both pins will silently reference an orphaned commit. The inline comment on line 43 claims the revision is "reviewed", but the reviewed gate for e2e-tests is merge to main.
    Remediation: Block merge until feat: add e2e test coverage for the ITS pipeline e2e-tests#12 is merged to main, then update both revision values (line 26 and line 50) to the resulting upstream merge-commit SHA. The PR body already flags this; keep the PR in draft until the dependency lands.

  • [fork-controlled-code-with-secrets] .tekton/cli-its-pull-request.yaml:38 — Params its-pipeline-repo-url: '{{source_url}}' (line 36) and its-pipeline-revision: '{{revision}}' (line 38) cause the runner to fetch and execute an ITS pipeline definition drawn from the PR's source repo/revision. The CEL trigger (pipelinesascode.tekton.dev/on-cel-expression, lines 11–14) only gates on event == "pull_request" and target_branch == "main"; there is no author_association, org-membership, or /ok-to-test guard expressed in this file. A fork-authored PR that touches pipelines/enterprise-contract/** or this trigger file will therefore, once run per the PaC Repository CR policy, cause fork-controlled YAML to be interpreted by the runner in namespace rhtap-contract-tenant under service account konflux-integration-runner with konflux-test-infra (registry creds) and mapt-kind-secret (AWS creds) mounted. Protection today rests entirely on the out-of-band PaC approver gate — the workflow itself does not encode that requirement. This is materially different from the sibling cli-main-pull-request.yaml, which passes {{source_url}}/{{revision}} only to build tasks that consume it as source-to-compile, not as pipeline definition to execute.
    Remediation: Pick one or more of: (a) restrict its-pipeline-repo-url / its-pipeline-revision to the trusted upstream (base repo / base ref) rather than the PR's source; (b) tighten the CEL to require a trusted actor, e.g. body.pull_request.author_association in ['MEMBER','OWNER','COLLABORATOR'], so fork PRs cannot auto-run; or (c) explicitly document and enforce the PaC-level approver gate (/ok-to-test required for fork PRs) on this Repository CR and confirm the setting is enabled. Consider also removing AWS/registry secrets from this PR-triggered variant if they are not needed for the ITS pipeline schema/lint checks it is intended to run.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

- name: url
value: https://github.com/conforma/e2e-tests.git
- name: revision
value: 715c96ced8341ce10f5ab5b800ddcdec8b3d9e79

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

Both spec.params[revision] (line 26) and spec.pipelineRef.params[revision] (line 50) pin to conforma/e2e-tests SHA 715c96ced8341ce10f5ab5b800ddcdec8b3d9e79, which is the HEAD of the still-open PR conforma/e2e-tests#12. That commit has not landed on the e2e-tests main branch, so the pipeline being executed here has not cleared its own repo review/merge gate. If #12 is squash-merged, the resulting merge commit will have a different SHA and both pins here will silently reference an orphaned commit. The inline comment on line 43 claims the revision is reviewed, but the reviewed gate for e2e-tests is merge to main.

Suggested fix: Block merge until conforma/e2e-tests#12 is merged to main, then update both revision values (line 26 and line 50) to the resulting upstream merge-commit SHA. Keep the PR in draft until the dependency lands.

- name: its-pipeline-repo-url
value: '{{source_url}}'
- name: its-pipeline-revision
value: '{{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] fork-controlled-code-with-secrets

Params its-pipeline-repo-url: {{source_url}} (line 36) and its-pipeline-revision: {{revision}} (line 38) cause the runner to fetch and execute an ITS pipeline definition drawn from the PR source repo/revision. The CEL trigger (lines 11-14) only gates on event == pull_request and target_branch == main; there is no author_association, org-membership, or /ok-to-test guard expressed in this file. A fork-authored PR that touches pipelines/enterprise-contract/** or this trigger file will therefore cause fork-controlled YAML to be interpreted by the runner in namespace rhtap-contract-tenant under service account konflux-integration-runner with konflux-test-infra (registry creds) and mapt-kind-secret (AWS creds) mounted. Protection today rests entirely on the out-of-band PaC approver gate.

Suggested fix: Pick one or more of: (a) restrict its-pipeline-repo-url/its-pipeline-revision to the trusted upstream (base repo/base ref); (b) tighten the CEL to require a trusted actor, e.g. body.pull_request.author_association in [MEMBER, OWNER, COLLABORATOR]; or (c) explicitly document and enforce the PaC approver gate (/ok-to-test required for fork PRs) on this Repository CR. Also consider removing AWS/registry secrets from this PR-triggered variant if they are not needed for the ITS pipeline lint/schema checks.

@dheerajodha

Copy link
Copy Markdown
Contributor Author

/retest

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant