bricksentry 0.1.33__tar.gz → 0.1.34__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.
Files changed (101) hide show
  1. {bricksentry-0.1.33 → bricksentry-0.1.34}/CHANGELOG.md +8 -0
  2. {bricksentry-0.1.33 → bricksentry-0.1.34}/PKG-INFO +1 -1
  3. bricksentry-0.1.34/deploy/databricks-app/requirements.txt +1 -0
  4. {bricksentry-0.1.33 → bricksentry-0.1.34}/pyproject.toml +1 -1
  5. {bricksentry-0.1.33 → bricksentry-0.1.34}/server.json +2 -2
  6. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/__init__.py +1 -1
  7. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/job.py +17 -2
  8. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/databricks_template_schema.json +2 -2
  9. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0131.py +1 -1
  10. bricksentry-0.1.34/tests/test_0134.py +38 -0
  11. bricksentry-0.1.33/deploy/databricks-app/requirements.txt +0 -1
  12. {bricksentry-0.1.33 → bricksentry-0.1.34}/.gitignore +0 -0
  13. {bricksentry-0.1.33 → bricksentry-0.1.34}/CONTRIBUTING.md +0 -0
  14. {bricksentry-0.1.33 → bricksentry-0.1.34}/LICENSE +0 -0
  15. {bricksentry-0.1.33 → bricksentry-0.1.34}/README.md +0 -0
  16. {bricksentry-0.1.33 → bricksentry-0.1.34}/SECURITY.md +0 -0
  17. {bricksentry-0.1.33 → bricksentry-0.1.34}/action.yml +0 -0
  18. {bricksentry-0.1.33 → bricksentry-0.1.34}/deploy/container/Dockerfile +0 -0
  19. {bricksentry-0.1.33 → bricksentry-0.1.34}/deploy/databricks-app/README.md +0 -0
  20. {bricksentry-0.1.33 → bricksentry-0.1.34}/deploy/databricks-app/app.yaml +0 -0
  21. {bricksentry-0.1.33 → bricksentry-0.1.34}/deploy/databricks-app/bricksentry.yml +0 -0
  22. {bricksentry-0.1.33 → bricksentry-0.1.34}/deploy/databricks-app/databricks.yml +0 -0
  23. {bricksentry-0.1.33 → bricksentry-0.1.34}/deploy/databricks-app/grants.sql +0 -0
  24. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry.yml +0 -0
  25. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_check_my_table.ipynb +0 -0
  26. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_check_my_table.py +0 -0
  27. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_hr_walkthrough.ipynb +0 -0
  28. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_hr_walkthrough.py +0 -0
  29. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_quickstart.ipynb +0 -0
  30. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_quickstart.py +0 -0
  31. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_validation.ipynb +0 -0
  32. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/bricksentry_validation.py +0 -0
  33. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/github-workflow.yml +0 -0
  34. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/databricks/policy.yml +0 -0
  35. {bricksentry-0.1.33 → bricksentry-0.1.34}/examples/demo/agent_loop_demo.py +0 -0
  36. {bricksentry-0.1.33 → bricksentry-0.1.34}/scripts/build_notebook.py +0 -0
  37. {bricksentry-0.1.33 → bricksentry-0.1.34}/scripts/render_demo_image.py +0 -0
  38. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/__main__.py +0 -0
  39. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/agent_tools.py +0 -0
  40. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/agent_view.py +0 -0
  41. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/assess.py +0 -0
  42. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/backends/__init__.py +0 -0
  43. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/backends/base.py +0 -0
  44. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/backends/databricks_backend.py +0 -0
  45. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/backends/duckdb_backend.py +0 -0
  46. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/changes.py +0 -0
  47. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/cleanup.py +0 -0
  48. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/cli.py +0 -0
  49. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/config.py +0 -0
  50. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/demo.py +0 -0
  51. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/diff.py +0 -0
  52. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/explain.py +0 -0
  53. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/github.py +0 -0
  54. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/governed.py +0 -0
  55. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/history.py +0 -0
  56. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/job_demo.py +0 -0
  57. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/lineage.py +0 -0
  58. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/mcp_server.py +0 -0
  59. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/measures.py +0 -0
  60. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/models.py +0 -0
  61. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/netguard.py +0 -0
  62. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/notify.py +0 -0
  63. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/policy.py +0 -0
  64. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/policy_templates.py +0 -0
  65. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/preview.py +0 -0
  66. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/py.typed +0 -0
  67. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/report.py +0 -0
  68. {bricksentry-0.1.33 → bricksentry-0.1.34}/src/bricksentry/validation.py +0 -0
  69. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/README.md +0 -0
  70. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/template/{{.project_name}}/.gitignore +0 -0
  71. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/template/{{.project_name}}/README.md.tmpl +0 -0
  72. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/template/{{.project_name}}/databricks.yml.tmpl +0 -0
  73. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/template/{{.project_name}}/resources/bricksentry_check.job.yml.tmpl +0 -0
  74. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/template/{{.project_name}}/src/bricksentry_check.py +0 -0
  75. {bricksentry-0.1.33 → bricksentry-0.1.34}/templates/job-check/template/{{.project_name}}/src/bricksentry_demo.py +0 -0
  76. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/conftest.py +0 -0
  77. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0110.py +0 -0
  78. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0112.py +0 -0
  79. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0114.py +0 -0
  80. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0120.py +0 -0
  81. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0121.py +0 -0
  82. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0122.py +0 -0
  83. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0123.py +0 -0
  84. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0126.py +0 -0
  85. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0127.py +0 -0
  86. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0128.py +0 -0
  87. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0129.py +0 -0
  88. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0130.py +0 -0
  89. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_0132.py +0 -0
  90. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_018.py +0 -0
  91. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_019.py +0 -0
  92. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_assess_policy.py +0 -0
  93. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_check_notebook.py +0 -0
  94. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_databricks_and_uc.py +0 -0
  95. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_demo.py +0 -0
  96. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_diff.py +0 -0
  97. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_hr_notebook.py +0 -0
  98. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_notebook.py +0 -0
  99. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_notify_templates.py +0 -0
  100. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_preview_agents.py +0 -0
  101. {bricksentry-0.1.33 → bricksentry-0.1.34}/tests/test_sample_guard_and_store.py +0 -0
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.34 (2026-11-25)
4
+
5
+ From GitHub code scanning (CodeQL):
6
+
7
+ - **A webhook URL passed where a secret reference belongs is never printed.** The job's `--slack-secret` and `--teams-secret` take a Databricks secret reference, `scope/key`. If the webhook URL itself was passed by mistake, the error that said the secret couldn't be read repeated the value, so the URL (which is itself the credential for posting to the channel) appeared in the job's log. A value that isn't two plain names separated by `/` is now refused with a message that doesn't include it.
8
+
9
+ The other code-scanning alerts were false positives: CodeQL treats table names such as `bricksentry_hr_employees` and `bricksentry_hr_compensation` as private data, so printing those names in the HR walkthrough notebook and writing them to the agent audit log was flagged. Neither prints any of the tables' values.
10
+
3
11
  ## 0.1.33 (2026-11-23)
4
12
 
5
13
  From a round of 15 previously untested areas on 0.1.32 on a Free Edition workspace. Thirteen were verified for the first time (NOT NULL and generated columns, empty tables, unicode names, INSERT OVERWRITE, duplicate and NULL keys in both directions, OPTIMIZE and RESTORE as the latest commit, bad job arguments, and the `wide-blast-radius` and `pii-table` rules firing on real Unity Catalog lineage and tags). It found one defect:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bricksentry
3
- Version: 0.1.33
3
+ Version: 0.1.34
4
4
  Summary: Change impact analysis and deployment guardrails for data changes on Databricks, for 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 @@
1
+ bricksentry[databricks,mcp]==0.1.34
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bricksentry"
7
- version = "0.1.33"
7
+ version = "0.1.34"
8
8
  description = "Change impact analysis and deployment guardrails for data changes on Databricks, for 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"
@@ -8,12 +8,12 @@
8
8
  "source": "github"
9
9
  },
10
10
  "websiteUrl": "https://bricksentry.org",
11
- "version": "0.1.33",
11
+ "version": "0.1.34",
12
12
  "packages": [
13
13
  {
14
14
  "registryType": "pypi",
15
15
  "identifier": "bricksentry-mcp",
16
- "version": "0.1.33",
16
+ "version": "0.1.34",
17
17
  "runtimeHint": "uvx",
18
18
  "transport": {
19
19
  "type": "stdio"
@@ -23,4 +23,4 @@ __all__ = [
23
23
  "TableDiff",
24
24
  "Verdict",
25
25
  ]
26
- __version__ = "0.1.33"
26
+ __version__ = "0.1.34"
@@ -16,6 +16,7 @@ from __future__ import annotations
16
16
  import argparse
17
17
  import json
18
18
  import os
19
+ import re
19
20
  import sys
20
21
  import warnings
21
22
  from datetime import datetime, timedelta, timezone
@@ -53,13 +54,26 @@ def parse_keys(values: list[str]) -> dict[str, list[str]]:
53
54
  return out
54
55
 
55
56
 
57
+ _SECRET_REF = re.compile(r"[A-Za-z0-9_.\-]{1,128}/[A-Za-z0-9_.\-]{1,128}")
58
+
59
+
60
+ def _check_secret_ref(ref: str, flag: str = "--*-secret") -> None:
61
+ """A secret *reference* is two names, scope/key. Anything else (most likely the webhook URL
62
+ itself, pasted by mistake) is refused without echoing it, so it never lands in a job log."""
63
+ if not _SECRET_REF.fullmatch(ref):
64
+ raise SystemExit(
65
+ f"{flag} must name a Databricks secret as scope/key (for example bricksentry/slack_webhook). "
66
+ "The value given isn't in that form, so it isn't printed here. If you pasted the webhook URL "
67
+ "itself, store it in a secret scope and pass scope/key instead."
68
+ )
69
+
70
+
56
71
  def read_secret(ref: str | None) -> str | None: # pragma: no cover - needs Databricks
57
72
  """``scope/key`` from a Databricks secret scope."""
58
73
  if not ref:
59
74
  return None
75
+ _check_secret_ref(ref)
60
76
  scope, _, key = ref.partition("/")
61
- if not (scope and key):
62
- raise SystemExit(f"--*-secret must be scope/key, got {ref!r}")
63
77
  try:
64
78
  from databricks.sdk.runtime import dbutils
65
79
 
@@ -103,6 +117,7 @@ def _secret_or_problem(ref: str | None, flag: str, problems: list[str] | None):
103
117
  if not ref:
104
118
  return None
105
119
  try:
120
+ _check_secret_ref(ref, flag) # before anything echoes ref
106
121
  return read_secret(ref)
107
122
  except SystemExit as e: # a malformed scope/key
108
123
  msg = str(e)
@@ -86,10 +86,10 @@
86
86
  },
87
87
  "bricksentry_version": {
88
88
  "type": "string",
89
- "default": "0.1.33",
89
+ "default": "0.1.34",
90
90
  "description": "bricksentry version to install in the job (pinned; change it and redeploy to upgrade)",
91
91
  "pattern": "^\\d+\\.\\d+\\.\\d+$",
92
- "pattern_match_failure_message": "Use a version like 0.1.33.",
92
+ "pattern_match_failure_message": "Use a version like 0.1.34.",
93
93
  "order": 10
94
94
  }
95
95
  },
@@ -117,7 +117,7 @@ def test_job_malformed_secret_ref(monkeypatch):
117
117
  lines: list[str] = []
118
118
  code = job.run(["--tables", "sales.orders", "--scratch-schema", "scratch", "--slack-secret", "noslash"],
119
119
  backend=FakeDelta(), out=lines.append)
120
- assert code == 2 and "must be scope/key" in "\n".join(lines)
120
+ assert code == 2 and "must name a Databricks secret as scope/key" in "\n".join(lines)
121
121
 
122
122
 
123
123
  # --- cleanup -------------------------------------------------------------------------------
@@ -0,0 +1,38 @@
1
+ """0.1.34: a webhook URL passed where a secret reference belongs is never printed."""
2
+
3
+ import pytest
4
+ from test_0114 import FakeDelta
5
+
6
+ from bricksentry import job
7
+
8
+ URL = "https://hooks.slack.com/services/T000/B000/SECRETTOKEN123"
9
+
10
+
11
+ @pytest.mark.parametrize("ref", [URL, "xoxb-SECRETTOKEN123", "scope/key/SECRETTOKEN123", "a b/SECRETTOKEN123"])
12
+ def test_malformed_secret_reference_is_not_echoed(ref):
13
+ problems: list[str] = []
14
+ assert job._secret_or_problem(ref, "--slack-secret", problems) is None
15
+ assert "SECRETTOKEN123" not in problems[0]
16
+ assert "must name a Databricks secret as scope/key" in problems[0]
17
+ with pytest.raises(SystemExit) as e:
18
+ job._secret_or_problem(ref, "--teams-secret", None)
19
+ assert "SECRETTOKEN123" not in str(e.value)
20
+
21
+
22
+ def test_valid_reference_still_named_in_errors(monkeypatch):
23
+ def boom(ref):
24
+ raise RuntimeError("Scope bricksentry does not exist!")
25
+
26
+ monkeypatch.setattr(job, "read_secret", boom)
27
+ problems: list[str] = []
28
+ job._secret_or_problem("bricksentry/slack_webhook", "--slack-secret", problems)
29
+ assert "--slack-secret bricksentry/slack_webhook: could not read the secret" in problems[0]
30
+
31
+
32
+ def test_job_with_pasted_url_never_prints_it():
33
+ lines: list[str] = []
34
+ code = job.run(["--tables", "sales.orders", "--scratch-schema", "scratch", "--slack-secret", URL],
35
+ backend=FakeDelta(), out=lines.append)
36
+ text = "\n".join(lines)
37
+ assert code == 2 and "SECRETTOKEN123" not in text and "hooks.slack.com" not in text
38
+ assert "isn't printed here" in text
@@ -1 +0,0 @@
1
- bricksentry[databricks,mcp]==0.1.33
File without changes
File without changes
File without changes
File without changes
File without changes