Skip to content

Red Hat Konflux kflux-prd-rh03 update task-sast-snyk-check-sdist - #308

Open
red-hat-konflux-kflux-prd-rh03[bot] wants to merge 1 commit into
mainfrom
konflux-task-sast-snyk-check-sdist
Open

Red Hat Konflux kflux-prd-rh03 update task-sast-snyk-check-sdist#308
red-hat-konflux-kflux-prd-rh03[bot] wants to merge 1 commit into
mainfrom
konflux-task-sast-snyk-check-sdist

Conversation

@red-hat-konflux-kflux-prd-rh03

@red-hat-konflux-kflux-prd-rh03 red-hat-konflux-kflux-prd-rh03 Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Pipelines as Code configuration proposal

To start the PipelineRun, add a new comment with content /ok-to-test

For more detailed information about running a PipelineRun, please refer to Pipelines as Code documentation Running the PipelineRun

To customize the proposed PipelineRuns after merge, please refer to Build Pipeline customization

Please follow the block sequence indentation style introduced by the proprosed PipelineRuns YAMLs, or keep using consistent indentation level through your customized PipelineRuns. When different levels are mixed, it will be changed to the proposed style.

Summary by Sourcery

Add Tekton PipelineRun definitions to build and scan the task-sast-snyk-check-sdist image on pull requests and pushes to main.

Build:

  • Introduce pull-request PipelineRun that builds the task-sast-snyk-check-sdist container image, creates an image index, runs SAST checks, and tags the image in Konflux.
  • Introduce push PipelineRun that builds and tags the task-sast-snyk-check-sdist container image on main branch updates with SAST scanning enabled.

Signed-off-by: red-hat-konflux-kflux-prd-rh03 <konflux@no-reply.konflux-ci.dev>
@sourcery-ai

sourcery-ai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds two Konflux Pipelines-as-Code Tekton PipelineRun definitions for the task-sast-snyk-check-sdist component, one triggered on pull requests to main and one on pushes to main, both building an image, creating an image index, and running SAST checks before tagging the resulting image.

Sequence diagram for task-sast-snyk-check-sdist Tekton PipelineRun (PR and push)

sequenceDiagram
    actor Developer
    participant PipelinesAsCode
    participant PipelineRun_task_sast_snyk_check_sdist
    participant Task_init
    participant Task_clone_repository
    participant Task_prefetch_dependencies
    participant Task_build_container
    participant Task_build_image_index
    participant Task_sast_shell_check
    participant Task_sast_unicode_check
    participant Task_apply_tags

    Developer->>PipelinesAsCode: /ok-to-test or git push
    alt [event == pull_request && target_branch == main]
        PipelinesAsCode->>PipelineRun_task_sast_snyk_check_sdist: start task-sast-snyk-check-sdist-pull-request
    else [event == push && target_branch == main]
        PipelinesAsCode->>PipelineRun_task_sast_snyk_check_sdist: start task-sast-snyk-check-sdist-push
    end

    PipelineRun_task_sast_snyk_check_sdist->>Task_init: task-init
    Task_init-->>PipelineRun_task_sast_snyk_check_sdist: enable-cache-proxy

    PipelineRun_task_sast_snyk_check_sdist->>Task_clone_repository: git-clone-oci-ta
    Task_clone_repository-->>PipelineRun_task_sast_snyk_check_sdist: SOURCE_ARTIFACT, commit, url

    PipelineRun_task_sast_snyk_check_sdist->>Task_prefetch_dependencies: prefetch-dependencies-oci-ta
    Task_prefetch_dependencies-->>PipelineRun_task_sast_snyk_check_sdist: SOURCE_ARTIFACT, CACHI2_ARTIFACT

    PipelineRun_task_sast_snyk_check_sdist->>Task_build_container: tkn-bundle-oci-ta
    Task_build_container-->>PipelineRun_task_sast_snyk_check_sdist: IMAGE_URL, IMAGE_DIGEST

    PipelineRun_task_sast_snyk_check_sdist->>Task_build_image_index: build-image-index
    Task_build_image_index-->>PipelineRun_task_sast_snyk_check_sdist: IMAGE_URL, IMAGE_DIGEST

    alt [skip-checks == "false"]
        PipelineRun_task_sast_snyk_check_sdist->>Task_sast_shell_check: sast-shell-check-oci-ta
        PipelineRun_task_sast_snyk_check_sdist->>Task_sast_unicode_check: sast-unicode-check-oci-ta
    end

    PipelineRun_task_sast_snyk_check_sdist->>Task_apply_tags: apply-tags
    Task_apply_tags-->>PipelineRun_task_sast_snyk_check_sdist: tagged IMAGE_URL, IMAGE_DIGEST
Loading

File-Level Changes

