Skip to content

Conversation

mikebonnet
Copy link
Collaborator

@mikebonnet mikebonnet commented Sep 10, 2025

Pushing a git tag will trigger a PipelineRun which will collect all the images created by builds associated with the commit the tag was applied to, and create an "override" Snapshot. This Snapshot will be tested using the bats-integration test, and on successful completion the images in the Snapshot will be pushed to their respective repos in the quay.io/ramalama org. Each image will have two tags applied, one matching the commit sha the image was built from, and the other matching the git tag that was pushed. The latest tag will also be updated to reference the newly pushed images.

Summary by Sourcery

Enable automated release of component images to quay.io when a git tag is pushed by assembling an override Snapshot, testing it with bats-integration, and then tagging and pushing images with both the commit SHA, version tags, and latest

New Features:

  • Trigger a Tekton release pipeline when a git tag is pushed to assemble and push release snapshots
  • Create an override Snapshot that aggregates built component images for the tagged commit

Enhancements:

  • Introduce a release-tags parameter throughout integration tasks to apply multiple tags during image copy
  • Extend push-snapshot task to only run for override snapshots and push images for each release tag and latest

CI:

  • Add create-override-snapshot Tekton task and associated pipeline and PipelineRun definitions to automate override snapshot creation on tag events
  • Propagate snapshot-type and release-tags parameters through the init-snapshot and bats-integration pipelines

Pushing a git tag will trigger a PipelineRun which will collect all the
images created by builds associated with the commit the tag was applied
to, and create an "override" Snapshot. This Snapshot will be tested using
the "bats-integration" test, and on successful completion the images in
the Snapshot will be pushed to their respective repos in the
quay.io/ramalama org. Each image will have two tags applied, one matching
the commit sha the image was built from, and the other matching the git
tag that was pushed. The latest tag will also be updated to reference the
newly pushed images.

Signed-off-by: Mike Bonnet <[email protected]>
Copy link
Contributor

sourcery-ai bot commented Sep 10, 2025

Reviewer's Guide

This PR extends the Tekton integration and release pipelines to support git tag–triggered releases by propagating new snapshot-type and release-tags parameters, enhancing push logic to apply multiple tags (including “latest”), and introducing a dedicated override-snapshot task and release pipeline to assemble, test, and push tagged images to Quay.

Sequence diagram for git tag-triggered release pipeline

sequenceDiagram
    actor Developer
    participant GitRepo
    participant Tekton
    participant "create-release-snapshot Pipeline"
    participant "create-override-snapshot Task"
    participant "bats-integration Pipeline"
    participant Quay
    Developer->>GitRepo: Push git tag
    GitRepo->>Tekton: Trigger PipelineRun (ramalama-release-tag)
    Tekton->>"create-release-snapshot Pipeline": Start pipeline with commit/tag info
    "create-release-snapshot Pipeline"->>"create-override-snapshot Task": Collect builds, assemble override Snapshot
    "create-override-snapshot Task"->>Tekton: Create Snapshot resource
    Tekton->>"bats-integration Pipeline": Test Snapshot images
    "bats-integration Pipeline"->>Quay: Push images with commit/tag/latest tags
    Quay-->>Developer: Images available with tags
Loading

Class diagram for new and updated Tekton pipeline/task parameters

classDiagram
    class PushSnapshotTask {
        +event-type: string
        +snapshot-type: string
        +release-tags: string
        +sync: bool
    }
    class InitSnapshotTask {
        +event-type: string
        +snapshot-type: string
        +release-tags: string
        +sync: bool
    }
    class CreateOverrideSnapshotTask {
        +skip: string
        +COMMIT_SHA: string
        +TAG: string
        +LATEST: bool
        +EVENT_TYPE: string
        +NAMESPACE: string
        +SKIP_COMPONENTS: string
        +RESULTS_TEST_OUTPUT_PATH: string
        +release_tags(): list[string]
        +generate(): dict
        +create(): void
        +test_output: dict
    }
    PushSnapshotTask <|-- InitSnapshotTask
    CreateOverrideSnapshotTask ..> PushSnapshotTask : uses snapshot-type, release-tags
