-
Notifications
You must be signed in to change notification settings - Fork 86
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
Qiskit docs generation only changes release notes for its own version #860
Conversation
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.
🙌
@@ -102,6 +102,11 @@ async function copyApiDocsAndUpdateLinks( | |||
), | |||
); | |||
} | |||
|
|||
const source = `${getRoot()}/docs/api/${pkgName}/release-notes/${versionWithoutPatch}.md`; |
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.
source
is a vague name. How about releaseNotePath
?
scripts/lib/api/releaseNotes.ts
Outdated
/** | ||
* Updates the release notes folder by adding the notes to their corresponding version | ||
* file. |
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.
The function docstring and function name are too general. It should now only be about writing for a specific version, like writeReleaseNoteForVersion
…Qiskit#860) ### Summary Part of Qiskit#755 This PR changes the logic of the API generation script to only modify the release notes file of the version we are regenerating at that moment. Before, the release notes files contained more than one version, and we needed to update several files, independently of what version we were regenerating. After Qiskit/qiskit#11840, we can assume that the release notes files will only contain their own versions, and we can simply our script by removing some functions. ### New logic The API generation script will transform every link of the release notes files to point to its version folder instead of the top level. Once we have the correct links, we will directly write the release notes file, if we didn't have them before, or otherwise, we will create a new file containing the header of the old file we had and the version sections of the new one downloaded from Box. That way, we can make manual changes like the table added in the release notes of qiskit 0.44 without losing them in the next regeneration. ### Functions removed This change allows us to remove the following two functions: The `extractMarkdownReleaseNotesPatches` function extracted all the versions in a release notes file and stored the markdown of each patch to posteriorly merge them under their minor version file. Now we have one minor version per file, so we don't need to break the release notes into pieces anymore. The new logic treats all patch versions as a block. The `sortReleaseNotesVersions` were used to sort the patch versions. Given that the file will have the correct order, we don't need to worry about it either. Removing these two functions allows us to remove the test file, given that they composed the entire file.
Summary
Part of #755
This PR changes the logic of the API generation script to only modify the release notes file of the version we are regenerating at that moment. Before, the release notes files contained more than one version, and we needed to update several files, independently of what version we were regenerating. After Qiskit/qiskit#11840, we can assume that the release notes files will only contain their own versions, and we can simply our script by removing some functions.
New logic
The API generation script will transform every link of the release notes files to point to its version folder instead of the top level. Once we have the correct links, we will directly write the release notes file, if we didn't have them before, or otherwise, we will create a new file containing the header of the old file we had and the version sections of the new one downloaded from Box. That way, we can make manual changes like the table added in the release notes of qiskit 0.44 without losing them in the next regeneration.
Functions removed
This change allows us to remove the following two functions:
The
extractMarkdownReleaseNotesPatches
function extracted all the versions in a release notes file and stored the markdown of each patch to posteriorly merge them under their minor version file. Now we have one minor version per file, so we don't need to break the release notes into pieces anymore. The new logic treats all patch versions as a block.The
sortReleaseNotesVersions
were used to sort the patch versions. Given that the file will have the correct order, we don't need to worry about it either.Removing these two functions allows us to remove the test file, given that they composed the entire file.