-
Notifications
You must be signed in to change notification settings - Fork 167
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
koji: Change release number for NVR #3533
Conversation
ravanelli
commented
Jul 12, 2023
- The release number doesn't need to be random. It make 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.
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.
LGTM - some suggestions in comments
340b0be
to
5fb0284
Compare
src/cmd-koji-upload
Outdated
"release": f"{build.build_id[-1:]}", | ||
"version": f"{build.build_id[:-2]}", |
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.
Let's update this to be a little more tolerant if something changes in the future.
For example.. Right now I don't anticipate us ever getting anything other than -0
at the end of a RHCOS build ID, but maybe in the future that could change and we could theoretically get up to -9
, -10
, etc.
It should be simple to just handle that today if we split based on the -
:
[dustymabe@media ~]$ python3
Python 3.11.4 (main, Jun 7 2023, 00:00:00) [GCC 12.3.1 20230508 (Red Hat 12.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> build_id='414.92.202307170903-0'
>>> version, release = build_id.split('-')
>>> print(version, release)
414.92.202307170903 0
@@ -429,12 +429,10 @@ class Reserve(_KojiBase): | |||
""" | |||
log.info("Reserving a unique koji id") | |||
|
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.
since we are now doing something interesting here when it comes to version and release let's add a comment and the top (I'm sorry I know I asked you to remove the release
variable in an earlier iteration of this PR:
# The koji/brew NVR is constructed like so:
# Name = "rhcos-$arch", like `rhcos-x86_64`
# Version = Everything before `-` in RHCOS version
# Release = Everything after `-` in RHCOS version
#
# Example: RHCOS Build ID: 414.92.202307170903-0 for x86_64
# Name = rhcos-x86_64
# Version = 414.92.202307170903
# Release = 0
# NVR = rhcos-x86_64-414.92.202307170903-0
version, release = build.build_id.split('-')
src/cmd-koji-upload
Outdated
"release": f"{self.build.build_id[-1:]}", | ||
"owner": self._owner, | ||
"source": source['origin'], | ||
"start_time": stamp, | ||
# RHCOS wants to be semver-compatible, but Koji doesn't | ||
# accept `-`. See | ||
# https://github.com/openshift/oc/pull/209#issuecomment-564876535 | ||
"version": f"{self.build.build_id.replace('-', '.')}" | ||
"version": f"{self.build.build_id[:-2]}" |
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.
Need to do something similar to #3533 (comment) here
- 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 our "release" version number as release number to make things easier to search for a NVR when we need to. Example: Our full version number is: 413.92.202302162021.0 The Brew version is now: 412.86.202302162021 and the release number is: 0 Signed-off-by: Renata Ravanelli <[email protected]>
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.
LGTM