Loading

File-Level Changes

Change Details Files
Enhance push-snapshot task to respect override snapshots and multiple release tags
  • Added snapshot-type and release-tags parameters and environment variables
  • Changed skip logic to act on snapshot-type rather than only push events
  • Looped over RELEASE_TAGS to construct additional destination tags for skopeo copy
.tekton/integration/tasks/push-snapshot.yaml
Augment init-snapshot task to handle release-tags and expanded event types
  • Added release-tags parameter and wire it into env and results
  • Modified component_image to treat comment-based events like pull_request
.tekton/integration/tasks/init-snapshot.yaml
Propagate snapshot-type and release-tags through bats-integration pipeline
  • Updated pipeline description to note tag-triggered behavior
  • Mapped snapshot-type and release-tags results from init task to bats-integration params
.tekton/integration/pipelines/bats-integration.yaml
Introduce Python-based override snapshot task for tag releases
  • Implemented logic to fetch component definitions and build PipelineRuns via oc/opc
  • Filtered and sorted successful runs, assembled image list with digest URLs
  • Generated Snapshot CR including custom release-tags annotation and LATEST flag
  • Installed oc/opc, configured Tekton Results, and emitted structured test output
.tekton/release/tasks/create-override-snapshot.yaml
Add release pipeline and trigger for git tag events
  • Created create-release-snapshot pipeline that invokes override snapshot task via git resolver
  • Defined ramalama-release-tag PipelineRun with annotations and labels to fire on v* tag pushes
.tekton/release/pipelines/create-release-snapshot.yaml
.tekton/release/pipelineruns/ramalama-release-tag.yaml

Possibly linked issues

  • Configure Renovate #1: PR ensures 'latest' tag updates only after all images are built and tested, preventing premature updates and platform mismatches.

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
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @mikebonnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements an automated image release pipeline that activates upon a git tag push. It streamlines the process of collecting built images, validating them through integration tests, and then pushing them to the container registry with appropriate versioning and latest tags. The changes ensure a robust and automated release flow for tagged versions of the application components.

Highlights

  • Automated Image Release on Git Tag Push: A new mechanism is introduced to automatically trigger an image release process whenever a git tag (matching v*) is pushed to the repository. This ensures that specific versions of the software are consistently released.
  • Override Snapshot Creation and Testing: Upon a git tag push, a PipelineRun is initiated to collect all images built for the associated commit and create an 'override' Snapshot. This Snapshot is then subjected to bats-integration tests to ensure quality before release.
  • Conditional Image Push and Tagging: If the bats-integration tests succeed, the images within the validated Snapshot are pushed to their respective repositories in the quay.io/ramalama organization. Each image receives multiple tags: one matching the commit SHA, another matching the git tag, and the latest tag is updated to point to the newly released images.
  • Enhanced Tekton Pipeline Parameters: Existing Tekton integration pipelines and tasks have been updated to accept new parameters, specifically snapshot-type and release-tags, enabling more dynamic and context-aware image handling during the release process.
  • New Tekton Release Resources: New Tekton resources, including a PipelineRun (ramalama-release-tag.yaml), a Pipeline (create-release-snapshot.yaml), and a Task (create-override-snapshot.yaml with an accompanying shell script), have been added to orchestrate the entire tag-based release workflow.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mikebonnet
Copy link
Collaborator Author

/cancel

Copy link
Contributor

@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 and they look great!


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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a release pipeline triggered by git tags, which is a great addition for automating releases. The new workflow creates an override Snapshot, tests it, and then pushes the component images with appropriate tags to Quay. The implementation across the Tekton resources and the new Python script is well-structured. I've identified a couple of areas for improvement: a hardcoded URL that impacts portability, and a minor issue in the release tagging logic. Addressing these will make the new release process more robust and maintainable.

@rhatdan
Copy link
Member

rhatdan commented Sep 11, 2025

LGTM

@mikebonnet mikebonnet merged commit 0d740df into main Sep 11, 2025
9 of 46 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.

2 participants