Skip to content

Conversation

@desmax74
Copy link
Collaborator

@desmax74 desmax74 commented Oct 30, 2025

Summary by Sourcery

Add build nudge configuration and flags to Tekton push pipelines and refine event filtering for operator 1.1.z.

Enhancements:

  • Introduce build-nudge-files annotation in operator and bundle push pipelines to watch specific file patterns
  • Add build-source-image and hermetic parameters to pipeline specs for both operator and bundle pipelines
  • Update the on-cel-expression in the operator push pipeline to ignore changes within the bundle directory

Signed-off-by: desmax74 <mdessi@redhat.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 30, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR enhances the Tekton push pipelines by adding file-nudge controls, enabling hermetic and source-image builds, and tightening trigger expressions for operator and bundle pushes.

Flow diagram for enhanced Tekton pipeline trigger logic

flowchart TD
  A["Git push event"] --> B["Check target_branch == release/1.1.z"]
  B --> C["Check files do not match bundle/* (operator-1-1-z-push only)"]
  C --> D["Trigger pipeline if conditions met"]
  D --> E["Set build-source-image = true"]
  E --> F["Set hermetic = true"]
  F --> G["Use nudge files for build: .*Dockerfile.*, .*.yaml, .*Containerfile.*, .*.json"]
Loading

File-Level Changes

Change Details Files
Add file-nudge pattern metadata to trigger builds only on relevant file changes
  • Introduce build-nudge-files annotation in pipeline metadata
  • Specify Regex for Dockerfile, YAML, Containerfile, and JSON patterns
.tekton/operator-1-1-z-push.yaml
.tekton/operator-bundle-1-1-z-push.yaml
Refine and consolidate Cel trigger expressions
  • Merge broken Cel lines into single on-cel-expression
  • Restrict operator pipeline to exclude changes under bundle/
  • Ensure bundle pipeline still triggers only on release/1.1.z pushes
.tekton/operator-1-1-z-push.yaml
.tekton/operator-bundle-1-1-z-push.yaml
Enable hermetic and source-image build modes
  • Add build-source-image=true parameter
  • Add hermetic=true parameter
.tekton/operator-1-1-z-push.yaml
.tekton/operator-bundle-1-1-z-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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Standardize the build-nudge-files regex across both YAMLs to remove stray spaces and ensure consistency.
  • Extract the duplicated build-source-image and hermetic parameters into a shared template or snippet to reduce drift.
  • If bundle changes should be excluded like in the operator pipeline, apply the same !files.all.all(f, f.matches('bundle/')) filter in the bundle trigger.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Standardize the build-nudge-files regex across both YAMLs to remove stray spaces and ensure consistency.
- Extract the duplicated build-source-image and hermetic parameters into a shared template or snippet to reduce drift.
- If bundle changes should be excluded like in the operator pipeline, apply the same !files.all.all(f, f.matches('bundle/')) filter in the bundle trigger.

## Individual Comments

### Comment 1
<location> `.tekton/operator-bundle-1-1-z-push.yaml:8` </location>
<code_context>
     build.appstudio.openshift.io/repo: https://github.com/trustification/trusted-profile-analyzer-operator?rev={{revision}}
     build.appstudio.redhat.com/commit_sha: '{{revision}}'
     build.appstudio.redhat.com/target_branch: '{{target_branch}}'
+    build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*, .*.yaml, .*Containerfile.*., .*.json"
     pipelinesascode.tekton.dev/cancel-in-progress: "false"
     pipelinesascode.tekton.dev/max-keep-runs: "3"
</code_context>

<issue_to_address>
**suggestion:** Inconsistent punctuation in build-nudge-files pattern may affect matching.

The extra period after 'Containerfile.*.' may cause unintended matching behavior. Please verify and correct the pattern as needed.

```suggestion
    build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*, .*.yaml, .*Containerfile.*, .*.json"
```
</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.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@desmax74
Copy link
Collaborator Author

/retest

@desmax74 desmax74 merged commit 0ca76de into trustification:release/1.1.z Oct 30, 2025
6 checks passed
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.

1 participant