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

Fix bug in QPY symengine payload version handling (backport #13259) #13260

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 2, 2024

Summary

This commit fixes a bug that slipped into the sole fix that made up the now yanked 1.2.3 release, #13251. The fix logic had a typo/mistake when evaluating the major version in the symengine payload that meant if you were trying to load a QPY payload generated with a different symengine release it would always error. This only got through CI because there was no test coverage of the edge case we were trying to fix. This commit addresses both issues. It first fixes the typo in the QPY parsing (which is a 2 character change) and then updates the QPY compat tests to explicitly test using multiple symengine versions with QPY to make sure we're exercising this code path moving forward (and validating this fix).

Details and comments
This is an automatic backport of pull request #13259 done by Mergify.

This commit fixes a bug that slipped into the sole fix that made up
the now yanked 1.2.3 release, #13251. The fix logic had a typo/mistake
when evaluating the major version in the symengine payload that meant
if you were trying to load a QPY payload generated with a different
symengine release it would always error. This only got through CI because
there was no test coverage of the edge case we were trying to fix. This
commit addresses both issues. It first fixes the typo in the QPY parsing
(which is a 2 character change) and then updates the QPY compat tests to
explicitly test using multiple symengine versions with QPY to make sure
we're exercising this code path moving forward (and validating this
fix).

(cherry picked from commit e5ec413)

# Conflicts:
#	qiskit/qpy/__init__.py
@mergify mergify bot requested a review from a team as a code owner October 2, 2024 22:54
@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Oct 2, 2024
Copy link
Contributor Author

mergify bot commented Oct 2, 2024

Cherry-pick of e5ec413 has failed:

On branch mergify/bp/stable/1.2/pr-13259
Your branch is up to date with 'origin/stable/1.2'.

You are currently cherry-picking commit e5ec41358.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   qiskit/qpy/common.py
	modified:   qiskit/qpy/interface.py
	new file:   releasenotes/notes/fix-qpy-parsing-123-75357c3709e35963.yaml
	modified:   releasenotes/notes/fix-qpy-symengine-compat-858970a9a1d6bc14.yaml
	modified:   test/qpy_compat/get_versions.py
	modified:   test/qpy_compat/run_tests.sh

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   qiskit/qpy/__init__.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

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

@github-actions github-actions bot added priority: high Changelog: Bugfix Include in the "Fixed" section of the changelog mod: qpy Related to QPY serialization labels Oct 2, 2024
@github-actions github-actions bot added this to the 1.2.3 milestone Oct 2, 2024
@coveralls
Copy link

coveralls commented Oct 2, 2024

Pull Request Test Coverage Report for Build 11156654634

Details

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 15 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.007%) to 89.747%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/qpy/common.py 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 2 92.48%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 11148098131: -0.007%
Covered Lines: 66885
Relevant Lines: 74526

💛 - Coveralls

qiskit/qpy/__init__.py Outdated Show resolved Hide resolved
@ElePT ElePT removed the conflicts used by mergify when there are conflicts in a port label Oct 3, 2024
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

I'd say the conflict fix looks good. Any reason not to add this PR to the queue @mtreinish?

@ElePT ElePT added this pull request to the merge queue Oct 3, 2024
Merged via the queue into stable/1.2 with commit 3f178cb Oct 3, 2024
17 checks passed
@ElePT ElePT modified the milestones: 1.2.3, 1.2.4 Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog mod: qpy Related to QPY serialization priority: high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants