Releases from CI, and a first setup
One command in CI tells Controxity what each release is and sends its source maps; one command writes a first controxity.yml and a guide for the fixer.
Controxity's command line is one file with no dependencies, for Node.js 18 or newer. Get it from your Controxity:
curl -fsSL https://your-controxity/sdk/cli.js -o controxity.jsIn CI: release#
After the build, before or after the deploy:
CONTROXITY_URL=https://your-controxity CONTROXITY_KEY=$CONTROXITY_KEY \
node controxity.js release --version 1.4.2 --maps distIt does two things:
- Says what the release is. The version, and the git commit and branch it was built from. A place that reports
1.4.2is then known to run that commit, so Controxity can tell which fixes it holds, even when your version numbers aren't in order (build-77, a date, a name). See Versions. - Sends the source maps in
--maps(any number of folders), each by its bundle's name:dist/assets/app.js.mapisassets/app.js. When your frames name them with a folder in front, add it:--maps-prefix static. See Send source maps.
| Option | Default |
|---|---|
--version | CONTROXITY_VERSION, else package.json's version, else the commit. Use the version the app gives init(). |
--commit | The CI's own (GITHUB_SHA, CI_COMMIT_SHA, BITBUCKET_COMMIT, CIRCLE_SHA1), else git rev-parse HEAD. |
--branch | The CI's own, else git's. |
--strict | Off: when Controxity can't be reached it warns and your deploy goes on. With it, the step fails. |
--json | Also print the result as one line of JSON. |
It uses the place's server key (dep_…), the one the SDK uses. Each release is in the Activity record.
What it carries#
It answers with the fixes this release carries since the one before (on the same branch):
Controxity knows release 1.4.3 is 3f9c2a1b7d4e on main. 2 source maps saved.
It carries 2 fixes since 1a2b3c4:
- The cart total no longer fails on an empty cart. (code:error:typeerror-src-cart-js-2-total, 1.4.2)
- Shipping rates wait and retry when the carrier says 429. (code:error:fetcherror-src-shipping-js-57-rates, 1.4.3)Those are fixes Controxity shipped, and your own commits that said Fixes code:error:…, whose commits this release holds. For release notes, --json also prints the result as one line of JSON. With no release before it, it lists what it holds from the last 30 days. When Controxity's copy of your code doesn't have the commit yet, it fetches it; if it still can't see it, it says so, and your deploy goes on.
- name: Tell Controxity
run: |
curl -fsSL "$CONTROXITY_URL/sdk/cli.js" -o controxity.js
node controxity.js release --maps dist
env:
CONTROXITY_URL: ${{ vars.CONTROXITY_URL }}
CONTROXITY_KEY: ${{ secrets.CONTROXITY_KEY }}Once, in your repository: init#
node controxity.js initIt reads your repository, with no AI and nothing sent anywhere, and writes:
controxity.yml: how the fixer installs and tests your code. It finds npm, pnpm, yarn and bun (by their lockfiles), Python, Go, Rust, Maven and Gradle. A monorepo's workspaces become itscomponents, each with its own test. With no tests yet, it writeschecksinstead (TypeScript, ESLint). Protected files and deploy commands are there as comments to fill in.AGENTS.md, when there's noCLAUDE.md,AGENTS.mdorCONTRIBUTING.md: a first guide for the fixer and other coding agents. It covers the layout, how to install and test, and the rules. Add what's easy to break and what never to touch.
A file that's there already is left as it is (--force writes over controxity.yml). --dry-run shows what it would write. Read them over, then commit them: Controxity reads them from your code before each fix. See controxity.yml.