Change Details Files
Introduce a pull-request-triggered PipelineRun for building and scanning the task-sast-snyk-check-sdist image.
  • Define PipelineRun metadata, labels, namespace, and Pipelines-as-Code annotations for PR events targeting the main branch with cancel-in-progress enabled.
  • Configure parameters for git source, revision, output image naming with an on-pr tag, Dockerfile path, build behavior (hermetic, prefetch, cache proxies), scan target directories, and image index behavior.
  • Declare pipeline results wiring IMAGE_URL/IMAGE_DIGEST from the image index task and git metadata from the clone task for chains.
  • Configure a sequence of reusable bundle-based tasks: init, git-clone via OCI, dependency prefetch via OCI, container build via tkn-bundle, image index build, SAST shell and unicode checks gated by skip-checks, and final apply-tags.
  • Set workspaces, taskRunTemplate serviceAccount, and git-auth secret binding for authenticating to the repository.
.tekton/task-sast-snyk-check-sdist-pull-request.yaml
Introduce a push-triggered PipelineRun for building and scanning the task-sast-snyk-check-sdist image for main branch pushes.
  • Define PipelineRun metadata, labels, namespace, and Pipelines-as-Code annotations for push events to the main branch with cancel-in-progress disabled.
  • Configure parameters similarly to the PR pipeline but with output image naming tied directly to the commit revision tag.
  • Reuse the same pipelineSpec structure: params, results, and the ordered set of tasks (init, git-clone-oci, prefetch-dependencies, build-container, build-image-index, SAST shell/unicode checks with conditional execution, and apply-tags).
  • Configure workspaces, serviceAccount, and git-auth secret in the same way as the PR pipeline for consistent credentials handling.
.tekton/task-sast-snyk-check-sdist-push.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've found 2 issues, and left some high level feedback:

  • The pull-request and push PipelineRun YAMLs are nearly identical apart from trigger/metadata and a few param values; consider extracting the common pipelineSpec into a shared Pipeline (or a reusable template) and having each PipelineRun reference it to reduce duplication and future drift.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The pull-request and push PipelineRun YAMLs are nearly identical apart from trigger/metadata and a few param values; consider extracting the common `pipelineSpec` into a shared Pipeline (or a reusable template) and having each PipelineRun reference it to reduce duplication and future drift.

## Individual Comments

### Comment 1
<location path=".tekton/task-sast-snyk-check-sdist-pull-request.yaml" line_range="53-62" />
<code_context>
+        1h, 2d, 3w for hours, days, and weeks, respectively.
+      name: image-expires-after
+      type: string
+    - default: "false"
+      description: Build a source image.
+      name: build-source-image
+      type: string
+    - default: "false"
+      description: Add built image into an OCI image index
+      name: build-image-index
+      type: string
+    - default: "false"
+      description: Enable cache proxy configuration
+      name: enable-cache-proxy
+    - default: "true"
+      description: Use the package registry proxy when prefetching dependencies
</code_context>
<issue_to_address>
**issue (bug_risk):** Explicitly set a `type` for the `enable-cache-proxy` param.

In Tekton v1, params without explicit `type` can cause validation or runtime quirks. Please add `type: string` for `enable-cache-proxy` here (and in the corresponding push PipelineRun) to keep param types consistent and avoid subtle pipeline-spec issues.
</issue_to_address>

### Comment 2
<location path=".tekton/task-sast-snyk-check-sdist-push.yaml" line_range="50-59" />
<code_context>
+        1h, 2d, 3w for hours, days, and weeks, respectively.
+      name: image-expires-after
+      type: string
+    - default: "false"
+      description: Build a source image.
+      name: build-source-image
+      type: string
+    - default: "false"
+      description: Add built image into an OCI image index
+      name: build-image-index
+      type: string
+    - default: "false"
+      description: Enable cache proxy configuration
+      name: enable-cache-proxy
+    - default: "true"
+      description: Use the package registry proxy when prefetching dependencies
</code_context>
<issue_to_address>
**issue:** Add a `type` to `enable-cache-proxy` here as well to match the PR pipeline.

To keep this in sync with the PR PipelineRun and avoid any Tekton validation differences, please add an explicit `type: string` for `enable-cache-proxy`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +53 to +62
- default: "false"
description: Skip checks against built image
name: skip-checks
type: string
- default: "false"
description: Execute the build with network isolation
name: hermetic
type: string
- default: ""
description: Build dependencies to be prefetched

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Explicitly set a type for the enable-cache-proxy param.

In Tekton v1, params without explicit type can cause validation or runtime quirks. Please add type: string for enable-cache-proxy here (and in the corresponding push PipelineRun) to keep param types consistent and avoid subtle pipeline-spec issues.

Comment on lines +50 to +59
- default: "false"
description: Skip checks against built image
name: skip-checks
type: string
- default: "false"
description: Execute the build with network isolation
name: hermetic
type: string
- default: ""
description: Build dependencies to be prefetched

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: Add a type to enable-cache-proxy here as well to match the PR pipeline.

To keep this in sync with the PR PipelineRun and avoid any Tekton validation differences, please add an explicit type: string for enable-cache-proxy.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants