Skip to content
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

config: promote versionary key, rework it #961

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ registry_repos:
repo: quay.io/fedora/fedora-coreos-kubevirt
tags: ["${STREAM}"]

versionary_hack: true

default_artifacts:
all:
- metal
Expand Down Expand Up @@ -108,5 +106,6 @@ clouds:
test_architectures: [x86_64, aarch64]

misc:
versionary: true
generate_release_index: true
run_extended_upgrade_test_fcos: true
7 changes: 4 additions & 3 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ hacks:
# OPTIONAL: skip UEFI on older RHCOS
skip_uefi_tests_on_older_rhcos: true

# OPTIONAL/TEMPORARY: whether to use `versionary` to derive version numbers
versionary_hack: true

# OPTIONAL: coreos-assembler image to build with. Supports ${STREAM} variable.
# If unset, defaults to `quay.io/coreos-assembler/coreos-assembler:main`.
cosa_img: quay.io/jlebon/coreos-assembler:pr3139-${STREAM}
Expand All @@ -60,6 +57,8 @@ streams:
source_config_ref: main
# OPTIONAL: override OS variant to use for this stream
variant: rhcos-9.0
# OPTIONAL: override whether to use a versionary for this stream
versionary: false
stable:
type: production
# OPTIONAL: override cosa image to use for this stream
Expand Down Expand Up @@ -270,6 +269,8 @@ clouds:

# OPTIONAL: miscellaneous options
misc:
# OPTIONAL: whether to use a versionary to derive version numbers
Copy link
Member

Choose a reason for hiding this comment

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

Is a versionary enough of a noun?

Suggested change
# OPTIONAL: whether to use a versionary to derive version numbers
# OPTIONAL: whether to use a versionary script to derive version numbers

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to make it become one. :) But fine to make it less cool.

versionary: true
# OPTIONAL: whether to generate a release index
generate_release_index: true
# OPTIONAL: whether to run extended upgrade test kola job
Expand Down
23 changes: 14 additions & 9 deletions jobs/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,6 @@ lock(resource: "build-${params.STREAM}") {
prevBuildID = shwrapCapture("readlink builds/latest")
}

def new_version = ""
if (params.VERSION) {
new_version = params.VERSION
} else if (pipecfg.versionary_hack) {
new_version = shwrapCapture("/usr/lib/coreos-assembler/fcos-versionary")
}

def overrides_fetch_param = ""

// fetch from repos for the current build
Expand All @@ -274,10 +267,22 @@ lock(resource: "build-${params.STREAM}") {
if (parent_version != "") {
parent_arg = "--parent-build ${parent_version}"
}
def version = new_version ? "--version ${new_version}" : ""
def version_arg = ""
if (params.VERSION) {
version_arg = "--version ${params.VERSION}"
} else {
def use_versionary = pipecfg.misc?.versionary
if (stream_info.containsKey('versionary')) {
// stream override always wins
use_versionary = stream_info.versionary
}
Comment on lines +274 to +278
Copy link
Member

Choose a reason for hiding this comment

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

i'm guessing if we used this in one other place we'd put a helper function in utils.groovy?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, agree. I don't anticipate that need for now.

if (use_versionary) {
version_arg = "--versionary"
}
}
def force = params.FORCE ? "--force" : ""
shwrap("""
cosa build ostree ${strict_build_param} --skip-prune ${force} ${version} ${parent_arg}
cosa build ostree ${strict_build_param} --skip-prune ${force} ${version_arg} ${parent_arg}
""")

// Insert the parent info into meta.json so we can display it in
Expand Down