bricksentry 0.1.14__tar.gz → 0.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bricksentry-0.1.14 → bricksentry-0.1.16}/CHANGELOG.md +17 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/PKG-INFO +1 -1
- bricksentry-0.1.16/deploy/databricks-app/app.yaml +10 -0
- bricksentry-0.1.16/deploy/databricks-app/bricksentry.yml +21 -0
- bricksentry-0.1.16/deploy/databricks-app/databricks.yml +26 -0
- bricksentry-0.1.16/deploy/databricks-app/grants.sql +19 -0
- bricksentry-0.1.16/deploy/databricks-app/requirements.txt +1 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/pyproject.toml +2 -2
- bricksentry-0.1.16/server.json +41 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/__init__.py +1 -1
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/history.py +8 -4
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/job.py +9 -3
- bricksentry-0.1.16/templates/job-check/databricks_template_schema.json +86 -0
- bricksentry-0.1.16/templates/job-check/template/{{.project_name}}/.gitignore +2 -0
- bricksentry-0.1.16/templates/job-check/template/{{.project_name}}/README.md.tmpl +74 -0
- bricksentry-0.1.16/templates/job-check/template/{{.project_name}}/databricks.yml.tmpl +14 -0
- bricksentry-0.1.16/templates/job-check/template/{{.project_name}}/resources/bricksentry_check.job.yml.tmpl +59 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_0114.py +38 -5
- bricksentry-0.1.14/packages/bricksentry-mcp/LICENSE +0 -202
- bricksentry-0.1.14/packages/bricksentry-mcp/README.md +0 -32
- bricksentry-0.1.14/packages/bricksentry-mcp/src/bricksentry_mcp/__init__.py +0 -5
- {bricksentry-0.1.14 → bricksentry-0.1.16}/.gitignore +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/CONTRIBUTING.md +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/LICENSE +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/README.md +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/SECURITY.md +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/action.yml +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/deploy/databricks-app/README.md +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry.yml +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_check_my_table.ipynb +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_check_my_table.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_hr_walkthrough.ipynb +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_hr_walkthrough.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_quickstart.ipynb +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_quickstart.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/github-workflow.yml +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/policy.yml +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/examples/demo/agent_loop_demo.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/scripts/build_notebook.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/__main__.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/agent_tools.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/assess.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/backends/__init__.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/backends/base.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/backends/databricks_backend.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/backends/duckdb_backend.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/changes.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/cli.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/config.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/demo.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/diff.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/explain.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/github.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/lineage.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/mcp_server.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/measures.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/models.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/notify.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/policy.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/policy_templates.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/preview.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/py.typed +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/src/bricksentry/report.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/templates/job-check/README.md +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/src/bricksentry_check.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/conftest.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_0110.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_0112.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_018.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_019.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_assess_policy.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_check_notebook.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_databricks_and_uc.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_demo.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_diff.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_hr_notebook.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_notebook.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_notify_templates.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_preview_agents.py +0 -0
- {bricksentry-0.1.14 → bricksentry-0.1.16}/tests/test_sample_guard_and_store.py +0 -0
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.16 (2026-11-11)
|
|
4
|
+
|
|
5
|
+
From the live test of 0.1.15 on Databricks serverless:
|
|
6
|
+
|
|
7
|
+
- Fix: two checks of the same table at the same time (two jobs watching it, or a job and a notebook) used the same scratch clone names, so one check's cleanup could drop the other's clone mid-diff (`TABLE_OR_VIEW_NOT_FOUND`). Each check now uses its own clone names.
|
|
8
|
+
- The job template's task also sets `disable_auto_optimization: true`. On serverless, auto-optimization retries failed tasks even with `max_retries: 0`, so a `block` was still run twice.
|
|
9
|
+
- The job template now pins the bricksentry version (new `bricksentry_version` prompt, default the current release). Correction to the 0.1.15 release notes: a job deployed with `>=0.1.14` does **not** pick up new releases by itself, because serverless resolves a job's dependencies once and caches them. To upgrade, change the version in the job's YAML and redeploy; the generated README says so.
|
|
10
|
+
|
|
11
|
+
## 0.1.15 (2026-11-11)
|
|
12
|
+
|
|
13
|
+
From the first live test of the 0.1.14 job template on Databricks serverless (deployed with `databricks bundle deploy`, started by the table update trigger and by hand):
|
|
14
|
+
|
|
15
|
+
- Fix: every run of the job task was marked failed, even "pass" and "nothing to check", because Databricks treats any `SystemExit` from a Python script task as an error, including exit code 0. `python -m bricksentry.job` now only exits when the task should fail (verdict at or above `--fail-on`, or an error).
|
|
16
|
+
- The bundle template now asks for key columns (`keys`, e.g. `main.hr.employees=employee_id`), for tables without a `PRIMARY KEY`. Before, those runs failed with "No key columns" until `--key` was added by hand. The job task takes several at once with `--keys "t1=a,b; t2=c"`.
|
|
17
|
+
- The template's task sets `max_retries: 0`, so a `block` verdict fails the run once instead of being retried.
|
|
18
|
+
- Fix: the source distribution on PyPI had only some of the bundle template's files (and the Databricks App kit was missing). It now includes `templates/` and `deploy/` in full.
|
|
19
|
+
|
|
3
20
|
## 0.1.14 (2026-11-11)
|
|
4
21
|
|
|
5
22
|
Zero-friction adoption: check every pipeline run without changing the pipeline.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bricksentry
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.16
|
|
4
4
|
Summary: Change-safety for Databricks pipelines and the AI agents that edit them: data diffs, Unity Catalog blast radius, policy verdicts and rollback plans.
|
|
5
5
|
Project-URL: Homepage, https://bricksentry.org
|
|
6
6
|
Project-URL: Documentation, https://bricksentry.org/docs
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Databricks Apps entry point for the bricksentry MCP server.
|
|
2
|
+
# The app listens on $DATABRICKS_APP_PORT (bricksentry picks it up) and serves MCP at /mcp.
|
|
3
|
+
# --read-only leaves out preview_write, so agents can check changes but the app never writes.
|
|
4
|
+
# Remove it to allow previews on sandbox clones (needs CREATE TABLE on sandbox_schema, see grants.sql).
|
|
5
|
+
command: ["bricksentry", "mcp", "--transport", "streamable-http", "--read-only", "--config", "bricksentry.yml"]
|
|
6
|
+
env:
|
|
7
|
+
- name: DATABRICKS_WAREHOUSE_ID
|
|
8
|
+
valueFrom: sql-warehouse # the SQL warehouse resource added to the app
|
|
9
|
+
- name: BRICKSENTRY_STORE
|
|
10
|
+
value: /tmp/bricksentry/assessments
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# bricksentry config for the Databricks App. The warehouse comes from the app's
|
|
2
|
+
# sql-warehouse resource (DATABRICKS_WAREHOUSE_ID); auth is the app's service principal.
|
|
3
|
+
backend:
|
|
4
|
+
type: databricks
|
|
5
|
+
lineage:
|
|
6
|
+
type: databricks
|
|
7
|
+
depth: 3
|
|
8
|
+
lookback_days: 90
|
|
9
|
+
sandbox_schema: main.bricksentry_sandbox # only used if you remove --read-only from app.yaml
|
|
10
|
+
policy: builtin:agent-safe # see `bricksentry policies`
|
|
11
|
+
|
|
12
|
+
# Tables agents may assess, with the keys that identify a row.
|
|
13
|
+
# assess_change needs keys for a table; preview_write can also take them as an argument.
|
|
14
|
+
tables:
|
|
15
|
+
main.sales.orders:
|
|
16
|
+
keys: [order_id]
|
|
17
|
+
|
|
18
|
+
# Optional: post needs_human / block verdicts to Slack. Add the webhook as an app secret
|
|
19
|
+
# and expose it with `valueFrom` in app.yaml, then uncomment:
|
|
20
|
+
# notify:
|
|
21
|
+
# slack_webhook: env:BRICKSENTRY_SLACK_WEBHOOK
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Deploy with Databricks Asset Bundles:
|
|
2
|
+
# databricks bundle deploy --var warehouse_id=<your-sql-warehouse-id>
|
|
3
|
+
# databricks bundle run bricksentry_mcp
|
|
4
|
+
bundle:
|
|
5
|
+
name: bricksentry-mcp
|
|
6
|
+
|
|
7
|
+
variables:
|
|
8
|
+
warehouse_id:
|
|
9
|
+
description: SQL warehouse bricksentry runs its checks on
|
|
10
|
+
|
|
11
|
+
resources:
|
|
12
|
+
apps:
|
|
13
|
+
bricksentry_mcp:
|
|
14
|
+
name: mcp-bricksentry
|
|
15
|
+
description: bricksentry MCP server - checks what a data change does before it ships
|
|
16
|
+
source_code_path: .
|
|
17
|
+
resources:
|
|
18
|
+
- name: sql-warehouse
|
|
19
|
+
sql_warehouse:
|
|
20
|
+
id: ${var.warehouse_id}
|
|
21
|
+
permission: CAN_USE
|
|
22
|
+
|
|
23
|
+
targets:
|
|
24
|
+
dev:
|
|
25
|
+
default: true
|
|
26
|
+
mode: development
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
-- Grants for the bricksentry app's service principal.
|
|
2
|
+
-- Find its application ID on the app's page (Authorization tab, "Service principal"),
|
|
3
|
+
-- then replace `<app-sp>` below. Adjust catalogs and schemas to the tables agents will check.
|
|
4
|
+
|
|
5
|
+
-- Tables bricksentry may read (the base tables and the candidate tables your CI builds)
|
|
6
|
+
GRANT USE CATALOG ON CATALOG main TO `<app-sp>`;
|
|
7
|
+
GRANT USE SCHEMA ON SCHEMA main.sales TO `<app-sp>`;
|
|
8
|
+
GRANT SELECT ON SCHEMA main.sales TO `<app-sp>`;
|
|
9
|
+
|
|
10
|
+
-- Blast radius: Unity Catalog lineage. Without it, checks still run and add a
|
|
11
|
+
-- lineage-unavailable warning.
|
|
12
|
+
GRANT USE CATALOG ON CATALOG system TO `<app-sp>`;
|
|
13
|
+
GRANT USE SCHEMA ON SCHEMA system.access TO `<app-sp>`;
|
|
14
|
+
GRANT SELECT ON TABLE system.access.table_lineage TO `<app-sp>`;
|
|
15
|
+
GRANT SELECT ON TABLE system.access.column_lineage TO `<app-sp>`; -- column-level impact
|
|
16
|
+
|
|
17
|
+
-- Only if you remove --read-only from app.yaml: previews run on shallow clones here.
|
|
18
|
+
-- CREATE SCHEMA IF NOT EXISTS main.bricksentry_sandbox;
|
|
19
|
+
-- GRANT USE SCHEMA, CREATE TABLE ON SCHEMA main.bricksentry_sandbox TO `<app-sp>`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bricksentry[databricks,mcp]==0.1.16
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bricksentry"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.16"
|
|
8
8
|
description = "Change-safety for Databricks pipelines and the AI agents that edit them: data diffs, Unity Catalog blast radius, policy verdicts and rollback plans."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -51,7 +51,7 @@ Issues = "https://github.com/bricksentry/bricksentry/issues"
|
|
|
51
51
|
Changelog = "https://github.com/bricksentry/bricksentry/blob/main/CHANGELOG.md"
|
|
52
52
|
|
|
53
53
|
[tool.hatch.build.targets.sdist]
|
|
54
|
-
include = ["src", "tests", "examples", "scripts", "README.md", "LICENSE", "CHANGELOG.md", "CONTRIBUTING.md", "SECURITY.md", "action.yml"]
|
|
54
|
+
include = ["/src", "/tests", "/examples", "/scripts", "/templates", "/deploy", "/README.md", "/LICENSE", "/CHANGELOG.md", "/CONTRIBUTING.md", "/SECURITY.md", "/action.yml", "/server.json"]
|
|
55
55
|
|
|
56
56
|
[tool.hatch.build.targets.wheel]
|
|
57
57
|
packages = ["src/bricksentry"]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.bricksentry/bricksentry",
|
|
4
|
+
"title": "bricksentry",
|
|
5
|
+
"description": "Safety check for AI agent and pipeline writes to Databricks tables, before they reach production.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "https://github.com/bricksentry/bricksentry",
|
|
8
|
+
"source": "github"
|
|
9
|
+
},
|
|
10
|
+
"websiteUrl": "https://bricksentry.org",
|
|
11
|
+
"version": "0.1.16",
|
|
12
|
+
"packages": [
|
|
13
|
+
{
|
|
14
|
+
"registryType": "pypi",
|
|
15
|
+
"identifier": "bricksentry-mcp",
|
|
16
|
+
"version": "0.1.16",
|
|
17
|
+
"runtimeHint": "uvx",
|
|
18
|
+
"transport": {
|
|
19
|
+
"type": "stdio"
|
|
20
|
+
},
|
|
21
|
+
"environmentVariables": [
|
|
22
|
+
{
|
|
23
|
+
"name": "BRICKSENTRY_CONFIG",
|
|
24
|
+
"description": "Path to your bricksentry.yml (backend, tables and policy).",
|
|
25
|
+
"isRequired": false
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "DATABRICKS_HOST",
|
|
29
|
+
"description": "Databricks workspace URL, when using the Databricks backend.",
|
|
30
|
+
"isRequired": false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "DATABRICKS_TOKEN",
|
|
34
|
+
"description": "Databricks access token, when using the Databricks backend.",
|
|
35
|
+
"isRequired": false,
|
|
36
|
+
"isSecret": true
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -9,6 +9,7 @@ version after), diffs them, runs lineage and policy, and returns the assessment
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
11
|
import re
|
|
12
|
+
import uuid
|
|
12
13
|
from dataclasses import dataclass
|
|
13
14
|
from datetime import datetime, timezone
|
|
14
15
|
from typing import TYPE_CHECKING, Any
|
|
@@ -123,9 +124,9 @@ def pick_change(
|
|
|
123
124
|
str(h.get("timestamp") or ""), [h["version"]])
|
|
124
125
|
|
|
125
126
|
|
|
126
|
-
def _scratch_name(schema: str, table: str, version: int) -> str:
|
|
127
|
+
def _scratch_name(schema: str, table: str, version: int, run: str) -> str:
|
|
127
128
|
short = re.sub(r"[^A-Za-z0-9_]", "_", table.split(".")[-1])[:40]
|
|
128
|
-
return f"{schema}.bs_check_{short}_v{version}"
|
|
129
|
+
return f"{schema}.bs_check_{short}_v{version}_{run}"
|
|
129
130
|
|
|
130
131
|
|
|
131
132
|
def check_change(
|
|
@@ -154,8 +155,11 @@ def check_change(
|
|
|
154
155
|
"or add a PRIMARY KEY constraint to the table.")
|
|
155
156
|
|
|
156
157
|
scratch = sentry.config.sandbox_schema
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
# Unique per check, so two checks of the same table at the same time (two jobs, or a job
|
|
159
|
+
# and a notebook) never drop each other's clones.
|
|
160
|
+
run = uuid.uuid4().hex[:8]
|
|
161
|
+
base = _scratch_name(scratch, table, change.base_version, run)
|
|
162
|
+
cand = _scratch_name(scratch, table, change.version, run)
|
|
159
163
|
db.ensure_schema(scratch)
|
|
160
164
|
try:
|
|
161
165
|
for target, v in ((base, change.base_version), (cand, change.version)):
|
|
@@ -78,6 +78,8 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
78
78
|
p.add_argument("--warehouse-id", default=os.environ.get("DATABRICKS_WAREHOUSE_ID"))
|
|
79
79
|
p.add_argument("--config", default=None, help="Optional bricksentry.yml (keys, policy, lineage, notify)")
|
|
80
80
|
p.add_argument("--key", action="append", default=[], help="order_id or TABLE=col1,col2 (repeatable)")
|
|
81
|
+
p.add_argument("--keys", default=None,
|
|
82
|
+
help="Several at once, separated by ';': 'main.s.orders=order_id; main.s.items=order_id,line'")
|
|
81
83
|
p.add_argument("--policy", default=None, help="Built-in policy name (default, strict, finance, pii, ...)")
|
|
82
84
|
p.add_argument("--scratch-schema", default=None, help="catalog.schema for the temporary shallow clones")
|
|
83
85
|
p.add_argument("--default-tables", default=None,
|
|
@@ -143,7 +145,7 @@ def run(argv: list[str] | None = None, backend: Any = None, out=print) -> int:
|
|
|
143
145
|
if not tables:
|
|
144
146
|
out("bricksentry: no tables to check.")
|
|
145
147
|
return 0
|
|
146
|
-
keys = parse_keys(args.key)
|
|
148
|
+
keys = parse_keys(args.key + [k for k in (args.keys or "").split(";") if k.strip()])
|
|
147
149
|
s = make_sentry(args, backend=backend)
|
|
148
150
|
worst: Verdict | None = None
|
|
149
151
|
errors = 0
|
|
@@ -176,8 +178,12 @@ def run(argv: list[str] | None = None, backend: Any = None, out=print) -> int:
|
|
|
176
178
|
return 0
|
|
177
179
|
|
|
178
180
|
|
|
179
|
-
def main(argv: list[str] | None = None) -> None:
|
|
180
|
-
|
|
181
|
+
def main(argv: list[str] | None = None) -> None:
|
|
182
|
+
"""Exit only on failure. Databricks reports any SystemExit from a spark_python_task,
|
|
183
|
+
even ``SystemExit(0)``, as a task error, so a clean run must simply return."""
|
|
184
|
+
code = run(argv)
|
|
185
|
+
if code:
|
|
186
|
+
sys.exit(code)
|
|
181
187
|
|
|
182
188
|
|
|
183
189
|
if __name__ == "__main__": # pragma: no cover
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"welcome_message": "bricksentry: check what every pipeline run did to your tables, alert on Slack, and get the RESTORE to undo it.",
|
|
3
|
+
"properties": {
|
|
4
|
+
"project_name": {
|
|
5
|
+
"type": "string",
|
|
6
|
+
"default": "bricksentry_check",
|
|
7
|
+
"description": "Name for this bundle (letters, digits, underscores)",
|
|
8
|
+
"pattern": "^[A-Za-z0-9_]+$",
|
|
9
|
+
"pattern_match_failure_message": "Use letters, digits and underscores only.",
|
|
10
|
+
"order": 1
|
|
11
|
+
},
|
|
12
|
+
"tables": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Tables to watch, comma-separated catalog.schema.table names (up to 10)",
|
|
15
|
+
"pattern": "^[A-Za-z0-9_]+\\.[A-Za-z0-9_]+\\.[A-Za-z0-9_]+(\\s*,\\s*[A-Za-z0-9_]+\\.[A-Za-z0-9_]+\\.[A-Za-z0-9_]+){0,9}$",
|
|
16
|
+
"pattern_match_failure_message": "Enter 1 to 10 full names like main.sales.orders, separated by commas.",
|
|
17
|
+
"order": 2
|
|
18
|
+
},
|
|
19
|
+
"keys": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"default": "",
|
|
22
|
+
"description": "Key columns for tables without a PRIMARY KEY: table=col1,col2 separated by ';' (e.g. main.sales.orders=order_id). Leave empty to use each table's PRIMARY KEY",
|
|
23
|
+
"pattern": "^(\\s*[A-Za-z0-9_]+\\.[A-Za-z0-9_]+\\.[A-Za-z0-9_]+\\s*=\\s*[A-Za-z0-9_]+(\\s*,\\s*[A-Za-z0-9_]+)*\\s*(;|$))*$",
|
|
24
|
+
"pattern_match_failure_message": "Use catalog.schema.table=col1,col2; separate tables with ';'. Or leave empty.",
|
|
25
|
+
"order": 3
|
|
26
|
+
},
|
|
27
|
+
"warehouse_id": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "SQL warehouse ID (SQL Warehouses -> your warehouse -> Connection details)",
|
|
30
|
+
"pattern": "^[A-Za-z0-9]+$",
|
|
31
|
+
"pattern_match_failure_message": "Paste the warehouse ID only, e.g. 1a2b3c4d5e6f7a8b.",
|
|
32
|
+
"order": 4
|
|
33
|
+
},
|
|
34
|
+
"scratch_schema": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"default": "main.bricksentry_scratch",
|
|
37
|
+
"description": "catalog.schema for the temporary shallow clones (created if missing; clones are dropped after each check)",
|
|
38
|
+
"pattern": "^[A-Za-z0-9_]+\\.[A-Za-z0-9_]+$",
|
|
39
|
+
"pattern_match_failure_message": "Use catalog.schema.",
|
|
40
|
+
"order": 5
|
|
41
|
+
},
|
|
42
|
+
"policy": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"default": "default",
|
|
45
|
+
"enum": [
|
|
46
|
+
"default",
|
|
47
|
+
"strict",
|
|
48
|
+
"finance",
|
|
49
|
+
"pii",
|
|
50
|
+
"certified",
|
|
51
|
+
"agent-safe"
|
|
52
|
+
],
|
|
53
|
+
"description": "Policy for the verdict",
|
|
54
|
+
"order": 6
|
|
55
|
+
},
|
|
56
|
+
"slack_secret": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"default": "",
|
|
59
|
+
"description": "Slack webhook as a secret, scope/key (e.g. bricksentry/slack_webhook). Leave empty for no alerts",
|
|
60
|
+
"pattern": "^([A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)?$",
|
|
61
|
+
"pattern_match_failure_message": "Use scope/key, or leave empty.",
|
|
62
|
+
"order": 7
|
|
63
|
+
},
|
|
64
|
+
"fail_on": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"default": "block",
|
|
67
|
+
"enum": [
|
|
68
|
+
"block",
|
|
69
|
+
"needs_human",
|
|
70
|
+
"warn",
|
|
71
|
+
"never"
|
|
72
|
+
],
|
|
73
|
+
"description": "Mark the run failed when the verdict is at least",
|
|
74
|
+
"order": 8
|
|
75
|
+
},
|
|
76
|
+
"bricksentry_version": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"default": "0.1.16",
|
|
79
|
+
"description": "bricksentry version to install in the job (pinned; change it and redeploy to upgrade)",
|
|
80
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
81
|
+
"pattern_match_failure_message": "Use a version like 0.1.16.",
|
|
82
|
+
"order": 9
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"success_message": "Created {{.project_name}}. Next: cd {{.project_name}} && databricks bundle deploy. See {{.project_name}}/README.md."
|
|
86
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# {{.project_name}}: bricksentry checks for your tables
|
|
2
|
+
|
|
3
|
+
This bundle deploys one serverless job, **bricksentry check ({{.project_name}})**. When any of
|
|
4
|
+
these tables changes, it runs and checks what changed:
|
|
5
|
+
|
|
6
|
+
{{.tables}}
|
|
7
|
+
|
|
8
|
+
For each table it compares the version before the change with the version after it (two
|
|
9
|
+
shallow clones in `{{.scratch_schema}}`, dropped after the check; your tables are only read).
|
|
10
|
+
It reports rows added, removed and changed, duplicate or NULL keys, schema changes and totals
|
|
11
|
+
that moved, plus what depends on the table (Unity Catalog lineage). The `{{.policy}}` policy turns
|
|
12
|
+
that into a verdict: pass, warn, needs_human or block. The run log shows the `RESTORE` statement
|
|
13
|
+
that undoes the change.{{if .slack_secret}} Alerts go to Slack using the webhook in the secret `{{.slack_secret}}`.{{end}}
|
|
14
|
+
The run is marked failed when the verdict is `{{.fail_on}}` or worse.
|
|
15
|
+
|
|
16
|
+
## Deploy
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
databricks bundle deploy # dev: the job is named [dev you] ... and its trigger is paused
|
|
20
|
+
databricks bundle deploy -t prod # prod: the trigger is live
|
|
21
|
+
databricks bundle run bricksentry_check # run once now (checks the last 60 minutes)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The job's identity needs `SELECT` on the tables, `USE` and `CREATE TABLE` on
|
|
25
|
+
`{{.scratch_schema}}`, `CAN USE` on the warehouse, `SELECT` on `system.access.table_lineage` (for
|
|
26
|
+
lineage){{if .slack_secret}}, and `READ` on the secret scope{{end}}. Table history must still be there
|
|
27
|
+
(not removed by `VACUUM`).
|
|
28
|
+
|
|
29
|
+
## Upgrading bricksentry
|
|
30
|
+
|
|
31
|
+
The job installs `bricksentry[databricks]=={{.bricksentry_version}}`. Serverless resolves a job's
|
|
32
|
+
dependencies once and caches them, so to upgrade, change that version in
|
|
33
|
+
`resources/bricksentry_check.job.yml` and run `databricks bundle deploy` again.
|
|
34
|
+
|
|
35
|
+
## Slack alerts
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
databricks secrets create-scope bricksentry
|
|
39
|
+
databricks secrets put-secret bricksentry slack_webhook # paste the webhook URL when asked
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then add `--slack-secret bricksentry/slack_webhook` to the task parameters in
|
|
43
|
+
`resources/bricksentry_check.job.yml`. For Teams use `--teams-secret`.
|
|
44
|
+
|
|
45
|
+
## Stop downstream tasks instead of only alerting
|
|
46
|
+
|
|
47
|
+
This job runs after the change has landed. To stop the tasks that read a table when its
|
|
48
|
+
change is bad, add the check as a task inside your pipeline job, right after the task that
|
|
49
|
+
writes the table:
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
- task_key: bricksentry_check
|
|
53
|
+
depends_on: [{task_key: your_write_task}]
|
|
54
|
+
environment_key: bricksentry
|
|
55
|
+
spark_python_task:
|
|
56
|
+
python_file: ../src/bricksentry_check.py
|
|
57
|
+
parameters: [--tables, main.sales.orders, --warehouse-id, "{{.warehouse_id}}",
|
|
58
|
+
--scratch-schema, "{{.scratch_schema}}",{{if .keys}} --keys, "{{.keys}}",{{end}}
|
|
59
|
+
--since, "{{`{{job.start_time.iso_datetime}}`}}"]
|
|
60
|
+
- task_key: your_downstream_task
|
|
61
|
+
depends_on: [{task_key: bricksentry_check}]
|
|
62
|
+
environments:
|
|
63
|
+
- environment_key: bricksentry
|
|
64
|
+
spec: {environment_version: "2", dependencies: ["bricksentry[databricks]=={{.bricksentry_version}}"]}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`--since {{`{{job.start_time.iso_datetime}}`}}` checks everything this run wrote as one change.
|
|
68
|
+
When the verdict is `block`, the check task fails and `your_downstream_task` does not run.
|
|
69
|
+
|
|
70
|
+
## Options
|
|
71
|
+
|
|
72
|
+
`python -m bricksentry.job --help` lists them: `--keys "TABLE=col1,col2; TABLE2=col"` for tables
|
|
73
|
+
without a primary key{{if .keys}} (this bundle sets `{{.keys}}`){{end}}, `--config bricksentry.yml` for keys, lineage, owners and Slack mentions,
|
|
74
|
+
`--notify-on`, `--sample-pct` for very large tables. Docs: https://bricksentry.org
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# bricksentry: check what every pipeline run did to your tables.
|
|
2
|
+
# Docs: https://bricksentry.org/docs/jobs
|
|
3
|
+
bundle:
|
|
4
|
+
name: {{.project_name}}
|
|
5
|
+
|
|
6
|
+
include:
|
|
7
|
+
- resources/*.yml
|
|
8
|
+
|
|
9
|
+
targets:
|
|
10
|
+
dev:
|
|
11
|
+
mode: development
|
|
12
|
+
default: true
|
|
13
|
+
prod:
|
|
14
|
+
mode: production
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Runs after any watched table changes (Delta commit), checks what changed, alerts, and
|
|
2
|
+
# fails the run when the verdict is at least --fail-on. OPTIMIZE / VACUUM commits also
|
|
3
|
+
# start a run; they have no data change, so the run just finishes ("nothing to check").
|
|
4
|
+
resources:
|
|
5
|
+
jobs:
|
|
6
|
+
bricksentry_check:
|
|
7
|
+
name: bricksentry check ({{.project_name}})
|
|
8
|
+
max_concurrent_runs: 1
|
|
9
|
+
trigger:
|
|
10
|
+
pause_status: UNPAUSED
|
|
11
|
+
table_update:
|
|
12
|
+
table_names: [{{.tables}}]
|
|
13
|
+
condition: ANY_UPDATED
|
|
14
|
+
# Wait until the pipeline has stopped writing, so one run covers all its commits.
|
|
15
|
+
wait_after_last_change_seconds: 120
|
|
16
|
+
tasks:
|
|
17
|
+
- task_key: bricksentry_check
|
|
18
|
+
environment_key: default
|
|
19
|
+
# A block verdict is an answer, not a flaky failure: no retries. On serverless,
|
|
20
|
+
# auto-optimization retries failed tasks even with max_retries: 0, so turn it off too.
|
|
21
|
+
max_retries: 0
|
|
22
|
+
disable_auto_optimization: true
|
|
23
|
+
spark_python_task:
|
|
24
|
+
python_file: ../src/bricksentry_check.py
|
|
25
|
+
parameters:
|
|
26
|
+
- --tables
|
|
27
|
+
- "{{`{{job.trigger.table_update.updated_tables}}`}}"
|
|
28
|
+
- --default-tables
|
|
29
|
+
- "{{.tables}}"
|
|
30
|
+
# Every data change in the last 60 minutes is checked as one change.
|
|
31
|
+
- --since-minutes
|
|
32
|
+
- "60"
|
|
33
|
+
- --warehouse-id
|
|
34
|
+
- "{{.warehouse_id}}"
|
|
35
|
+
- --scratch-schema
|
|
36
|
+
- "{{.scratch_schema}}"
|
|
37
|
+
- --policy
|
|
38
|
+
- "{{.policy}}"
|
|
39
|
+
- --fail-on
|
|
40
|
+
- "{{.fail_on}}"
|
|
41
|
+
{{- if .keys}}
|
|
42
|
+
- --keys
|
|
43
|
+
- "{{.keys}}"
|
|
44
|
+
{{- end}}
|
|
45
|
+
{{- if .slack_secret}}
|
|
46
|
+
- --slack-secret
|
|
47
|
+
- "{{.slack_secret}}"
|
|
48
|
+
{{- end}}
|
|
49
|
+
- --run-url
|
|
50
|
+
- "{{`{{workspace.url}}/jobs/{{job.id}}/runs/{{job.run_id}}`}}"
|
|
51
|
+
# Tables without a PRIMARY KEY need key columns: --keys "main.sales.orders=order_id; ..."
|
|
52
|
+
environments:
|
|
53
|
+
- environment_key: default
|
|
54
|
+
spec:
|
|
55
|
+
environment_version: "2"
|
|
56
|
+
dependencies:
|
|
57
|
+
# Pinned: serverless resolves the dependencies once and caches them, so a range
|
|
58
|
+
# would not pick up new releases. To upgrade, change the version and redeploy.
|
|
59
|
+
- bricksentry[databricks]=={{.bricksentry_version}}
|
|
@@ -113,8 +113,10 @@ def test_check_change_end_to_end():
|
|
|
113
113
|
assert t.rollback == 'RESTORE TABLE "sales"."orders" TO VERSION AS OF 2'
|
|
114
114
|
assert t.summary.startswith("v2 -> v3 (MERGE): ")
|
|
115
115
|
assert [n.name for n in t.downstream] == ["sales.daily_revenue"]
|
|
116
|
-
assert
|
|
117
|
-
|
|
116
|
+
assert [re.sub(r"_[0-9a-f]{8}$", "", d) for d in db.dropped] == [
|
|
117
|
+
"scratch.bs_check_orders_v2", "scratch.bs_check_orders_v3"]
|
|
118
|
+
assert db.dropped[0][-8:] == db.dropped[1][-8:] # one run id per check
|
|
119
|
+
assert not any(db.table_exists(d) for d in db.dropped)
|
|
118
120
|
|
|
119
121
|
|
|
120
122
|
def test_check_change_since_and_keys_from_config():
|
|
@@ -311,8 +313,8 @@ def _render(text: str, values: dict) -> str:
|
|
|
311
313
|
return text
|
|
312
314
|
|
|
313
315
|
|
|
314
|
-
@pytest.mark.parametrize("slack", ["bricksentry/slack_webhook", ""])
|
|
315
|
-
def test_bundle_template_renders(slack):
|
|
316
|
+
@pytest.mark.parametrize("slack,keys", [("bricksentry/slack_webhook", "main.sales.orders=order_id"), ("", "")])
|
|
317
|
+
def test_bundle_template_renders(slack, keys):
|
|
316
318
|
from pathlib import Path
|
|
317
319
|
|
|
318
320
|
import yaml
|
|
@@ -320,7 +322,9 @@ def test_bundle_template_renders(slack):
|
|
|
320
322
|
root = Path(__file__).resolve().parents[1] / "templates" / "job-check"
|
|
321
323
|
schema = json.loads((root / "databricks_template_schema.json").read_text())
|
|
322
324
|
values = {k: p.get("default", "") for k, p in schema["properties"].items()}
|
|
323
|
-
values
|
|
325
|
+
assert values["bricksentry_version"] == __import__("bricksentry").__version__
|
|
326
|
+
values.update(tables="main.sales.orders, main.sales.customers", warehouse_id="abc123", slack_secret=slack,
|
|
327
|
+
keys=keys)
|
|
324
328
|
for k, p in schema["properties"].items():
|
|
325
329
|
if "pattern" in p:
|
|
326
330
|
assert re.fullmatch(p["pattern"], values[k]), k
|
|
@@ -335,6 +339,9 @@ def test_bundle_template_renders(slack):
|
|
|
335
339
|
assert params[:2] == ["--tables", "{{job.trigger.table_update.updated_tables}}"]
|
|
336
340
|
assert "{{workspace.url}}/jobs/{{job.id}}/runs/{{job.run_id}}" in params
|
|
337
341
|
assert ("--slack-secret" in params) == bool(slack)
|
|
342
|
+
assert ("--keys" in params) == bool(keys)
|
|
343
|
+
assert task["max_retries"] == 0 and task["disable_auto_optimization"] is True
|
|
344
|
+
assert j["environments"][0]["spec"]["dependencies"] == [f"bricksentry[databricks]=={values['bricksentry_version']}"]
|
|
338
345
|
assert task["environment_key"] == j["environments"][0]["environment_key"]
|
|
339
346
|
assert j["environments"][0]["spec"]["dependencies"][0].startswith("bricksentry[databricks]")
|
|
340
347
|
# the job task's argv parses, and an unresolved trigger value falls back to --default-tables
|
|
@@ -355,3 +362,29 @@ def test_job_unresolved_trigger_value_uses_default_tables():
|
|
|
355
362
|
def test_yaml_on_key_is_read():
|
|
356
363
|
cfg = Config.from_dict(__import__("yaml").safe_load("notify:\n on: block\n"))
|
|
357
364
|
assert cfg.notify == {"on": "block"} and not cfg.warnings
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def test_job_main_returns_on_success_and_exits_on_failure(monkeypatch):
|
|
368
|
+
# Databricks marks a spark_python_task failed on any SystemExit, even 0 (found live in 0.1.14).
|
|
369
|
+
monkeypatch.setattr(job, "run", lambda argv: 0)
|
|
370
|
+
assert job.main([]) is None
|
|
371
|
+
monkeypatch.setattr(job, "run", lambda argv: 1)
|
|
372
|
+
with pytest.raises(SystemExit) as e:
|
|
373
|
+
job.main([])
|
|
374
|
+
assert e.value.code == 1
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
def test_job_keys_option():
|
|
378
|
+
lines: list[str] = []
|
|
379
|
+
code = job.run(["--tables", "sales.orders", "--keys", "sales.orders=order_id; sales.other=x",
|
|
380
|
+
"--scratch-schema", "scratch", "--fail-on", "never"], backend=FakeDelta(pk=()), out=lines.append)
|
|
381
|
+
assert code == 0 and "sales.orders: BLOCK" in lines[0]
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
def test_concurrent_checks_use_different_clones():
|
|
385
|
+
"""Two checks of the same table must not share clone names (found live: one job's cleanup
|
|
386
|
+
dropped the other's clone mid-diff)."""
|
|
387
|
+
db = FakeDelta()
|
|
388
|
+
sentry(db).check_change("sales.orders")
|
|
389
|
+
sentry(db).check_change("sales.orders")
|
|
390
|
+
assert len(set(db.dropped)) == 4
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Apache License
|
|
3
|
-
Version 2.0, January 2004
|
|
4
|
-
http://www.apache.org/licenses/
|
|
5
|
-
|
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
-
|
|
8
|
-
1. Definitions.
|
|
9
|
-
|
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
-
|
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
-
the copyright owner that is granting the License.
|
|
15
|
-
|
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
-
other entities that control, are controlled by, or are under common
|
|
18
|
-
control with that entity. For the purposes of this definition,
|
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
-
direction or management of such entity, whether by contract or
|
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
-
exercising permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
-
including but not limited to software source code, documentation
|
|
29
|
-
source, and configuration files.
|
|
30
|
-
|
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
|
32
|
-
transformation or translation of a Source form, including but
|
|
33
|
-
not limited to compiled object code, generated documentation,
|
|
34
|
-
and conversions to other media types.
|
|
35
|
-
|
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
-
Object form, made available under the License, as indicated by a
|
|
38
|
-
copyright notice that is included in or attached to the work
|
|
39
|
-
(an example is provided in the Appendix below).
|
|
40
|
-
|
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
-
the Work and Derivative Works thereof.
|
|
48
|
-
|
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
|
50
|
-
the original version of the Work and any modifications or additions
|
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
-
|
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
-
subsequently incorporated within the Work.
|
|
66
|
-
|
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
|
73
|
-
|
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
-
where such license applies only to those patent claims licensable
|
|
80
|
-
by such Contributor that are necessarily infringed by their
|
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
-
institute patent litigation against any entity (including a
|
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
-
or contributory patent infringement, then any patent licenses
|
|
87
|
-
granted to You under this License for that Work shall terminate
|
|
88
|
-
as of the date such litigation is filed.
|
|
89
|
-
|
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
-
modifications, and in Source or Object form, provided that You
|
|
93
|
-
meet the following conditions:
|
|
94
|
-
|
|
95
|
-
(a) You must give any other recipients of the Work or
|
|
96
|
-
Derivative Works a copy of this License; and
|
|
97
|
-
|
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
|
99
|
-
stating that You changed the files; and
|
|
100
|
-
|
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
|
103
|
-
attribution notices from the Source form of the Work,
|
|
104
|
-
excluding those notices that do not pertain to any part of
|
|
105
|
-
the Derivative Works; and
|
|
106
|
-
|
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
|
109
|
-
include a readable copy of the attribution notices contained
|
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
|
112
|
-
of the following places: within a NOTICE text file distributed
|
|
113
|
-
as part of the Derivative Works; within the Source form or
|
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
|
115
|
-
within a display generated by the Derivative Works, if and
|
|
116
|
-
wherever such third-party notices normally appear. The contents
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
-
|
|
181
|
-
To apply the Apache License to your work, attach the following
|
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
-
replaced with your own identifying information. (Don't include
|
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format. We also recommend that a
|
|
186
|
-
file or class name and description of purpose be included on the
|
|
187
|
-
same "printed page" as the copyright notice for easier
|
|
188
|
-
identification within third-party archives.
|
|
189
|
-
|
|
190
|
-
Copyright [yyyy] [name of copyright owner]
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# bricksentry-mcp
|
|
2
|
-
|
|
3
|
-
<!-- mcp-name: io.github.bricksentry/bricksentry -->
|
|
4
|
-
|
|
5
|
-
The MCP server for [bricksentry](https://github.com/bricksentry/bricksentry), the safety check for data changes in the AI era. This package only installs `bricksentry` with its MCP and Databricks extras and gives you one command, so agents can start the server with `uvx`:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
uvx bricksentry-mcp --config /full/path/to/bricksentry.yml
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
**Claude Code**
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
claude mcp add bricksentry -- uvx bricksentry-mcp --config /full/path/to/bricksentry.yml
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Claude desktop, Cursor and other clients** (`mcpServers` config):
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"mcpServers": {
|
|
22
|
-
"bricksentry": {
|
|
23
|
-
"command": "uvx",
|
|
24
|
-
"args": ["bricksentry-mcp", "--config", "/full/path/to/bricksentry.yml"]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Use a full path to `bricksentry.yml`: clients start the server from their own working folder. If an app can't find `uvx`, use its full path (`which uvx`).
|
|
31
|
-
|
|
32
|
-
`bricksentry-mcp` accepts the same options as `bricksentry mcp`, for example `--transport streamable-http`. Docs: [bricksentry.org/docs/agents](https://bricksentry.org/docs/agents). License: Apache-2.0.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_check_my_table.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
{bricksentry-0.1.14 → bricksentry-0.1.16}/examples/databricks/bricksentry_hr_walkthrough.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|