Description
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Before merging any PR to the site, seeing how site and docs changes look in a browser is useful.
Currently, the reviewer needs to have a local repo copy, a proper Node.js version, switch to the proper branch, install dependencies, and finally run the site using npm start
.
This process isn't hard for someone who reviews PRs regularly, but for others, this is an additional obstacle that can prevent them from taking a look.
Imagine you made a visual change or worked on some tutorial or blog post. By having automated deployments you'll be able to share this link to the mailing list or Slack and anyone interested will be able to read and review your changes without the need to do any additional actions.
I think it could bring more eyes to the review process and contribute to improving documentation quality over time.
Solution
Use Vercel for automated deployments.
https://vercel.com/
Taking into account the number of PRs to the apache/pulsar-site repository per month, the free Vercel plan should be enough for the near future. The next paid plan is $20 per month which isn't much.
We currently use this approach for reviewing this PR: apache/pulsar-site#789
The PR branch preview: https://pulsar-site-2024-updates.vercel.app/
I also tried it with a PR by another person's fork here:
https://github.com/visortelle/pulsar-site-2024-updates/pull/1
You can see that the preview deployment has been successfully created:
https://pulsar-site-2024-updates-8c5d4i9z9-visortelle.vercel.app/books/
Implementation
- No code changes are needed.
- Setup takes 15 minutes.
- The free Vercel plan implies that a single user has access to the Vercel project that connects the GitHub repo to Vercel. I'm going to request access after being sure that it will be approved. Should I contact anyone in ASF infra beforehand?
Alternatives
- Any other cloud provider than Vercel that simplifies this process.
- Not involve 3rd party services and automate this process using the existing ASF infra resources. It would take more time to implement and additional cost for maintenance.
Anything else?
- The build time doesn't impact GitHub Actions resources. Vercel uses its own CI.
- The Vercel approach covers most, but not 100% of cases. For example, docs for the previous Pulsar versions won't be published this way. Building all the previous version docs would make CI build time much longer.
- The need for automated feature branch deployments was also mentioned in this comment:
Add doc for transform functions before sinks pulsar-site#543 (comment)
Are you willing to submit a PR?
- I'm willing to submit a PR!