Skip to content
Open
Changes from 1 commit
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
22 changes: 21 additions & 1 deletion hack/release-branch-pipeline-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-}"

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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.

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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

echo "Updated Dockerfile.dist labels:"
echo " name=\"rhtas/ec-rhel9\""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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"
Expand All @@ -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"
Loading