-
Notifications
You must be signed in to change notification settings - Fork 61
Automate CPE label update in release branch setup script #3536
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
5fdc57f
c534ef8
87c764e
e059e04
15626a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,26 @@ EOT | |
| awk "$awk_query" <(git show main:$MAIN_PR_PIPELINE) > $RELEASE_PR_PIPELINE | ||
| awk "$awk_query" <(git show main:$MAIN_PUSH_PIPELINE) > $RELEASE_PUSH_PIPELINE | ||
|
|
||
| # Set the CPE and name labels in Dockerfile.dist for the release branch. | ||
| # The CPE version is a Red Hat product version that doesn't necessarily follow | ||
| # the Conforma version, so it must be provided explicitly. | ||
| CPE_VERSION="${CPE_VERSION:-}" | ||
| if [[ -z "$CPE_VERSION" ]]; then | ||
| read -rp "Enter the CPE version for this release (e.g. 1.5): " CPE_VERSION | ||
| fi | ||
|
|
||
| if [[ -z "$CPE_VERSION" ]]; then | ||
| echo "Error: CPE version is required" | ||
| exit 1 | ||
| fi | ||
|
|
||
| sed -i'' -e "s|name=\"ec\"|name=\"rhtas/ec-rhel9\" \\\\\\n cpe=\"cpe:/a:redhat:trusted_artifact_signer:${CPE_VERSION}::el9\"|" Dockerfile.dist | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| echo "Updated Dockerfile.dist labels:" | ||
| echo " name=\"rhtas/ec-rhel9\"" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] output-format-consistency The echo summary prints the name and cpe labels as two separate lines, but the sed substitution writes the cpe label as a continuation of the existing name= line (via backslash + newline + indent) inside one logical LABEL directive. The user-facing summary does not match the shape of what was inserted; the rest of this script's echoes mirror the exact artifact they describe. Suggested fix: Print a single line reflecting the actual inserted form, or explicitly note the continuation, to stay consistent with the file's echo-what-you-did style.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done, addressed in new commits |
||
| echo " cpe=\"cpe:/a:redhat:trusted_artifact_signer:${CPE_VERSION}::el9\"" | ||
| echo "" | ||
|
|
||
| echo "To review the new pipeline definitions:" | ||
| echo " vimdiff <(git show main:$MAIN_PR_PIPELINE) $RELEASE_PR_PIPELINE" | ||
| echo " vimdiff <(git show main:$MAIN_PUSH_PIPELINE) $RELEASE_PUSH_PIPELINE" | ||
|
|
@@ -100,4 +120,4 @@ echo " vimdiff <(git show release-v$OLD_VERSION:$OLD_RELEASE_PUSH_PIPELINE) $RE | |
| echo "" | ||
| echo "If the above comparisons look good then you probably want to do this:" | ||
| echo " git rm $MAIN_PR_PIPELINE $MAIN_PUSH_PIPELINE" | ||
| echo " git add $RELEASE_PR_PIPELINE $RELEASE_PUSH_PIPELINE" | ||
| echo " git add $RELEASE_PR_PIPELINE $RELEASE_PUSH_PIPELINE Dockerfile.dist" | ||
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.
This is fine, but perhaps RHTAS_VERSION or TAS_VERSION is a better name. The CPE string includes the TAS version (currently 1.5) IIUC.
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.
Makes sense, I renamed it to TAS_VERSION.