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

buildhelper: try harder to get version #1122

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Conversation

ffromani
Copy link
Member

@ffromani ffromani commented Dec 17, 2024

try first to fetch the version from the master location (Makefile) before to deduce from the branch name.
The immediate benefit is we have a much higher chance to always report a version number, because we must have a version number in the master location in the Makefile.

Also: report git raw branch name

add a field to expose the raw as-from-git branch name.
Along the way, add comments to explain the meaning
of API fields.

Signed-off-by: Francesco Romani <[email protected]>
@openshift-ci openshift-ci bot requested review from swatisehgal and Tal-or December 17, 2024 09:39
Copy link
Contributor

openshift-ci bot commented Dec 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2024
@ffromani ffromani added cherry-pick-candidate Possible cherry-pick in the future and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 17, 2024
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2024
tools/buildhelper/buildhelper.go Outdated Show resolved Hide resolved
tools/buildhelper/buildhelper.go Show resolved Hide resolved
Report git raw branch name
Also try first to fetch the version from the master location
(Makefile) before to deduce fromthe branch name.
The immediate benefit is we have a much higher chance to always
report a version number, because we must have a version number
in the master location in the Makefile.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani
Copy link
Member Author

/retest-required

@Tal-or
Copy link
Collaborator

Tal-or commented Dec 18, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 8bd44a4 into main Dec 18, 2024
15 checks passed
@ffromani ffromani deleted the buildinfo-version branch December 18, 2024 08:39
@ffromani
Copy link
Member Author

/cherry-pick release-4.18

@ffromani ffromani added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Dec 18, 2024
@openshift-cherrypick-robot

@ffromani: #1122 failed to apply on top of branch "release-4.18":

Applying: buildinfo: expose raw git branch
Using index info to reconstruct a base tree...
A	internal/api/buildinfo/types.go
Falling back to patching base and 3-way merge...
Auto-merging internal/api/features/topics.go
CONFLICT (content): Merge conflict in internal/api/features/topics.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 buildinfo: expose raw git branch

In response to this:

/cherry-pick release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ffromani
Copy link
Member Author

needs #1125 before

@ffromani
Copy link
Member Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@ffromani: new pull request created: #1126

In response to this:

/cherry-pick release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cherry-pick-candidate Possible cherry-pick in the future lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants