Skip to content

CI: Use new documentation previewer #57112

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

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

datapythonista
Copy link
Member

We've got a documentation previewer service for few months now, but the whole infrastructure powering it was just a PoC not very suitable for the long term (it didn't have error control, was running in a screen session, the workflow wasn't optimal, a github token was hardcoded, it required to remove old previews manually...).

Now we've got a service that IMHO is ready for production. Everything is built independently from pandas in this repo:
https://github.com/pandas-dev/github-doc-previewer/. In the pandas side the only thing we need is to call a GitHub action (check the diff in this PR).

For most people there won't be a significant difference between the previous PoC and the new system, as the UX is the same. Besides stability the main differences are:

  • A preview will be generated only for the PRs where it's requested (with the /preview comment). Previously we published the previews of every PR.
  • The new service is pandas-agnostic. If there is interest, any other repo can use it, the only thing needed is that the GitHub organization of the project is added to a setting in the server. The whole pandas-dev organization is of course added. Not sure if we have any other repo where this can be useful, but only adding the GitHub action is enough to have previews enabled.
  • The previous point has a small implication. The urls of the previews now contain the org and repo. So, instead of pandas.pydata.org/preview/1234/ the new url is now pandas.pydata.org/preview/pandas-dev/pandas/1234/

Any feedback or problem please let me know.

@datapythonista datapythonista added Docs CI Continuous Integration labels Jan 28, 2024
@datapythonista
Copy link
Member Author

I'll be merging this soon if there are no objections, so we can use the previewer again (with the new service).

@mroeschke mroeschke added this to the 3.0 milestone Jan 31, 2024
else
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "No preview found for PR #${{ github.event.issue.number }}. Did the docs build complete?"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
fi
- uses: pandas-dev/github-doc-previewer@master
Copy link
Member

Choose a reason for hiding this comment

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

In the future it would be great if we could use a tag for stability but not a big issue

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. At least for now I think all releases of the doc previewer will be done for pandas, but I created #57190 anyway, so we can decide when we upgrade.

@mroeschke mroeschke merged commit 2c32439 into pandas-dev:main Jan 31, 2024
@mroeschke
Copy link
Member

Thanks all your hard work here @datapythonista

@datapythonista
Copy link
Member Author

I had to increase the timeout on nginx, since the requests stays life for a bit more than one minute until the preview is ready and the comment can be posted, but now everything seems to be working fine with the new version.

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Preview rendered documentation of PRs
2 participants