Automate image versioning #337
Labels
No labels
Backlog Status
Needs Review
Backlog Status
Ready
Chore
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forge/forge#337
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For now, the image build workflow is following:
push to a branch (forge-staging, forge-production, src-staging, src-production) => generates an empty commit to oci-image-definition repo, which now does not serve for much because => the version must be manually increased on oci-image-definition repo => push to oci-image-definition triggers image build (isolated only to the pipeline defined in the on-cel-expression)
The desired automated workflow would be:
push to one of the branches we build the image from => this triggers an action that does the following steps and the result is a fresh and tagged image on quay without any manual action:
The action:
Gets the current forgejo upstream tag
I'd suggest taking the forgejo version from a tag that forgejo upstream is using:
git describe --tags --abbrev=0, which as an example now equals tov13.0.4orgit describe --tagswhich in current state of things givesv13.0.4-17-ge1a1ab4ddf(latest upstream version - number of our commits on top - git hash of the last upstream tagged commit).Modifies to our versioning
Currently the versioning we use is for example 13.0.4-1 (forgejo upstream version - our version of it. Goes up to 13.0.4-2 and more until there is new minor release, from which we start the count from 1 again: 13.0.5-1)
I see three options:
2.1. We could keep it as it is, but automate it. That means make a script that gets the latest forgejo upstream version and bumps the second number +1. If the minor version increased, start from 1. This is possible, but I find it a bit cumbersome.
2.2. We could change it to 13.0.4-5cc0f00ae3 (latest forgejo upstream - our last git commit sha). We would know immediately from which exact commit each of the builds is.
2.3. We could use the v13.0.4-17-ge1a1ab4ddf format, the direct result of
git describe --tags. The simplest option, no additional script needed, and we know exactly the latest forgejo version, latest forgejo upstream commit + the number of our commits on top. My personal favorite solution.Modifies the VERSION file in the oci-image-definition repo with that version and pushes it to oci-image-definition
This starts a build of the respective image(s)
After discussion on a team standup, it was decided to go with the option 2.2:
forgejo upstream tag-our branch last commitRelated PR here: https://codeberg.org/fedora/forgejo/pulls/82
Tagging now looks like this:
quay.io/konflux-fedora/fedora-infra-tenant/forgejo-oci-images-src-staging-stable:vv14.0.2-3dcf904db1Two things:
Option 1: follow "rpm packing style" adding a +1 number: v14.0.2-3dcf904db1-1, v14.0.2-3dcf904db1-2, ... Maybe cleaner, but might be difficult to see which commit the -1, -2 are build from.
Option 2: v14.0.2-3dcf904db1-2f146b5f9a, which is forgejo_upstream_tag - fedora/forgejo_last_git_sha - fedora/oci-image-definition_last_git_sha. Advantage: we know which commits exactly the image is built from. Disadvantage - might be a bit less esthetic?
Example of a new image tag: quay.io/konflux-fedora/fedora-infra-tenant/forgejo-oci-images-src-staging-stable:v14.0.2-1de02-210cb
'v14.0.2-1de02-210cb' => latest forgejo upstream tag - fedora/forgejo last commit git sha (depends on branch, 5 char) - oci-image-definition last commit git sha (5char).