tldraw/apps/huppy
Mime Čuvalo 65a6890584
dx: PR labels re-revamp (#4016)
This is a followup to https://github.com/tldraw/tldraw/pull/3112 after a
discussion with Alex about how our release notes writing is really
manual now.

This changes the labels to be a more limited set.

It also adds a plugin to help massage the release notes into what we
want it to be:
- ignores bot commits
- use the release notes, if found, not the commit msg
- skip writing the "release notes" in general, just create the changelog
which is what we want anyway.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-06-26 11:06:15 +00:00
..
pages Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
src dx: PR labels re-revamp (#4016) 2024-06-26 11:06:15 +00:00
.gitignore unbrivate, dot com in (#2475) 2024-01-16 14:38:05 +00:00
Dockerfile make Huppy deployable (again) (#2632) 2024-01-25 12:33:03 +00:00
fly.toml remove erroneous mount entry from fly.toml (#2644) 2024-01-25 16:49:57 +00:00
next.config.js unbrivate, dot com in (#2475) 2024-01-16 14:38:05 +00:00
package.json make CI check for yarn install warnings and fix the peer deps ones we have (#2683) 2024-01-30 11:41:46 +00:00
README.md [DX] PR labels revamp (#3112) 2024-03-12 14:53:57 +00:00
tsconfig.json Check tsconfig "references" arrays (#2891) 2024-02-21 13:07:53 +00:00

Repo-tools

Repo-tools is responsible for the huppy-bot app.

Development

To develop huppy-bot, you'll need to create a .env file that looks like this:

REPO_SYNC_PRIVATE_KEY_B64=<base64 encoded private key here>
REPO_SYNC_HOOK_SECRET=<hook secret here>

DM alex to get hold of these credentials.

To start the server, run yarn dev-huppy. Once running, you can go to http://localhost:3000/deliveries to get to a list of github webhook event deliveries. To test your code, pick an event that does roughly what you want and hit 'simulate'. You can also ask GitHub to re-deliver events to the production version of repo-sync through this UI.

Huppy-bot isn't currently deployed automatically. To deploy, use:

fly deploy --config apps/huppy/fly.toml --dockerfile apps/huppy/Dockerfile

from the repo root.

How it works

Huppy runs on a server with persistent disk storage attached. It maintains local mirrors of both our github repos on that disk. When events come in that mean we need to do some work in a repo, it updates the local mirror, then clones them to a temporary directory for work. This sort of pull + local clone is much faster (~1s) than normal from-scratch clones (~1m).

Huppy's reponsibilities are organized into "flows". These are defined in src/flows. A flow is an object with webhook handlers that implement some complete set of functionality. Right now there aren't many, but we could add more!

There's an alternative universe where huppy would exist as a set of github actions instead. We didn't pursue this route for three reasons:

  1. Huppy needs to operate over multiple github repos at once, which isn't well supported by actions.
  2. Giving actions in our public repo access to our private repo could be a security risk. We'd have to grant permission to OSS contributors to run certain actions, which could mean accidentally giving them access to more than we intend.
  3. Having access to the full range of webhook & API options provided by GitHub means we can create a better DX than would be possible with plain actions (e.g. the "Fix" button when huppy detects that bublic is out of date).

It also lets us make use of that local-clone trick, which means huppy responds to requests in seconds rather than minutes.