-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
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.
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:
|
There was a problem hiding this 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.
tools/find_stray_release_notes.py
Outdated
|
||
|
||
def _main(): | ||
default_path = os.path.join( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
(I don't know why I wrote |
Pull Request Test Coverage Report for Build 2656050807
💛 - Coveralls |
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 |
There was a problem hiding this 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.
I approved as-is, but if you want to make some changes, that's fine too. To be honest, I wonder if our |
I tested this on my windows vm and |
* 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)
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.
…) (#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>
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.
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.
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.
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