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

Move release note in wrong location and add script to block this #8320

Merged
merged 3 commits into from
Jul 12, 2022

Conversation

mtreinish
Copy link
Member

Summary

In #8201 I added a release note as part of the PR which documented the
change in behavior. However, I accidentally committed this file in the
wrong location (by running reno new outside of the repo root). This
meant the file was never actually included in the release notes for the
0.21.0 release. This commit corrects this oversight and moves it back to
the proper location.

However, since this isn't my first time making this mistake and I can
expect that others will make it too in the future. This commit also adds
a new script to detect this and raise an error when release notes are
present outside of the proper location. By running this as part of lint
jobs we'll block this mistake from happening again.

Details and comments

In Qiskit#8201 I added a release note as part of the PR which documented the
change in behavior. However, I accidentally committed this file in the
wrong location (by running reno new outside of the repo root). This
meant the file was never actually included in the release notes for the
0.21.0 release. This commit corrects this oversight and moves it back to
the proper location.

However, since this isn't my first time making this mistake and I can
expect that others will make it too in the future. This commit also adds
a new script to detect this and raise an error when release notes are
present outside of the proper location. By running this as part of lint
jobs we'll block this mistake from happening again.
@mtreinish mtreinish added 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 Jul 11, 2022
@mtreinish mtreinish added this to the 0.21.1 milestone Jul 11, 2022
@mtreinish mtreinish requested a review from a team as a code owner July 11, 2022 15:58
@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 the following people are requested to review this:

  • @Qiskit/terra-core

Copy link
Contributor

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

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

Thanks Matthew. This looks good to me. Just few questions. I'll hold my approval since I'm not quite familiar with linter mechanism.



def _main():
default_path = os.path.join(
Copy link
Contributor

@nkanazawa1989 nkanazawa1989 Jul 11, 2022

Choose a reason for hiding this comment

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

How this variable is used?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, good catch. this is sloppy copy and paste from the script I based this on

parser = argparse.ArgumentParser(description="Find any stray release notes.")
args = parser.parse_args()
files = discover_files()
with multiprocessing.Pool() as pool:
Copy link
Contributor

Choose a reason for hiding this comment

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

This works in every platform?

Copy link
Member Author

@mtreinish mtreinish Jul 11, 2022

Choose a reason for hiding this comment

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

Yeah it will, because I have the if __name__ = "__main__" on the script. Without this windows and macOS > 3.7 would potentially have issues because they default to the spawn method.

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.

Will the hard-coded / in the regexes work correctly on Windows (not that this is a blocker, if we only care about running in CI). Alternatively, if multiprocessing isn't such a big deal, something like

import pathlib

for directory in pathlib.Path(".").glob(f"qiskit/**/releasenotes/notes"):
    print("error", ...)

might be simpler and faster, since it should only look in things with a releasenotes directory, and not every other file.

@jakelishman
Copy link
Member

(I don't know why I wrote pathlib.Path(".").glob("qiskit/**/...") instead of pathlib.Path("qiskit").rglob("releasenotes/notes"), but whatever.)

@coveralls
Copy link

coveralls commented Jul 11, 2022

Pull Request Test Coverage Report for Build 2656050807

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.005%) to 83.992%

Files with Coverage Reduction New Missed Lines %
qiskit/pulse/library/waveform.py 3 89.36%
Totals Coverage Status
Change from base Build 2655887472: -0.005%
Covered Lines: 55826
Relevant Lines: 66466

💛 - Coveralls

@mtreinish
Copy link
Member Author

Hmm, I always forget about windows. We do want people to run this locally. I'm not sure what the git output looks like for ls-tree on windows. I'll spin up my VM and check.

I debated between just doing things by local path and via the git tracked file approach. But I figured doing the git tracked would be a bit better just because reno worked on the git log. I always forget about pathlib which is fast IIRC. I'll play around locally and push up a change if II like that approach better.

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 fine to me.

@jakelishman
Copy link
Member

I approved as-is, but if you want to make some changes, that's fine too. To be honest, I wonder if our lint tox job would work well on a general Windows machine already - it launches a bunch of Python scripts trusting that their #! lines will execute them (unless tox does something clever), and since those call to /usr/bin/env python3, I dunno if that'll work well on Windows anyway.

@mtreinish
Copy link
Member Author

I tested this on my windows vm and tox -elint does work on windows (I tested from the windows cmd.exe). The only thing I had to do manually was install jax, symengine, scikit-quant, and sqsnobfit which didn't get pulled in because of the environment markers in the requirements list (and pylint failed because of the missing dependencies).

@mergify mergify bot merged commit bb4d52a into Qiskit:main Jul 12, 2022
mergify bot pushed a commit that referenced this pull request Jul 12, 2022
* Move release note in wrong location and add script to block this

In #8201 I added a release note as part of the PR which documented the
change in behavior. However, I accidentally committed this file in the
wrong location (by running reno new outside of the repo root). This
meant the file was never actually included in the release notes for the
0.21.0 release. This commit corrects this oversight and moves it back to
the proper location.

However, since this isn't my first time making this mistake and I can
expect that others will make it too in the future. This commit also adds
a new script to detect this and raise an error when release notes are
present outside of the proper location. By running this as part of lint
jobs we'll block this mistake from happening again.

* Fix lint

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit bb4d52a)
@mtreinish mtreinish deleted the fix-release-note-stray branch July 12, 2022 12:36
mtreinish added a commit to mtreinish/qiskit that referenced this pull request Jul 12, 2022
In Qiskit/qiskit#8320 a mistake was fixed where a release note for
0.21.0 was committed to the wrong location in the repository. This
prevented the release notes from being shown when reno was called to
build the rst page. This commit adds the release notes to the published
copy now that this has been caught so the release notes are included
with the others in 0.21.0.
mergify bot added a commit that referenced this pull request Jul 12, 2022
…) (#8327)

* Move release note in wrong location and add script to block this

In #8201 I added a release note as part of the PR which documented the
change in behavior. However, I accidentally committed this file in the
wrong location (by running reno new outside of the repo root). This
meant the file was never actually included in the release notes for the
0.21.0 release. This commit corrects this oversight and moves it back to
the proper location.

However, since this isn't my first time making this mistake and I can
expect that others will make it too in the future. This commit also adds
a new script to detect this and raise an error when release notes are
present outside of the proper location. By running this as part of lint
jobs we'll block this mistake from happening again.

* Fix lint

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit bb4d52a)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
jakelishman pushed a commit to Qiskit/qiskit-metapackage that referenced this pull request Jul 12, 2022
In Qiskit/qiskit#8320 a mistake was fixed where a release note for
0.21.0 was committed to the wrong location in the repository. This
prevented the release notes from being shown when reno was called to
build the rst page. This commit adds the release notes to the published
copy now that this has been caught so the release notes are included
with the others in 0.21.0.
@mtreinish mtreinish mentioned this pull request Jul 27, 2022
2 tasks
jakelishman pushed a commit to jakelishman/qiskit-terra that referenced this pull request Aug 11, 2023
In Qiskit#8320 a mistake was fixed where a release note for
0.21.0 was committed to the wrong location in the repository. This
prevented the release notes from being shown when reno was called to
build the rst page. This commit adds the release notes to the published
copy now that this has been caught so the release notes are included
with the others in 0.21.0.
SamD-1998 pushed a commit to SamD-1998/qiskit-terra that referenced this pull request Sep 7, 2023
In Qiskit#8320 a mistake was fixed where a release note for
0.21.0 was committed to the wrong location in the repository. This
prevented the release notes from being shown when reno was called to
build the rst page. This commit adds the release notes to the published
copy now that this has been caught so the release notes are included
with the others in 0.21.0.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants