Skip to content

Releases: INTENTIUS/sql-yodeler

Release list

0.9.0

Choose a tag to compare

@lex00 lex00 released this 12 Oct 04:28
24247a0

SQL Yodeler 0.9.0 adds your own column rules and typed columns, on chant 0.124.13.

Added

  • Your own column rules (#227). A check in chant.config.ts lint.policies reads the parsed schema (for example, every table has created_at timestamptz NOT NULL, or no Nullable column in a ClickHouse sort key). yodel lint reports a finding in the migration that first breaks it, -- yodel:allow silences it, and lint.rules sets its level. See docs/lint.md, "Your own column rules".
  • Typed columns (#228). A table declared with its name as a type argument, table<"app.events">, gets typed columns from a generated src/sql-types.d.ts (npx chant sql types). A misspelled column then fails tsc, and RowOf<"app.events"> is the row type. Both templates and both examples now commit the file. See docs/schema.md, "Typed columns".
  • Docs: what yodel is for, and the ops a schema change implies (ClickHouse rebuilds, Postgres safe renames, backfills), each run once inside its migration. A "Why plain SQL" section in docs/schema.md.

Changed

  • chant 0.124.13. The templates and examples pin chant and the sql lexicon at 0.124.13, which typed table tags need.
  • A clause chant's parser does not know is kept as written, with a warning naming it, where it used to fail the build (chant#3872). The catalog check and the server decide, and a change to such a clause is planned as one a person reviews.
  • The pull request lint job runs chant sql types --check when the project commits sql-types.d.ts, so a stale file fails the PR. Run yodel ci to pick up the step.

Upgrading

  • Move @intentius/sql-yodeler to ^0.9.0, and @intentius/chant and @intentius/chant-lexicon-sql to 0.124.13.
  • Run yodel ci to re-render the pipelines.
  • Typed columns are opt-in: add the type argument to a table and run npx chant sql types. A project without sql-types.d.ts gets no new step.

Internal

  • The scenario claims are 7 in place of 9 (51 parts in place of 88). They now prove only yodel's own behaviour; the shared review-and-apply layer is chant's and chant proves it.
  • CI runs lint, two test shards and the templates as parallel jobs: about 1.5 minutes per pull request in place of 3.7.
  • The CI image installs chant at the lockfile's versions.

0.8.0

Choose a tag to compare

@lex00 lex00 released this 12 Oct 00:35
dc1be43

SQL Yodeler 0.8.0 moves the review-and-apply plumbing onto chant (0.124.3): webhooks, overrides, the PR comment, the drift issue, the steps around apply, and the audit read. The yodel commands and their config keys are the same. Some of what they send and accept changed; read this before you upgrade.

Breaking changes

Webhook event body

Events are now chant's chant.notify/v1 body. A receiver that only verifies the signature needs no change: the headers (x-yodel-signature, x-yodel-timestamp) and the signed string (<timestamp>.<body>, as since 0.7.0) are the same, and @intentius/sql-yodeler/webhook still verifies under plain Node. A receiver that reads fields needs these changes:

0.7.0 0.8.0
version: 1 schema: "chant.notify/v1", source: "sql-yodeler"
migrations targets
approve (a string) approve.command
chantApprove approve.chant
command detail.command
runUrl, repository, commit run.url, run.repository, run.commit
id, random per send id, the same for a repeat of one event

Slack gets chant's message in place of yodel's line, and notify also accepts teams. See docs/notify.md.

Overrides

yodel override records and decides through chant's override gate (#207).

  • One override names every rule that denies the plan; leaving one out is refused.
  • Under the sealed approval mode an override must be sealed.
  • An override recorded before 0.8.0 no longer counts. A plan overridden but not yet applied needs yodel override again.
  • chant approve policy-override warns that there is no .chant/overriders file. That is expected: yodel keeps the list in policy.overriders in yodel.config.ts.

Steps around apply

environments.<env>.steps.before and .after now run as chant's Op waves stage hooks, under yodel's apply lock (#206). A step that fails stops the steps after it, unless its onFailure is approve; 0.7.0 ran every step and then judged. A wave apply that changes nothing records both moments as skipped. --wave-plan no longer warns or sends a webhook that a held wave will wait: chant prints the approval command.

PR comment and drift issue

yodel plan --comment and the drift issue post through chant's forge client (#210); yodel makes no forge REST calls of its own.

  • Token order: each forge reads CHANT_<FORGE>_TOKEN first, then GH_TOKEN before GITHUB_TOKEN (Forgejo also reads FORGEJO_TOKEN).
  • With several marked comments on one PR, the oldest is read and updated. yodel only ever keeps one.
  • The drift issue is edited only when the drift itself changes, and closed when a run finds none.

Added

  • Each apply, revert, baseline and declarative apply appends the environment's schema digest to chant's release ledger (#208), so chant components status prod --compare-to staging says whether prod holds the schema staging tested. Promotion between environments stays yodel apply; see docs/audit.md.

Changed

  • yodel report reads the gate ledger through chant's reader (#212). Its output is unchanged.
  • Binary files go in Git LFS, and check fails on one that is not (#213).
  • The scenario claims are 9 in place of 17, with short names (#205).