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

Handle historical Qiskit versions with GitHub source links #647

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

Eric-Arellano
Copy link
Collaborator

Part of #454. Historical versions of Qiskit docs are tricky because of qiskit-metapackage referring to multiple distinct GitHub repositories.


let slug: string;
let version: string;
if (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Matt T reviewed the if statements to make sure this covers all the import paths.

}
}

const QISKIT_METAPACKAGE_TO_TERRA = new Map([
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These versions come from https://docs.quantum.ibm.com/api/qiskit/release-notes/0.44. I double checked them and tried to be careful - I don't think you need to spend the time rechecking.

Comment on lines +189 to +193
return (fileName) =>
determineHistoricalQiskitGithubUrl(
this.versionWithoutPatch,
normalizeFile(fileName),
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This pattern is really neat. We're using partial application. We want to return a function (string) => string, but we need to pass in the extra argument metapackageVersion for it to work.

Copy link
Collaborator

@arnaucasau arnaucasau left a comment

Choose a reason for hiding this comment

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

Nice use of the partial application! This will unblock the regeneration of the historical versions, and later the ibm.com redirects. I tested it locally and triple-checked the versions in the package map, and all looks good to me.

@Eric-Arellano Eric-Arellano added this pull request to the merge queue Jan 19, 2024
@Eric-Arellano Eric-Arellano removed this pull request from the merge queue due to a manual request Jan 19, 2024
@Eric-Arellano Eric-Arellano added this pull request to the merge queue Jan 19, 2024
Merged via the queue into main with commit 6006b2d Jan 19, 2024
2 checks passed
@Eric-Arellano Eric-Arellano deleted the EA/qiskit-source-code-historical branch January 19, 2024 15:34
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
Part of Qiskit#454. Historical
versions of Qiskit docs are tricky because of qiskit-metapackage
referring to multiple distinct GitHub repositories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants