-
-
Notifications
You must be signed in to change notification settings - Fork 906
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
Pull request preview builds for online docs #1842
Comments
Thanks for researching this! I have enabled pull-request builds for GitPython and will be waiting for your confirmation that it actually works. The setup didn't involve more than ticking a checkbox. |
That's great--I'll open a pull request shortly and we'll see what happens. Thanks! |
Partial success:
Although this should make no difference for the CI check, which is attempted in response to an RTD pull request build happening, and not in response to status changes on the PR other than opening it and pushing commits, I am marking that PR ready for review. That should verify that its draft status is not a factor here. It may also make it easier for you to merge it if you choose, though I suggest holding off on merging it until the status reporting is fixed. After a change is made that might fix status reporting, it may be necessary to push to the PR to test that. This can be done by amending without changing any content or even the commit message and force-pushing. (Assuming I am available, I can do that after an attempted fix.) Update: As expected, marking the PR non-draft had no RTD-related effect (no new checks). |
That's awesome, this reads as full success to me :).
I think I will pass on this back-channel in favor of keeping the amount of authorized oauth-apps at zero in the organization. My hope is that the current setup will suffice once changes are intentionally made, that other PRs don't make changes so they wouldn't accidentally break anything. That way it's also a bit cumbersome to find PR-builds and review the docs that way, to me the greatest benefit of having the check visible, but I allow myself to wait and see. Now heading over to the PR merging - thanks again, the docs look great! |
Understood. There may be alternatives that further improve reporting while still satisfying the requirement that no such authorizations be added. I'll look into it and comment again with my findings. |
Although a nicer solution could be coded up as a new custom action, the options that I believe would be pretty quick and easy to put in place, while still not requiring any apps to be authorized, are:
Approach (2) requires that the workflow have the I am unsure about approach (3), but I think it requires that, too. Though an alternative could be to make a bot that runs as another account, rather than using a GitHub Actions job. The bot could listen to a web hook but would not have to have special privileges. This is less trivial to implement, though! The link contains the PR number but not the commit, so further commits do not invalidate it. However, it would also be useful to have a link to the build page, which is per commit. I don't know of a way to do that easily (without the oauth authorization). It could be done by writing a custom workflow or custom action that attempts to crawl a tiny bit of the site or to use the Read the Docs API. The former approach, forgoing the API, might be undesirable since it might entail going against |
Thanks for investigating this issue! To me, picking option 1) seems like the easiest solution while, in the common case, not loosing out on anything. Those PRs that deal specifically with adjusting documentation can link to the respective builds by hand. Generally I don't feel great about elevating permissions of PRs to achieve a better integration, even if it was super-easy. And even though it would be very nice to have such integration for reviewing, I think if it really matters the reviewer can generate the documentation locally as well. Thus, I am closing the issue as suggested in 1), and thank you again for evaluating the matter in such great detail. |
Read the Docs supports pull request builds, where pull requests trigger preview builds that are published to a different domain and marked with a warning banner to prevent confusion, and where the build status is reported as one of the CI checks for the PR.
I recommend enabling this for GitPython. Unlike some CI checks that are configured in GitHub Actions workflow files, my understanding is that Read the Docs pull request builds, including their status reporting as CI checks, do not use GitHub Actions. Instead, pull request builds are triggered via webhook (as are other Read the Docs builds), and the check status is reported to GitHub by authenticating with OAuth and posting it with (I think) the GitHub API.
For this reason, I don't believe I can propose the necessary changes by pull request. Instead, if you choose to enable pull request builds, you can do so by following these official instructions.
This should make it easier to verify the correctness of documentation changes in pull requests, as well as make it easier for contributors (including me) to become aware of, investigate, and attempt to improve problems in Read the Docs builds.
My immediate motivation for recommending this change is the hope that it would enable me to submit and test a fix for #1840. However, even if it turns out that the effect of changes to
.readthedocs.yaml
are not fully previewed in pull request builds--I think they are but I am not sure--it seems to me that this would be a worthwhile addition to the project's CI checks.Currently the
pythonpackage.yml
workflow does test if a local documentation build is able to succeed, but this does not test if a remote (Read the Docs) build succeeds, and more importantly it does not produce a hosted preview of the built documentation that can be easily inspected.The text was updated successfully, but these errors were encountered: