bmsdna-devtools 0.53.0__tar.gz → 0.55.0__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.
- bmsdna_devtools-0.53.0/README.md → bmsdna_devtools-0.55.0/PKG-INFO +80 -1
- bmsdna_devtools-0.53.0/PKG-INFO → bmsdna_devtools-0.55.0/README.md +61 -19
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/cli.py +8 -1
- bmsdna_devtools-0.55.0/bmsdna/devtools/deps/__init__.py +7 -0
- bmsdna_devtools-0.55.0/bmsdna/devtools/deps/advisories.py +500 -0
- bmsdna_devtools-0.55.0/bmsdna/devtools/deps/cli.py +151 -0
- bmsdna_devtools-0.55.0/bmsdna/devtools/deps/lockfiles.py +210 -0
- bmsdna_devtools-0.55.0/bmsdna/devtools/deps/osv.py +137 -0
- bmsdna_devtools-0.55.0/bmsdna/devtools/deps/versions.py +219 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/gh_pr.py +1 -1
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_build.py +35 -1
- bmsdna_devtools-0.55.0/bmsdna/devtools/pr_drift.py +153 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_info.py +43 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/pyproject.toml +2 -1
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/skills/bmsdna-devtools/SKILL.md +8 -1
- bmsdna_devtools-0.55.0/tests/test_cli_deps.py +124 -0
- bmsdna_devtools-0.55.0/tests/test_deps_advisories.py +238 -0
- bmsdna_devtools-0.55.0/tests/test_deps_lockfiles.py +143 -0
- bmsdna_devtools-0.55.0/tests/test_deps_osv.py +92 -0
- bmsdna_devtools-0.55.0/tests/test_deps_versions.py +89 -0
- bmsdna_devtools-0.55.0/tests/test_pr_drift.py +353 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_info.py +4 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/uv.lock +4 -2
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/.github/workflows/auto-release.yml +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/.github/workflows/python-publish.yml +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/.github/workflows/python-test.yml +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/.gitignore +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/.python-version +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/__init__.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/_api_dump.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/ado_auth.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/ado_issue.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/agent_mentions.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/api_usage.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/app_service_logs.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/azure_arm.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/azure_auth.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/bdt_config.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/business_user.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/ci_plan.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/ci_plan_env.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/cli_tools.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/commit.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/dead_code.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/env_config.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/env_files.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/find_injection.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/find_repo.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/gh_args.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/gh_issue.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/github_api.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/gitrepo.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/injection_frontend.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/injection_python.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/issue_do.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/issue_show.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/issue_watch.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint_findings.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint_models.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint_sql.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint_sql_files.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint_tooling.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/lint_typescript.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/logs.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_cancel.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_choice.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_create_args.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_issue_link.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_labels.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_markdown.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_merge_defaults.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pr_ref.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/pull.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/testdb.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/translate.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/__init__.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/cli.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/pipeline.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/pricing.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/report.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/00_schema.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/01_ingest_claude.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/01_ingest_codex.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/02_messages.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/03_markers.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/04_facts.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/usage/sql/05_views.sql +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/bmsdna/devtools/worktree.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/justfile +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/conftest.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/fake_github.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_ado_auth.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_ado_issue.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_ado_issue_flow.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_agent_mentions.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_api_usage.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_app_service_logs.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_azure_arm.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_bdt_config.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_business_user.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_ci_plan.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_ci_plan_env.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_cleanup.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_commit.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_issue.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_pr_create.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_pr_id.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_pull.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_tools.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_cli_version.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_commit.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_env_config.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_env_files.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_find_injection.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_find_repo.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_gh_issue.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_gh_pr.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_github_api.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_gitrepo.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_issue_do.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_issue_for_me.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_issue_show.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_issue_watch.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_lint.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_lint_models.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_lint_sql.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_lint_sql_files.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_lint_tooling.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_lint_typescript.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_logs.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_build.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_build_create_options.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_build_flow.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_cancel_build.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_choice.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_create_args.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_description_not_truncated.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_issue_link.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_labels.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_markdown.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pr_merge_defaults.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_pull.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_testdb.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_translate.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_usage.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_wait_timeout.py +0 -0
- {bmsdna_devtools-0.53.0 → bmsdna_devtools-0.55.0}/tests/test_worktree_clean.py +0 -0
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: bmsdna-devtools
|
|
3
|
+
Version: 0.55.0
|
|
4
|
+
Summary: Shared Azure DevOps / GitHub / git / Azure Monitor developer tooling for BMS projects
|
|
5
|
+
Requires-Python: >=3.14
|
|
6
|
+
Requires-Dist: azure-identity>=1.19.0
|
|
7
|
+
Requires-Dist: packaging>=24.0
|
|
8
|
+
Requires-Dist: pgdevkit[db]>=0.7.1
|
|
9
|
+
Requires-Dist: requests>=2.32.0
|
|
10
|
+
Requires-Dist: rich>=13.0.0
|
|
11
|
+
Requires-Dist: tomli-w>=1.0.0
|
|
12
|
+
Requires-Dist: typer>=0.26.7
|
|
13
|
+
Provides-Extra: lint
|
|
14
|
+
Requires-Dist: sqlglot>=27.0.0; extra == 'lint'
|
|
15
|
+
Provides-Extra: usage
|
|
16
|
+
Requires-Dist: duckdb>=1.3.0; extra == 'usage'
|
|
17
|
+
Requires-Dist: plotly>=5.24.0; extra == 'usage'
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
1
20
|
# bmsdna-devtools
|
|
2
21
|
|
|
3
22
|
Shared developer tooling for BMS projects: PR build/check status and a
|
|
@@ -63,6 +82,18 @@ for builds/checks that will never run — e.g. on Azure DevOps:
|
|
|
63
82
|
on GitHub: `PR #42 ('feat: widgets') has merge conflicts with 'main' (mergeable=CONFLICTING)`.
|
|
64
83
|
Exit code 1 either way.
|
|
65
84
|
|
|
85
|
+
On Azure DevOps that status is only as current as the PR's last push: it is never recomputed when the **target
|
|
86
|
+
branch** moves on, so a PR can say `succeeded` while the target has since changed the same lines (and its builds ran
|
|
87
|
+
on the old merge). `pr status` therefore also compares the target's tip with the commit the merge status was
|
|
88
|
+
computed against; if they differ it fetches both by commit id and merges them locally with `git merge-tree` (no
|
|
89
|
+
working-tree change, no branch or tag created; the answer is cached in `.git/bdt-merge-check.json` per commit). A
|
|
90
|
+
conflict is reported like the server's, exit 1: `PR #42 ('feat: widgets') has merge conflicts with 'dev' (mergeStatus=succeeded
|
|
91
|
+
is stale: 'dev' has moved on by 3 commits since it was computed). Conflicting: a.txt. Merge or rebase 'dev' into the branch and push.`
|
|
92
|
+
A target that moved without conflicts is a one-line `Note:`. This runs at the start and on every poll of `--wait` (one
|
|
93
|
+
cheap request each, the merge itself only when the target moved again), so a conflict that appears while CI runs
|
|
94
|
+
stops the wait. It needs a checkout of the repo (without one the note says the target moved but not whether it
|
|
95
|
+
conflicts) and is skipped quietly if Azure DevOps or git can't answer. GitHub recomputes `mergeable` itself.
|
|
96
|
+
|
|
66
97
|
With `--wait`, a build/check that's paused on a manual approval (an Azure
|
|
67
98
|
Pipelines stage's Checkpoint.Approval, or a GitHub Actions deployment
|
|
68
99
|
protection rule) ends the wait instead of polling forever — it prints which
|
|
@@ -118,7 +149,7 @@ from the latest build of each pipeline (any failed result fails it; unfinished b
|
|
|
118
149
|
`--all` lists every open PR from the current branch (e.g. one into `dev` and one into `main`, which plain
|
|
119
150
|
`bdt pr info` refuses to pick between): with `--json` an array of the same objects, `[]` (exit 0) when there is
|
|
120
151
|
none; `--target-branch` narrows it, `--pr-id` can't be combined with it. Only open PRs are listed, and a PR with
|
|
121
|
-
merge conflicts is listed like any other (plain `pr info` on Azure DevOps errors on
|
|
152
|
+
merge conflicts is listed like any other, with `merge: conflicts` (plain `pr info` on Azure DevOps errors on one the server already reports).
|
|
122
153
|
|
|
123
154
|
`--pr-id` takes several PRs, also of other repos: repeat it and/or comma-separate (`--pr-id 12,34 --pr-id owner/repo#5`).
|
|
124
155
|
Each entry is a bare number (a PR of the current repo), `owner/repo#N` (GitHub), `project/repo#N` or
|
|
@@ -133,6 +164,12 @@ every org, and a PR with merge conflicts is an error entry there.
|
|
|
133
164
|
|
|
134
165
|
Every JSON object has a `repo` (`owner/repo` on GitHub, `org/project/repo` on Azure DevOps).
|
|
135
166
|
|
|
167
|
+
It also says whether the PR still merges into its `target` branch: `merge` is `clean`, `conflicts` (with the
|
|
168
|
+
`conflicts` paths when known), `behind` (the target moved on, but it still merges; `target_behind` = by how many
|
|
169
|
+
commits), `unknown` (it moved on and couldn't be checked, see `bdt pr status`) or `none` (not an open PR). On
|
|
170
|
+
Azure DevOps this is the drift check of `bdt pr status`, which is why `merge` can say `conflicts` while the server
|
|
171
|
+
still reports `succeeded`; on GitHub it is `mergeable`.
|
|
172
|
+
|
|
136
173
|
Azure DevOps limits: the PR is found by the current branch (into `--target-branch` if given, else any target),
|
|
137
174
|
a PR with merge conflicts is reported as an error (exit 1) like `pr status` does, and the closed
|
|
138
175
|
work items are only those whose URL is in the PR description -- not ones linked via
|
|
@@ -1192,6 +1229,48 @@ catch-all, service-to-service endpoints and an external API folder.
|
|
|
1192
1229
|
then on only *new* unused routes fail -- and a baseline line whose route has since been deleted, excluded or
|
|
1193
1230
|
used is reported as `api-route-baseline-stale`, so the list can only shrink.
|
|
1194
1231
|
|
|
1232
|
+
## `bdt deps affected` / `bdt deps advisories`
|
|
1233
|
+
|
|
1234
|
+
Security incidents and supply chain attacks (bmsuisse/devtools#113): which locked dependencies are touched? Both
|
|
1235
|
+
commands only read: they never edit a file, a lock or an environment. They cover `uv.lock` (PyPI) and `bun.lock` (npm)
|
|
1236
|
+
below each `--path` (default: the current directory; `node_modules`, virtualenvs, `.git` and `.worktrees` are skipped).
|
|
1237
|
+
Git, path, alias and workspace sources can't be matched against an advisory: they are listed as `unsupported`, never skipped.
|
|
1238
|
+
|
|
1239
|
+
```bash
|
|
1240
|
+
bdt deps affected lodash --version-spec "<4.17.21" --path ~/projects/CCMT2 --path ~/projects/OneSales
|
|
1241
|
+
bdt deps advisories --path . # OSV lookup of every locked version, one status per affected package
|
|
1242
|
+
bdt deps advisories --json # machine-readable
|
|
1243
|
+
```
|
|
1244
|
+
|
|
1245
|
+
`affected PACKAGE` lists the locked versions of one package (PyPI names are normalised, npm names exact; `--ecosystem`
|
|
1246
|
+
narrows) and marks those matching `--version-spec` (comparators such as `<4.17.21` or `>=1.0,<2`, comma = and). Exit 0
|
|
1247
|
+
none matches, 1 a locked version matches, 2 setup error (no lockfile, unreadable lockfile, bad spec), 3 incomplete (a
|
|
1248
|
+
git/path/alias source of that name could not be matched).
|
|
1249
|
+
|
|
1250
|
+
`advisories` queries [OSV](https://osv.dev) (GHSA, PYSEC and the OpenSSF `MAL-` malicious-package advisories) and the
|
|
1251
|
+
CISA KEV feed, groups aliases (GHSA = PYSEC = CVE) and reports per locked package one status. The maintenance skill's
|
|
1252
|
+
cooldown exception flow (`references/audit.md`) acts on it:
|
|
1253
|
+
|
|
1254
|
+
| Status | Meaning |
|
|
1255
|
+
|---|---|
|
|
1256
|
+
| `malicious` | a `MAL-` advisory covers the locked version: an incident, not a bump |
|
|
1257
|
+
| `needs-triage` | affected range, fix, or (when the fix is inside the cooldown) severity is missing, conflicting or unparseable |
|
|
1258
|
+
| `no-fix` | an affected advisory has no fixed version |
|
|
1259
|
+
| `blocked` | the fixed version is outside the range the project declares for a direct dependency |
|
|
1260
|
+
| `exempt-eligible` | high/critical (CVSS v3 score >= 7 and/or GHSA label; sources that disagree go to triage) or in CISA KEV, and the fixed version is younger than the cooldown (or its age is unknown) |
|
|
1261
|
+
| `bump` | the fixed version is older than the cooldown: a normal bump takes it |
|
|
1262
|
+
| `informational` | affected, lower severity, fix still inside the cooldown |
|
|
1263
|
+
|
|
1264
|
+
The target version is the lowest one the advisory data shows to be outside every affected range of the urgent
|
|
1265
|
+
advisories (all of them when none is urgent), never "latest". Lower-severity advisories that need a newer version stay open until a normal bump, and the finding names them. `next:` lines give the per-invocation commands. Unsupported sources are listed but don't change the exit code. The fix's age
|
|
1266
|
+
comes from the registry (PyPI: youngest file; npm: `time[version]`); `--cooldown-days` (default 5) is the project's
|
|
1267
|
+
cooldown. Compatibility with the parents' ranges of a *transitive* dependency isn't known here: re-run after the bump.
|
|
1268
|
+
|
|
1269
|
+
It fails closed: OSV, KEV or an advisory record that can't be read is reported as `incomplete` with exit 3, never as
|
|
1270
|
+
"no advisory". Exit 0 no affected locked version, 1 affected, 2 setup error, 3 incomplete. `uv audit` / `bun audit`
|
|
1271
|
+
remain the per-repo CI checks; this command adds what they don't give uniformly (fixed version and severity for both
|
|
1272
|
+
ecosystems, KEV, `MAL-` advisories, the fix's age against the cooldown) and scans many repos in one run.
|
|
1273
|
+
|
|
1195
1274
|
## `bdt find-injection`
|
|
1196
1275
|
|
|
1197
1276
|
Scans backend and frontend code for injection risks, and warns when a web project has no
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: bmsdna-devtools
|
|
3
|
-
Version: 0.53.0
|
|
4
|
-
Summary: Shared Azure DevOps / GitHub / git / Azure Monitor developer tooling for BMS projects
|
|
5
|
-
Requires-Python: >=3.14
|
|
6
|
-
Requires-Dist: azure-identity>=1.19.0
|
|
7
|
-
Requires-Dist: pgdevkit[db]>=0.7.1
|
|
8
|
-
Requires-Dist: requests>=2.32.0
|
|
9
|
-
Requires-Dist: rich>=13.0.0
|
|
10
|
-
Requires-Dist: tomli-w>=1.0.0
|
|
11
|
-
Requires-Dist: typer>=0.26.7
|
|
12
|
-
Provides-Extra: lint
|
|
13
|
-
Requires-Dist: sqlglot>=27.0.0; extra == 'lint'
|
|
14
|
-
Provides-Extra: usage
|
|
15
|
-
Requires-Dist: duckdb>=1.3.0; extra == 'usage'
|
|
16
|
-
Requires-Dist: plotly>=5.24.0; extra == 'usage'
|
|
17
|
-
Description-Content-Type: text/markdown
|
|
18
|
-
|
|
19
1
|
# bmsdna-devtools
|
|
20
2
|
|
|
21
3
|
Shared developer tooling for BMS projects: PR build/check status and a
|
|
@@ -81,6 +63,18 @@ for builds/checks that will never run — e.g. on Azure DevOps:
|
|
|
81
63
|
on GitHub: `PR #42 ('feat: widgets') has merge conflicts with 'main' (mergeable=CONFLICTING)`.
|
|
82
64
|
Exit code 1 either way.
|
|
83
65
|
|
|
66
|
+
On Azure DevOps that status is only as current as the PR's last push: it is never recomputed when the **target
|
|
67
|
+
branch** moves on, so a PR can say `succeeded` while the target has since changed the same lines (and its builds ran
|
|
68
|
+
on the old merge). `pr status` therefore also compares the target's tip with the commit the merge status was
|
|
69
|
+
computed against; if they differ it fetches both by commit id and merges them locally with `git merge-tree` (no
|
|
70
|
+
working-tree change, no branch or tag created; the answer is cached in `.git/bdt-merge-check.json` per commit). A
|
|
71
|
+
conflict is reported like the server's, exit 1: `PR #42 ('feat: widgets') has merge conflicts with 'dev' (mergeStatus=succeeded
|
|
72
|
+
is stale: 'dev' has moved on by 3 commits since it was computed). Conflicting: a.txt. Merge or rebase 'dev' into the branch and push.`
|
|
73
|
+
A target that moved without conflicts is a one-line `Note:`. This runs at the start and on every poll of `--wait` (one
|
|
74
|
+
cheap request each, the merge itself only when the target moved again), so a conflict that appears while CI runs
|
|
75
|
+
stops the wait. It needs a checkout of the repo (without one the note says the target moved but not whether it
|
|
76
|
+
conflicts) and is skipped quietly if Azure DevOps or git can't answer. GitHub recomputes `mergeable` itself.
|
|
77
|
+
|
|
84
78
|
With `--wait`, a build/check that's paused on a manual approval (an Azure
|
|
85
79
|
Pipelines stage's Checkpoint.Approval, or a GitHub Actions deployment
|
|
86
80
|
protection rule) ends the wait instead of polling forever — it prints which
|
|
@@ -136,7 +130,7 @@ from the latest build of each pipeline (any failed result fails it; unfinished b
|
|
|
136
130
|
`--all` lists every open PR from the current branch (e.g. one into `dev` and one into `main`, which plain
|
|
137
131
|
`bdt pr info` refuses to pick between): with `--json` an array of the same objects, `[]` (exit 0) when there is
|
|
138
132
|
none; `--target-branch` narrows it, `--pr-id` can't be combined with it. Only open PRs are listed, and a PR with
|
|
139
|
-
merge conflicts is listed like any other (plain `pr info` on Azure DevOps errors on
|
|
133
|
+
merge conflicts is listed like any other, with `merge: conflicts` (plain `pr info` on Azure DevOps errors on one the server already reports).
|
|
140
134
|
|
|
141
135
|
`--pr-id` takes several PRs, also of other repos: repeat it and/or comma-separate (`--pr-id 12,34 --pr-id owner/repo#5`).
|
|
142
136
|
Each entry is a bare number (a PR of the current repo), `owner/repo#N` (GitHub), `project/repo#N` or
|
|
@@ -151,6 +145,12 @@ every org, and a PR with merge conflicts is an error entry there.
|
|
|
151
145
|
|
|
152
146
|
Every JSON object has a `repo` (`owner/repo` on GitHub, `org/project/repo` on Azure DevOps).
|
|
153
147
|
|
|
148
|
+
It also says whether the PR still merges into its `target` branch: `merge` is `clean`, `conflicts` (with the
|
|
149
|
+
`conflicts` paths when known), `behind` (the target moved on, but it still merges; `target_behind` = by how many
|
|
150
|
+
commits), `unknown` (it moved on and couldn't be checked, see `bdt pr status`) or `none` (not an open PR). On
|
|
151
|
+
Azure DevOps this is the drift check of `bdt pr status`, which is why `merge` can say `conflicts` while the server
|
|
152
|
+
still reports `succeeded`; on GitHub it is `mergeable`.
|
|
153
|
+
|
|
154
154
|
Azure DevOps limits: the PR is found by the current branch (into `--target-branch` if given, else any target),
|
|
155
155
|
a PR with merge conflicts is reported as an error (exit 1) like `pr status` does, and the closed
|
|
156
156
|
work items are only those whose URL is in the PR description -- not ones linked via
|
|
@@ -1210,6 +1210,48 @@ catch-all, service-to-service endpoints and an external API folder.
|
|
|
1210
1210
|
then on only *new* unused routes fail -- and a baseline line whose route has since been deleted, excluded or
|
|
1211
1211
|
used is reported as `api-route-baseline-stale`, so the list can only shrink.
|
|
1212
1212
|
|
|
1213
|
+
## `bdt deps affected` / `bdt deps advisories`
|
|
1214
|
+
|
|
1215
|
+
Security incidents and supply chain attacks (bmsuisse/devtools#113): which locked dependencies are touched? Both
|
|
1216
|
+
commands only read: they never edit a file, a lock or an environment. They cover `uv.lock` (PyPI) and `bun.lock` (npm)
|
|
1217
|
+
below each `--path` (default: the current directory; `node_modules`, virtualenvs, `.git` and `.worktrees` are skipped).
|
|
1218
|
+
Git, path, alias and workspace sources can't be matched against an advisory: they are listed as `unsupported`, never skipped.
|
|
1219
|
+
|
|
1220
|
+
```bash
|
|
1221
|
+
bdt deps affected lodash --version-spec "<4.17.21" --path ~/projects/CCMT2 --path ~/projects/OneSales
|
|
1222
|
+
bdt deps advisories --path . # OSV lookup of every locked version, one status per affected package
|
|
1223
|
+
bdt deps advisories --json # machine-readable
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1226
|
+
`affected PACKAGE` lists the locked versions of one package (PyPI names are normalised, npm names exact; `--ecosystem`
|
|
1227
|
+
narrows) and marks those matching `--version-spec` (comparators such as `<4.17.21` or `>=1.0,<2`, comma = and). Exit 0
|
|
1228
|
+
none matches, 1 a locked version matches, 2 setup error (no lockfile, unreadable lockfile, bad spec), 3 incomplete (a
|
|
1229
|
+
git/path/alias source of that name could not be matched).
|
|
1230
|
+
|
|
1231
|
+
`advisories` queries [OSV](https://osv.dev) (GHSA, PYSEC and the OpenSSF `MAL-` malicious-package advisories) and the
|
|
1232
|
+
CISA KEV feed, groups aliases (GHSA = PYSEC = CVE) and reports per locked package one status. The maintenance skill's
|
|
1233
|
+
cooldown exception flow (`references/audit.md`) acts on it:
|
|
1234
|
+
|
|
1235
|
+
| Status | Meaning |
|
|
1236
|
+
|---|---|
|
|
1237
|
+
| `malicious` | a `MAL-` advisory covers the locked version: an incident, not a bump |
|
|
1238
|
+
| `needs-triage` | affected range, fix, or (when the fix is inside the cooldown) severity is missing, conflicting or unparseable |
|
|
1239
|
+
| `no-fix` | an affected advisory has no fixed version |
|
|
1240
|
+
| `blocked` | the fixed version is outside the range the project declares for a direct dependency |
|
|
1241
|
+
| `exempt-eligible` | high/critical (CVSS v3 score >= 7 and/or GHSA label; sources that disagree go to triage) or in CISA KEV, and the fixed version is younger than the cooldown (or its age is unknown) |
|
|
1242
|
+
| `bump` | the fixed version is older than the cooldown: a normal bump takes it |
|
|
1243
|
+
| `informational` | affected, lower severity, fix still inside the cooldown |
|
|
1244
|
+
|
|
1245
|
+
The target version is the lowest one the advisory data shows to be outside every affected range of the urgent
|
|
1246
|
+
advisories (all of them when none is urgent), never "latest". Lower-severity advisories that need a newer version stay open until a normal bump, and the finding names them. `next:` lines give the per-invocation commands. Unsupported sources are listed but don't change the exit code. The fix's age
|
|
1247
|
+
comes from the registry (PyPI: youngest file; npm: `time[version]`); `--cooldown-days` (default 5) is the project's
|
|
1248
|
+
cooldown. Compatibility with the parents' ranges of a *transitive* dependency isn't known here: re-run after the bump.
|
|
1249
|
+
|
|
1250
|
+
It fails closed: OSV, KEV or an advisory record that can't be read is reported as `incomplete` with exit 3, never as
|
|
1251
|
+
"no advisory". Exit 0 no affected locked version, 1 affected, 2 setup error, 3 incomplete. `uv audit` / `bun audit`
|
|
1252
|
+
remain the per-repo CI checks; this command adds what they don't give uniformly (fixed version and severity for both
|
|
1253
|
+
ecosystems, KEV, `MAL-` advisories, the fix's age against the cooldown) and scans many repos in one run.
|
|
1254
|
+
|
|
1213
1255
|
## `bdt find-injection`
|
|
1214
1256
|
|
|
1215
1257
|
Scans backend and frontend code for injection risks, and warns when a web project has no
|
|
@@ -41,6 +41,7 @@ from .bdt_config import find_pyproject, load_bdt_table
|
|
|
41
41
|
from .cli_tools import CLI_TIMEOUT_SECS, EXIT_WAIT_TIMEOUT, detect_agent_session, require_gh
|
|
42
42
|
from .github_api import GitHubClient
|
|
43
43
|
from .pr_create_args import PrCreateArgsError, extract_labels, parse_pr_create_args, resolve_body, unsupported_notes
|
|
44
|
+
from .deps.cli import deps_app
|
|
44
45
|
from .usage.cli import usage_app
|
|
45
46
|
from .gitrepo import (
|
|
46
47
|
AdoRemote,
|
|
@@ -133,6 +134,7 @@ logs_app = typer.Typer(name="logs", help="Application Insights / Log Analytics q
|
|
|
133
134
|
app.add_typer(logs_app, name="logs")
|
|
134
135
|
|
|
135
136
|
app.add_typer(usage_app, name="usage")
|
|
137
|
+
app.add_typer(deps_app, name="deps")
|
|
136
138
|
|
|
137
139
|
ci_app = typer.Typer(name="ci", help="CI helpers (Azure Pipelines)")
|
|
138
140
|
app.add_typer(ci_app, name="ci")
|
|
@@ -593,9 +595,14 @@ def pr_status(
|
|
|
593
595
|
|
|
594
596
|
|
|
595
597
|
def _info_text(info: pr_info_mod.PrInfo, with_repo: bool = False) -> str:
|
|
596
|
-
|
|
598
|
+
merge = [f"merge: {info.merge}"] if info.merge not in (pr_info_mod.MERGE_CLEAN, pr_info_mod.MERGE_NONE) else []
|
|
599
|
+
flags = ", ".join([info.state, *(["draft"] if info.draft else []), f"build: {info.build}", *merge])
|
|
597
600
|
name = f"PR {info.repo}#{info.number}" if with_repo and info.repo else f"PR #{info.number}"
|
|
598
601
|
lines = [f"{name}: {info.title} ({flags})", info.url]
|
|
602
|
+
if info.merge == pr_info_mod.MERGE_CONFLICTS:
|
|
603
|
+
lines.append(f"Conflicts with '{info.target}'" + (f": {', '.join(info.conflicts)}" if info.conflicts else ""))
|
|
604
|
+
elif info.merge in (pr_info_mod.MERGE_BEHIND, pr_info_mod.MERGE_UNKNOWN) and info.target_behind:
|
|
605
|
+
lines.append(f"'{info.target}' moved on by {info.target_behind} commit{'s' * (info.target_behind != 1)} since the PR's last merge check")
|
|
599
606
|
if info.abandon_reason:
|
|
600
607
|
lines.append(pr_cancel.abandoned_notice(pr_cancel.Reason(info.abandon_reason, info.abandon_session)))
|
|
601
608
|
if info.build == pr_info_mod.BUILD_CANCELLED:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""`bdt deps`: which locked dependencies a security advisory or supply chain incident touches (bmsuisse/devtools#113).
|
|
2
|
+
|
|
3
|
+
- `lockfiles` -- read `uv.lock` (PyPI) and `bun.lock` (npm) into one shape
|
|
4
|
+
- `versions` -- version parsing, comparison and range matching per ecosystem
|
|
5
|
+
- `osv` -- OSV / CISA KEV / registry timestamp client (the only network code)
|
|
6
|
+
- `advisories` -- turns OSV records into a per-package status; pure logic, no I/O
|
|
7
|
+
"""
|