-
Notifications
You must be signed in to change notification settings - Fork 261
konflux: release images when a tag is pushed to the git repo #1926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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]>
Reviewer's GuideThis 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 pipelinesequenceDiagram
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
Class diagram for new and updated Tekton pipeline/task parametersclassDiagram
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
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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 tobats-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 thequay.io/ramalama
organization. Each image receives multiple tags: one matching the commit SHA, another matching the git tag, and thelatest
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
andrelease-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
), aPipeline
(create-release-snapshot.yaml
), and aTask
(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
-
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. ↩
/cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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.
LGTM |
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
. ThisSnapshot
will be tested using thebats-integration
test, and on successful completion the images in theSnapshot
will be pushed to their respective repos in thequay.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. Thelatest
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:
Enhancements:
CI: