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

Allow passing versions as list for sync_release #2317

Conversation

lbarcziova
Copy link
Member

Fixes packit/packit-service#2408
Related to packit/packit-service#2068

Allow passing it as a new parameter to be explicit. With this, the CLI/service doesn't need to be touched for now and in followup implementation (next points in packit/packit-service#2068) the list will be passed only for AnityaVersionUpdateEvent.

RELEASE NOTES BEGIN

N/A

RELEASE NOTES END

@lbarcziova lbarcziova requested a review from mfocko May 20, 2024 16:53
Copy link
Contributor

Build failed.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/4123e5d048f94b4495435eb4a056ab06

✔️ pre-commit SUCCESS in 2m 12s
packit-tests-rpm FAILURE in 25m 48s
packit-tests-pip-deps FAILURE in 25m 26s
packit-tests-git-main FAILURE in 25m 44s
✔️ packit-tests-pip-deps-sess-rec SUCCESS in 3m 16s
✔️ packit-tests-git-main-sess-rec SUCCESS in 3m 39s
✔️ reverse-dep-packit-service-tests SUCCESS in 4m 57s

Copy link
Contributor

Build succeeded.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/dcfbc19a0f774a11bdb083f2dbaf9407

✔️ pre-commit SUCCESS in 2m 02s
✔️ packit-tests-rpm SUCCESS in 25m 33s
✔️ packit-tests-pip-deps SUCCESS in 26m 05s
✔️ packit-tests-git-main SUCCESS in 26m 13s
✔️ packit-tests-pip-deps-sess-rec SUCCESS in 3m 10s
✔️ packit-tests-git-main-sess-rec SUCCESS in 3m 40s
✔️ reverse-dep-packit-service-tests SUCCESS in 4m 38s

Copy link
Member

@mfocko mfocko left a comment

Choose a reason for hiding this comment

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

I have a feeling that having both version and versions will introduce some bugs, WDYT

@@ -771,14 +771,12 @@ def check_version_distance(
and masked_proposed
and masked_current.group(0) != masked_proposed.group(0)
):
raise ReleaseSkippedPackitException(
Copy link
Member

Choose a reason for hiding this comment

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

:classic: Pythonic… instead of having a predicate, yeet the error out /o

packit/api.py Outdated
Comment on lines 866 to 831
version: Optional[str] = None,
tag: Optional[str] = None,
versions: Optional[list[str]] = None,
Copy link
Member

Choose a reason for hiding this comment

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

The initial idea I had, was to remove (or at least deprecate) the version and use just versions, since it doesn't really matter whether there is just one version in the list or multiple 🤔

Now that I'm thinking about it, we could even have version as a local variable, start by populating it (from nothing, the ifs you have expanded to check for versions), and then just use as we did before.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to be rather explicit here whether there is one concrete version to propose or it should be determined in the method later (this cannot happen right in the beginning since we use the checked-out branch to get the current version in specfile for comparisons); so that way it seemed to me like less intrusive

also, in packit-service, we currently utilise the tag rather than version, see here, so the code for anitya will need to be still changed

but I am not strongly against, so I can rework it that way if you prefer that solution

Copy link
Member Author

Choose a reason for hiding this comment

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

reworked, PTAL 🙏

Copy link
Contributor

Build succeeded.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/5ad0b98fb75445a7943577bda3d6ab11

✔️ pre-commit SUCCESS in 4m 23s
✔️ packit-tests-rpm SUCCESS in 24m 56s
✔️ packit-tests-pip-deps SUCCESS in 25m 09s
✔️ packit-tests-git-main SUCCESS in 25m 10s
✔️ packit-tests-pip-deps-sess-rec SUCCESS in 3m 20s
✔️ packit-tests-git-main-sess-rec SUCCESS in 3m 35s
✔️ reverse-dep-packit-service-tests SUCCESS in 4m 38s

Copy link
Member

@mfocko mfocko left a comment

Choose a reason for hiding this comment

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

Since it changes the current API, do you have a follow up in packit-service open? 👀 I haven't seen any references in this PR.

LGTM

packit/api.py Outdated Show resolved Hide resolved
@lbarcziova
Copy link
Member Author

Since it changes the current API, do you have a follow up in packit-service open?

as I wrote in the comments above, in the service we are actually passing tag and not version, so for now no changes needed

Copy link
Contributor

Build succeeded.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/4129663e995b49caba17e72bde85a8ab

✔️ pre-commit SUCCESS in 3m 50s
✔️ packit-tests-rpm SUCCESS in 24m 04s
✔️ packit-tests-pip-deps SUCCESS in 24m 11s
✔️ packit-tests-git-main SUCCESS in 23m 56s
✔️ packit-tests-pip-deps-sess-rec SUCCESS in 3m 42s
✔️ packit-tests-git-main-sess-rec SUCCESS in 3m 53s
✔️ reverse-dep-packit-service-tests SUCCESS in 5m 20s

@lbarcziova lbarcziova added the mergeit When set, zuul wil gate and merge the PR. label May 29, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/3fe713d8aa4043ddb9e9b849a12b6422

✔️ pre-commit SUCCESS in 2m 05s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit c8c0314 into packit:main May 29, 2024
16 of 20 checks passed
@lbarcziova lbarcziova deleted the allow-passing-version-list branch May 29, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support list of versions for sync-release
2 participants