Audit Qdrant Vector Collection Indexing Health and Status
Audit Qdrant vector collections for operational status degradation and HNSW indexing lag with automated Slack alerts.
Block PostgreSQL migrations with irreversible or breaking changes while only warning on locking-risk changes.
A migration gate that fails on every lint finding trains teams to bypass it, because plenty of Squawk's findings (an index created without CONCURRENTLY, a nested transaction) are locking-risk warnings a team can often still ship carefully, not reasons to block a release. This blueprint lints a pending migration with Squawk, splits its findings into "irreversible or breaks running code" and "locking or availability risk," and only fails the execution outright on the first group, so chaining this flow as a migration gate blocks exactly the changes nobody should ship unreviewed while the second group pages Slack for a human read instead of blocking indefinitely.
lint_on_pr_webhook (io.kestra.plugin.core.trigger.Webhook) lets a CI pipeline POST a pending migration file to this flow directly as part of a pull request check. fetchType: STORE streams that POST body into Kestra's internal storage and exposes it as trigger.uri, a safe file reference, rather than as raw trigger.body text, which the trigger's own documentation flags as untrusted input unsafe to interpolate into a script task's commands. Running this flow manually or as a Subflow instead uses the migration_file input, the same kind of safe file reference.lint_migration (io.kestra.plugin.scripts.shell.Commands) runs Squawk's own ghcr.io/sbdchd/squawk container against whichever of those two is defined, with --format json, redirecting its output to report.json regardless of Squawk's own exit code (a non-zero exit on findings is expected behavior, not a failure this flow should abort on).classify_migration_safety (io.kestra.plugin.core.debug.Return) checks whether report.json was produced; if not, UNREACHABLE. Otherwise it reads the file with Kestra's read() function and counts, by rule_name, how many findings are in the destructive/breaking set (every ban-drop-* rule, a column/table/object rename, a column type change, a cascading truncate, or a SQL syntax error) versus the locking/availability set (an unguarded NOT NULL addition, a non-concurrent index operation, nested transactions, missing timeout guards). This split is deliberate: Squawk's own level field reports every rule violation as Warning regardless of how dangerous the rule is, confirmed directly from Squawk's reporter.rs source, where level: Error is reserved for SQL syntax errors only, so rule_name is the only signal that actually distinguishes severity here, not level.route_by_migration_safety (io.kestra.plugin.core.flow.Switch) branches on that string: PASS logs a quiet confirmation, WARN pages Slack with the specific locking-risk rule names but lets the execution succeed, BLOCK pages Slack with the specific destructive rule names and then runs fail_gate (io.kestra.plugin.core.execution.Fail) to deliberately fail the execution, and UNREACHABLE pages Slack separately.log_audit_status records a status line whenever the execution reaches it, i.e. every outcome except BLOCK, which fails before reaching this task by design.errors block fires both for a genuine flow break and, intentionally, every time fail_gate fires, a chained parent pipeline sees either case as the same FAILED execution and stops.fail_gate makes the execution itself FAILED on a destructive finding, so a parent flow using this as a Subflow task before migrate apply-style tasks is actually blocked, not just notified into a channel someone might not read before merging.status output (PASS / WARN / BLOCK / UNREACHABLE) you can also read directly if you prefer branching in the caller instead of relying on failure propagation.level: Warning) that would otherwise make a naive level-based gate useless.Squawk produces the findings; nothing in the CLI itself enforces a policy or blocks a deploy pipeline on your terms. Kestra turns that output into an actual pass/fail decision with a real execution-history trail of exactly which rule names triggered a block versus a warning, and Fail gives a parent pipeline a real signal to stop on instead of a Slack message it has to notice in time.
ghcr.io/sbdchd/squawk image, no database connection, server, or account is required; Squawk lints the SQL text itself..sql migration file, either uploaded as migration_file for a manual or Subflow run, or POSTed by a CI pipeline to the lint_on_pr_webhook URL for an event-driven run.MIGRATION_LINT_WEBHOOK_KEY: the key segment of the webhook URL (.../executions/webhook/{namespace}/{flowId}/{key}). Only needed if you enable lint_on_pr_webhook; a manual or Subflow run using migration_file does not need it.SLACK_WEBHOOK_URL: Slack incoming webhook used for the WARN alert, the BLOCK alert, the unreachable alert, and the flow-failure alert.SECRET_MIGRATION_LINT_WEBHOOK_KEY and SECRET_SLACK_WEBHOOK_URL as base64, for example echo -n "<your-value>" | base64.SLACK_WEBHOOK_URL secret, and the MIGRATION_LINT_WEBHOOK_KEY secret if you plan to enable the webhook.DROP COLUMN and an ADD COLUMN ... NOT NULL without a default, to exercise the BLOCK and WARN outcomes in one file (or split them into two runs).migration_file, run the flow manually, and confirm status matches what you expect.lint_on_pr_webhook and have your CI pipeline curl --data-binary @migration.sql the webhook URL on each pull request, or wire a Subflow task pointing at this flow into your deployment pipeline immediately before the task that applies migrations.pg_version input and pass it through as Squawk's --pg-version flag once you have confirmed the exact flag syntax against the version you run, to make version-specific rules (e.g. identity columns) accurate for your cluster.