unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
363 stars 160 forks source link

For any PR modifying documentation, add an action which comments a link to the RTD build #931

Closed rmlarose closed 3 years ago

rmlarose commented 3 years ago

I didn't know this was a thing until this comment https://github.com/unitaryfund/mitiq/pull/929#pullrequestreview-756097775. For many things it's often easier to review documentation that is already executed, rather than executing it locally or looking at myst diffs on GH.

Desired behavior

For any PR modifying documentation, a comment is added to the PR that says something like "Preview changes to documentation on RTD here: [link]" with a link.

I think the structure of the link is https://mitiq--PR.org.readthedocs.build/en/PR/ where PR is the PR number, e.g., 929.

Abhijnan-Bajpai commented 3 years ago

Hey @rmlarose, I would like to work on this feature. Could I be assigned?

rmlarose commented 3 years ago

Sure thing, it's all yours - thanks!

Abhijnan-Bajpai commented 3 years ago

I tried looking at the comment you provided, but couldn't understand the implementation from there. Could you help me out by providing some more resources where I could find similar implementations? @rmlarose

rmlarose commented 3 years ago

I did not know of any similar implementations, but Akash found the answer in https://github.com/unitaryfund/mitiq/pull/964#issuecomment-939248397:

Do you know if it's possible to limit the action to only comment on PRs that include documentation changes?

I was going through the GitHub Docs and came across on.<push|pull_request>.paths. We can use this to trigger a workflow and comment on a PR with the RTD link only when a change is made to mitiq/docs.

So that would be my proposed solution.

However, since opening this we have created an action to comment a binder link on every PR. My personal preference would be to:

  1. Modify this action to only show up on documentation related PRs, using the method linked above.
  2. Add a "Preview documentation on RTD" (with link) to the comment that action creates.

However, some unitaryfund team members have expressed wanting the binder link on all PRs. So this is blocked on needing an agreed design. I will update you asap, thanks for your interest in helping.

rmlarose commented 3 years ago

We decided not to add any RTD links after all

image

Thanks for your interest in helping out though @Abhijnan-Bajpai!