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

developer-experience: deployment previews for pull requests #9276

Closed
1 task done
hydrosquall opened this issue Mar 3, 2024 · 6 comments
Closed
1 task done

developer-experience: deployment previews for pull requests #9276

hydrosquall opened this issue Mar 3, 2024 · 6 comments
Assignees

Comments

@hydrosquall
Copy link
Member

hydrosquall commented Mar 3, 2024

Enhancement Description

Goal: Reduce time and effort to validate change requests, and improve review quality for vega-lite change requests (PRs). By making a deployment preview easy, it makes it easier to test end-user facing behaviors.

Motivating use-cases

Expected behavior

  • When a new PR is opened, build a copy of the vega-lite docs site and/or vega-editor that uses this branch's copy of vega-lite.
    • TBD which is easier to do first.

Checklist

  • I checked for duplicate issues. ( preview )

Notes

  • It's possible to set this up with a 3rd party provider (each with their own pricing model), but I'd like to first try if we can do this purely with Github actions.
@hydrosquall hydrosquall self-assigned this Mar 3, 2024
hydrosquall added a commit that referenced this issue Apr 6, 2024
## Motivation

- A cloudflare-based take on
#9276
- As discussed w/ @domoritz, Previewing the editor site is probably more
useful than the docs site, so we're going after that first

## Changes

- Use explicit packageManager version so Cloudflare doesn't autoupgrade
to yarn 3 (breaks lockfile)
- Add a build script (originally this was a 1-liner in package.json but
it was getting hard to read) that
  - Builds vega-lite
- Clones vega/editor and links the local vega-lite in place of the full
build
- Install `vega/editor` without running the `prepare` script. (The CI
device doesn't have rsync installed).
  - Makes empty index.json for vega / vega-lite examples.
- Build editor with vite with `/` as the base URL (previously it was
erroring due to thinking it was under the `/editor` subdomain).
Technically this is an abstraction leak but fixing it would involve
modifying the vega/editor repo too and I'd like to contain this change
to 1 repo if possible.

## Testing

- See Cloudflare comment below, confirm site loads

## Notes

- For now only `cameron.yick/*` branches have the previews since the
build script is WIP. It's using my personal Cloudflare account for
testing. I'll open it up to all (non dependabot/*) PRs this change is
confirmed.
- I've filed an request to
https://blog.cloudflare.com/cloudflare-new-oss-sponsorships-program to
see if we can get deployment previews sponsored (they also sponsor D3,
yarn). If not, I'll plan to discuss on Slack whether to keep Cloudflare
or switch the config to a different account.
- Free plan limits: 500 builds/ month:
https://developers.cloudflare.com/pages/platform/limits/ .
@hydrosquall
Copy link
Member Author

hydrosquall commented Apr 6, 2024

Here's a copy of the setup on Cloudflare so anyone can configure this for their own account. ( Docs on preview deployments )

As discussed in #vega-maintainers , this only builds the vega/editor, not the docs .

image

  • Disable automatic deployments on main
  • Blocklist for branches: dependabot/* , docs/*
  • Keeplist for builds: the src/* directory
  • Build settings
    • run yarn run build-editor-preview
    • Output the result to /editor/dist

See the result here: https://vega-lite.pages.dev/#/

@domoritz
Copy link
Member

domoritz commented Apr 6, 2024

Sweet. I think we can close this now, right?

@hydrosquall
Copy link
Member Author

hydrosquall commented Apr 6, 2024 via email

@domoritz
Copy link
Member

domoritz commented Apr 6, 2024

That's not as critical as the editor imo but could also be useful. How about we close this for now until we learn a bit more about how the current setup works out?

@hydrosquall
Copy link
Member Author

hydrosquall commented Apr 7, 2024 via email

@domoritz domoritz closed this as completed Apr 7, 2024
@hydrosquall
Copy link
Member Author

Idea for future : if building previews per commit automatically eats through the builds too quickly much, we can use the "Deploy hooks" feature to trigger deploys via specialized comments (like /request-deploy), or having a microsite where people can request builds by entering the PR #.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants