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

ART-11111: versioning scheme decides the right param value for Jira t… #1083

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbiarnes
Copy link
Contributor

…emplate

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

…emplate

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 22, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 22, 2024

@mbiarnes: This pull request references ART-11111 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

…emplate

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

openshift-ci bot commented Oct 22, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from mbiarnes. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Contributor

openshift-ci bot commented Oct 22, 2024

@mbiarnes: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security c7fce88 link false /test security

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@mbiarnes mbiarnes requested a review from joepvd October 23, 2024 10:40
Copy link
Contributor

@joepvd joepvd left a comment

Choose a reason for hiding this comment

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

A comment, but maybe we should return to the drawing board.

@@ -134,6 +134,9 @@ async def run(self):
release_config = releases_config.get("releases", {}).get(self.assembly, {})
self.release_name = get_release_name_for_assembly(self.group_name, releases_config, self.assembly)
self.release_version = semver.VersionInfo.parse(self.release_name).to_tuple()
# Convert string to an integer if necessary (like 4.20.0-0 will result in
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why the line above does to_tuple(). the semver.version.Version instance has nice attributes:

>>> v = semver.VersionInfo.parse('4.5.6-1')
>>> v.to_dict()
{'major': 4, 'minor': 5, 'patch': 6, 'prerelease': '1', 'build': None}
>>> v.major
4

But this makes me realize that the proposed versioning scheme is not semver compliant.

Most standard compliant solution would be to have this in the build info.

>>> semver.VersionInfo.parse('4.5.6-1')
Version(major=4, minor=5, patch=6, prerelease='1', build=None)
>>> semver.VersionInfo.parse('4.5.6-rc.0-0')
Version(major=4, minor=5, patch=6, prerelease='rc.0-0', build=None)

meaning, for an RC, semver does not understand semantically understand what is going on.

The scheme to denote our build after a + seems the standard way of doing it:

>>> semver.VersionInfo.parse('4.5.6-rc.0+0')
Version(major=4, minor=5, patch=6, prerelease='rc.0', build='0')
>>> semver.VersionInfo.parse('4.5.6-rc.0+1')
Version(major=4, minor=5, patch=6, prerelease='rc.0', build='1')
>>> semver.VersionInfo.parse('4.5.7+1')
Version(major=4, minor=5, patch=7, prerelease=None, build='1')

Copy link
Contributor

Choose a reason for hiding this comment

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

The doubt about the versioning scheme is resolved, + is not a valid token for a k8s object. We need to deviate from semver.

"x": self.release_version[0],
"y": self.release_version[1],
"z": self.release_version[2],
"x": x,
Copy link
Contributor

Choose a reason for hiding this comment

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

would rather use the attributes semver returns,

self.release_version = semver.VersionInfo.parse(self.release_name)

# so here it becomes
"x": self.release_version.major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants