-
Notifications
You must be signed in to change notification settings - Fork 162
Remove unused functions in prepare-build-variables.sh script #5780
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?
Conversation
5541d7e to
e65907d
Compare
60c70bb to
fa7d58e
Compare
.github/actions/metadata/action.yaml
Outdated
| shell: bash | ||
| run: | | ||
| # Sanitize names | ||
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.
Nit: Could you please remove this newline?
.github/actions/metadata/action.yaml
Outdated
| id: set-build-date | ||
| run: | | ||
| # Set build date | ||
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.
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.
Pull request overview
This PR removes unused functions and workflow steps from the CI build process by consolidating Docker image metadata generation into a reusable action. The changes eliminate the deprecated prepare-build-variables.sh script and its associated workflow job, replacing them with a new metadata action that centralizes tag and label generation logic.
Key changes:
- Removed unused
create_docker_image_labels()function and related output variables fromprepare-build-variables.sh - Eliminated the
preparejob from the CI workflow - Created a new reusable
metadataaction that generates Docker image metadata including tags, labels, and annotations
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hack/build/ci/prepare-build-variables.sh | Removed unused create_docker_image_labels() function and related variable assignments |
| .github/workflows/ci.yaml | Removed the prepare job and updated preflight-main to use new action inputs |
| .github/actions/preflight/action.yaml | Refactored to use the new metadata action instead of separate version/registry/repository inputs |
| .github/actions/metadata/action.yaml | New reusable action that consolidates Docker metadata generation with sanitized branch names |
| .github/actions/build-push-image/action.yaml | Integrated the new metadata action and simplified the build process |
.github/actions/metadata/action.yaml
Outdated
| type=raw,value=nightly,enable=${{ github.event_name == 'schedule' }} | ||
| # tags | ||
| type=raw,value=${{ steps.sanitize.outputs.ref_name_without_prefix }},enable=${{ github.ref_type == 'tag' }} |
Copilot
AI
Dec 11, 2025
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.
For tags, the original logic in create_docker_image_tag() returns github.ref_name directly without stripping the 'v' prefix. This new implementation strips the prefix unconditionally, which changes the tag format for version tags and may break existing references or tooling that expects tags to include the 'v' prefix.
| type=raw,value=${{ steps.sanitize.outputs.ref_name_without_prefix }},enable=${{ github.ref_type == 'tag' }} | |
| type=raw,value=${{ steps.sanitize.outputs.ref_name }},enable=${{ github.ref_type == 'tag' }} |
| annotations: | | ||
| ${{ inputs.annotation }} | ||
| version=${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} | ||
| go_linker_args=$(hack/build/create_go_linker_args.sh "${{ steps.meta.outputs.tag-names }}" "${{ github.sha }}") |
Copilot
AI
Dec 11, 2025
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.
The create_go_linker_args.sh script is being passed tag-names (which contains multiple comma-separated tags without the image base name) instead of a single tag value. The original code passed docker_image_tag from create_docker_image_tag(), which was a single tag string. This may cause the linker args script to fail or produce incorrect version information.
| go_linker_args=$(hack/build/create_go_linker_args.sh "${{ steps.meta.outputs.tag-names }}" "${{ github.sha }}") | |
| go_linker_args=$(hack/build/create_go_linker_args.sh "${{ steps.meta.outputs.tag }}" "${{ github.sha }}") |
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.
create_go_linker_args.sh script needs tag without the image base name so it should be value of tag-names .
5774a0b to
761667f
Compare
761667f to
7002e17
Compare
DAQ-12536
Description
This PR removes unused functions from the
prepare-build-variables.shscript. The script is also removed from the CI workflow.I added
metadataaction to keep thetagslogic in one place. It returns both values provided bydocker/metada-action:Sanitized names are used in the
tagslogic because CVS parser called bydocker/metada-actionskips all characters after#(it is a comment).How can this be tested?
I used forked repo. I created new workflow based on the CI one that pushes images to a different registry. I was able to compare images.