Skip to content
bricksentry

Docs · 05

CI / pull requests

A data review comment on every pull request, and a red check when the verdict is too risky.

Workflow

Build your branch's tables into a per-PR schema with your Asset Bundle (the ci target should write to the schema named by candidate_pattern), then run bricksentry.

.github/workflows/data-review.yml
name: data-review
on: pull_request
permissions:
  contents: read
  pull-requests: write
jobs:
  bricksentry:
    runs-on: ubuntu-latest
    env:
      DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
      DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }}
      DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }}
      DATABRICKS_WAREHOUSE_ID: ${{ secrets.DATABRICKS_WAREHOUSE_ID }}
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v4
        with: {fetch-depth: 0}
      - uses: databricks/setup-cli@main
      - run: databricks bundle deploy -t ci
      - run: databricks bundle run -t ci orders_job
      - run: pip install "bricksentry[databricks]"
      - run: >
          bricksentry assess --from-git origin/${{ github.base_ref }}
          --pr ${{ github.event.pull_request.number }}
          --comment --fail-on needs_human
  • fetch-depth: 0 is required so bricksentry can diff against the base branch.
  • pull-requests: write lets --comment post the report.
  • --fail-on needs_human fails the check at needs_human or block.

Changed-table detection

--from-git lists files changed since the base ref and matches them against each table's paths globs in bricksentry.yml. A change to src/pipelines/orders/clean.py matches src/pipelines/orders/**, so main.sales.orders is assessed against its candidate. Tables with no matching path are skipped.