Release workflow generation - #50
Conversation
d195f1e to
97be4fa
Compare
|
Note: This PR is based on #61 . We should wait for that to merge first. |
97be4fa to
22f561e
Compare
There was a problem hiding this comment.
What do you think about making these python scripts instead? I would expect everyone has that installed and set up properly to get braintrust itself working. Feels like it'll make contribution easier in the future as well.
There was a problem hiding this comment.
I don't think this is worthwhile, not because I didn't examine alternatives before I chose something, but for a few other reasons: (1) Ruby is common for dev-ops tooling (e.g. Chef) and does come pre-installed/available in many environments (Linux/Mac), (2) ERB is a popular, stable templating engine that serves the purpose well (I couldn't find better ones), (3) Ruby is a requirement for ERB.
Moreover, I don't think the value proposition to rewrite everything is strong enough when the product that's consumed doesn't actually contain or require any Ruby (its just GHA YAML), the parts written in Ruby is merely support tooling (doesn't get modified often), the Ruby toolset is trivial to install, and when it does need to be modified development is likely happening in managed/templated environments anyways (e.g. Starfolk).
22f561e to
8e41fdc
Compare
Adds
bin/workflow: a CLI that generates a release workflow into a repo from a parameterized template, and keeps it in sync with upstream over time.Why
Today, setting up releases for a new SDK means copying one of our in-repo
release-*.ymlfiles and hand-stripping the test-bed scaffolding (the version-bump job, local./actionsrefs, version-apply step, PR triggers, Slack fallbacks.) It's easy to get wrong, and with no clean way to track which version of sdk-actions you're on or pull in later improvements.bin/workflowreplaces that with a real bootstrap-and-maintain flow:How you use it
Bootstrap a workflow (each template exposes its own flags;
--helplists them):Templates are
release/<lang>/<shape>—<lang>isruby/py/js, and<shape>is:Then, later, pull in upstream improvements:
updatebumps the pinned sdk-actions ref and re-stamps the provenance header, so each update sets up the next one. Local customizations survive the merge; only genuine conflicts are flagged.bin/workflow validate <file>schema-checks a workflow before you commit it.Design (high level)
# sdk-actions: {…}comment records template + ref + params, which is allcompare/updateneed to reproduce a baseline and 3-way-merge upstream changes in.--ref, defaultorigin/main).test/release/<lang>/mirrors a real consumer repo; its rendered workflows are committed and diff-guarded in CI, so a template edit can't land without its output being reviewed — the same discipline already used for generatedactions/.Bonus: SBOM correctness fix
While validating the release path, this branch also corrects the generated CycloneDX SBOMs so they match the authoritative package-SBOM shape per ecosystem: a proper
metadata.componentsubject (name + version + ecosystem-correct purl), runtime-only components, and adependenciesgraph rooted at the subject. A smallscripts/sbom_verify.rbcheck now runs in the release harnesses' dry-run, guarding the SBOM generators against silent content regressions (dev tooling leaking in, a dropped runtime dep, a missing subject/purl).