Skip to content

Commit

Permalink
koji: Change release number for NVR
Browse files Browse the repository at this point in the history
 - The release number doesn't need to be random.
It makes things difficult when we need to search for
a NVR name.
 - Let's add a common number in oder to make it easier
to search for a NVR when we need to.

Signed-off-by: Renata Ravanelli <[email protected]>
  • Loading branch information
ravanelli committed Jul 12, 2023
1 parent 5111b60 commit 5328846
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/cmd-koji-upload
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class Reserve(_KojiBase):
"""
log.info("Reserving a unique koji id")

release = datetime.datetime.utcnow().strftime("%H%M%S")
release = "0"

data = {
"name": f"{build.build_name}-{build.basearch}",
Expand Down Expand Up @@ -598,13 +598,19 @@ class Upload(_KojiBase):

now = datetime.datetime.utcnow()
stamp = now.strftime("%s")
self.release = now.strftime("%H%M%S")
# We use release as '0' so we can easily guess the NVR name when we need to.
# The Brew NVR is generated by:
# - {package_name}-{rhcos_version}-{release}
# - rhcos-x86_64-412.86.202302162021.0-0
# Seems there is no option for this type of Build to add arch as
# part of the NVR.
# That's the reason we use 'rhcos-arch' as package name (this was also a
# request from ProdSec).
self.release = "0"

"""
Koji has a couple of checks to ensure the reservation data (build_Id, release, name
and version) that is passed in the build import matchs with the build data.
For our case, the release data is done using time (“%H%M%S”), it always to be a mismatch
with the release time created for the build.
Let's just replace the build_id and the release here, and let the further checks for Koji.
"""
if self._reserve_id_file is not None:
Expand Down

0 comments on commit 5328846

Please sign in to comment.