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

tools: add HTML previews for PR containing doc changes #47196

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Mar 21, 2023

For PR containing doc changes, the GitHub Actions workflow will push the built docs to the gh-pages branch so reviewers can have a preview of the changes without needing to pull the PR and build the docs locally. The commit that is pushed to gh-pages has a reference to the PR so the commit will appear on the GH web UI (so no need to comment I think).

You can see this PR in action on nodejs/node-auto-test#53.

Before this can land (if we do want to land it), the following needs to happen:

  1. An empty git tree should be pushed to the gh-pages branch.
  2. GitHub Pages should be activated on this repo (this should happen automatically if the above is done by a repo admin).

Note that this PR is only adding files to the gh-pages, which will eventually get cluttered with old PR content. If you have an idea how we can manage, please chime in, otherwise we can leave the problem for our future selves to solve (reseting the gh-pages branch back to an empty git tree every few months should work well enough for our use case I think).

/cc @nodejs/tsc

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/actions

@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Mar 21, 2023
@MoLow
Copy link
Member

MoLow commented Mar 21, 2023

Note that this PR is only adding files to the gh-pages, which will eventually get cluttered with old PR content. If you have an idea how we can manage, please chime in, otherwise we can leave the problem for our future selves to solve (reseting the gh-pages branch back to an empty git tree every few months should work well enough for our use case I think).

we can remove the files when the PR is closed, that will probably cover the majority of PRS

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@targos
Copy link
Member

targos commented Mar 21, 2023

Could it be easily changed to push to a separate repository? I don't want myself and others who regularly fetch the whole repository to be affected by the increase in size.

@aduh95
Copy link
Contributor Author

aduh95 commented Mar 21, 2023

Could it be easily changed to push to a separate repository? I don't want myself and others who regularly fetch the whole repository to be affected by the increase in size.

Pushing to a different repo shouldn't be a problem. For my own curiosity, what's the use case for fetching the whole repository?

git add "${{ github.event.pull_request.number }}"
git commit \
-m "Add/Update preview for ${{ github.event.pull_request.html_url }}" \
-m "The preview will be available at https://${{ github.repository_owner }}.github.io/${{ github.event.pull_request.base.repo.name }}/${{ github.event.pull_request.number }}/api/"
Copy link
Member

Choose a reason for hiding this comment

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

I'd also prefer to use either a different repository or a different URL at least that more clearly indicates that these are not official docs, but rather (untrusted) previews.

@targos
Copy link
Member

targos commented Mar 21, 2023

Could it be easily changed to push to a separate repository? I don't want myself and others who regularly fetch the whole repository to be affected by the increase in size.

Pushing to a different repo shouldn't be a problem. For my own curiosity, what's the use case for fetching the whole repository?

As a releaser and V8 maintainer, I regularly fetch everything to have up to date release, staging and canary-base branches.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Overall I would prefer we used something on our infra, e.g. Vercel. While this work I feel it would create quite a bit of pain to folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants