-
Notifications
You must be signed in to change notification settings - Fork 334
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
Local-first + generated CI #4148
Comments
I would even prefer no DSL at all: just define a bunch of classes for In fact we don't even have to define these classes... they already exist. Pushing this logic even further: do we even need to go through an intermediate YAML representation at all? Can't |
I think that qualifies as a DSL 😄. But I agree that it should be "good old code" as much as possible.
GHA requires the intermediate YAML files. There's no way to dispatch a job for a workflow that doesn't have a workflow ID, and those are given out to every workflow file. |
I have a bit of a crazy proposal: I think we should use TypeScript for the "DSL" part. The code generator would use I know, JS does not spark joy. But here's why I think it makes sense:
I definitely want to be careful not to overengineer this, but I would also like it if we didn't have to use JSON, TOML, or YAML for the DSL, and it doesn't seem like there's "middle ground" option that wouldn't either have sub-par tooling (such as building a custom language) or be annoying to use (such as Python) |
We had a lengthy call about this: It's clear that the valuable part of codegen is the ability to:
TypeScript is one option for the high-level configuration language, but before we decide on that we need to do more design work to determine what we actually need to be able to specify in the workflow definitions. For now, we'll be focusing on refactoring our CI to be local-first. |
We do a lot of work on CI, and it's extremely difficult to keep track of how it all fits together. We've also had to deal with a lot of pain arising from the fact that:
There are two big changes we can make to drastically improve the situation:
Local-first CI
Every job first installs it dependencies, and then it runs some code2. We want to ensure that all of that code is also runnable on every developer machine locally. To achieve this, we have to refactor every CI job to be a wrapper over this basic two-step process (
install
+run
).The sync release assets workflow is a great example of what we want all of our CI to look like. Especially the fact that the inputs to the script are passed in explicitly.
Some notes for the process of extracting a CI job to run locally:
Codegen GHA away
As long as every job is not much more complex than
install
+run
, it should be possible to ditch the GHA YAML files entirely, and instead use a custom DSL as the input to a GHA YAML file generator. Even if all this code generator did was use a different configuration file format and transpiled it to YAML, it would still be a big improvement in developer experience, but we can do much more than that.Some (unordered, tentative) goals for this DSL and code generator:
pull_request
with approval--dry-run
to display the execution planWe don't have to meet all of the above goals. The only strict requirement is that the DSL is not YAML, and it's possible to author the files without deep knowledge of GHA.
We will likely continue to hand-author some workflows with very specific requirements, but this should be usable for all jobs that perform builds/tests/linting.
Footnotes
Not because it must run on CI, we just haven't put in the work to make it run locally ↩
Some jobs may install additional dependencies later in their lifecycle, but that's more of a consequence of our job sequencing, and not a requirement for the job to work. ↩
The text was updated successfully, but these errors were encountered: