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

Exclude non-rc pre-releases from qpy backwards compat tests #11572

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

mtreinish
Copy link
Member

Summary

The QPY backwards compatibility tests are setup to verify that we can load qpy files generated with historical releases using the current version of Qiskit under development. This ensures we're meeting our backwards compatibility guarantees with QPY. However, the tests were over eagerly running on pre-releases that don't have any stability guarantees, mainly alpha and beta releases indicated by "a" and "b" suffixes respectively in the version number. This commit excludes these pre-release versions from the tests as it's not valid to run with these. Release candidate pre-releases should still be run because they have stable APIs and they're not skipped by this PR.

Details and comments

The QPY backwards compatibility tests are setup to verify that we can
load qpy files generated with historical releases using the current
version of Qiskit under development. This ensures we're meeting our
backwards compatibility guarantees with QPY. However, the tests were
over eagerly running on pre-releases that don't have any stability
guarantees, mainly alpha and beta releases indicated by "a" and "b"
suffixes respectively in the version number. This commit excludes
these pre-release versions from the tests as it's not valid to
run with these. Release candidate pre-releases should still be run
because they have stable APIs and they're not skipped by this PR.
@mtreinish mtreinish added type: qa Issues and PRs that relate to testing and code quality stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Jan 16, 2024
@mtreinish mtreinish added this to the 0.45.2 milestone Jan 16, 2024
@mtreinish mtreinish requested a review from a team as a code owner January 16, 2024 13:58
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @mtreinish
  • @nkanazawa1989

Comment on lines +32 to 39
# Exclude any non-rc pre-releases as they don't have stable API guarantees
if [[ $version == *"b"* || $version == *"a"* ]] ; then
exit 0
fi

# If the source version is newer than the version under test exit fast because
# there is no QPY compatibility for loading a qpy file generated from a newer
# release with an older release of Qiskit.
Copy link
Member

Choose a reason for hiding this comment

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

Just below these lines we call out to a Python script compare_versions.py, which makes a general comparison. Maybe we ought to move the logic to there, and handle proper version normalisation in Python with packaging.version? We intend to only use the canonical forms of versions, but the logic's all going to be easier to verify if it's in Python space with typed objects.

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 can move it to python space, but compare_versions.py isn't actually using packaging.version (to avoid needing to check the dependency) it's just using the regex to match the version parts. So I'd probably just basically be doing 'a' in match.group('pre') or 'b' in match.group('pre')

Copy link
Member

Choose a reason for hiding this comment

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

Oh, fair enough, in that case let's just leave it in bash.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7542647377

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 89.372%

Totals Coverage Status
Change from base Build 7540105234: 0.01%
Covered Lines: 59319
Relevant Lines: 66373

💛 - Coveralls

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Looks like it's working correctly:

+ version=1.0.0b1
+ parts=(${version//./ })
++ ./qiskit_venv/bin/python -c 'import qiskit;print(qiskit.__version__)'
+ qiskit_version=1.0.0
+ qiskit_parts=(${qiskit_version//./ })
+ [[ 1 -eq 0 ]]
+ [[ 1.0.0b1 == *\b* ]]
+ exit 0

@jakelishman jakelishman added this pull request to the merge queue Jan 16, 2024
Merged via the queue into Qiskit:main with commit abb803f Jan 16, 2024
13 checks passed
mergify bot pushed a commit that referenced this pull request Jan 16, 2024
The QPY backwards compatibility tests are setup to verify that we can
load qpy files generated with historical releases using the current
version of Qiskit under development. This ensures we're meeting our
backwards compatibility guarantees with QPY. However, the tests were
over eagerly running on pre-releases that don't have any stability
guarantees, mainly alpha and beta releases indicated by "a" and "b"
suffixes respectively in the version number. This commit excludes
these pre-release versions from the tests as it's not valid to
run with these. Release candidate pre-releases should still be run
because they have stable APIs and they're not skipped by this PR.

(cherry picked from commit abb803f)
github-merge-queue bot pushed a commit that referenced this pull request Jan 17, 2024
…11574)

The QPY backwards compatibility tests are setup to verify that we can
load qpy files generated with historical releases using the current
version of Qiskit under development. This ensures we're meeting our
backwards compatibility guarantees with QPY. However, the tests were
over eagerly running on pre-releases that don't have any stability
guarantees, mainly alpha and beta releases indicated by "a" and "b"
suffixes respectively in the version number. This commit excludes
these pre-release versions from the tests as it's not valid to
run with these. Release candidate pre-releases should still be run
because they have stable APIs and they're not skipped by this PR.

(cherry picked from commit abb803f)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@mtreinish mtreinish deleted the exclude-pre-release-qpy branch January 17, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants