bmsdna-devtools 0.50.0__tar.gz → 0.51.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.50.0/README.md → bmsdna_devtools-0.51.0/PKG-INFO +38 -5
- bmsdna_devtools-0.50.0/PKG-INFO → bmsdna_devtools-0.51.0/README.md +20 -23
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/ci_plan.py +68 -17
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/pyproject.toml +1 -1
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_ci_plan.py +172 -7
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_labels.py +3 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/uv.lock +1 -1
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/.github/workflows/auto-release.yml +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/.github/workflows/python-publish.yml +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/.github/workflows/python-test.yml +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/.gitignore +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/.python-version +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/__init__.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/_api_dump.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/ado_auth.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/ado_issue.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/agent_mentions.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/api_usage.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/app_service_logs.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/azure_arm.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/azure_auth.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/bdt_config.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/business_user.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/ci_plan_env.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/cli.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/cli_tools.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/commit.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/dead_code.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/env_config.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/env_files.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/find_injection.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/find_repo.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/gh_args.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/gh_issue.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/gh_pr.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/github_api.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/gitrepo.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/injection_frontend.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/injection_python.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/issue_do.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/issue_show.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/issue_watch.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint_findings.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint_models.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint_sql.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint_sql_files.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint_tooling.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/lint_typescript.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/logs.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_build.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_choice.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_create_args.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_info.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_issue_link.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_labels.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_markdown.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_merge_defaults.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pr_ref.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/pull.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/testdb.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/translate.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/__init__.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/cli.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/pipeline.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/pricing.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/report.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/00_schema.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/01_ingest_claude.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/01_ingest_codex.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/02_messages.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/03_markers.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/04_facts.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/05_views.sql +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/worktree.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/justfile +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/skills/bmsdna-devtools/SKILL.md +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/conftest.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/fake_github.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_ado_auth.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_ado_issue.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_ado_issue_flow.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_agent_mentions.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_api_usage.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_app_service_logs.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_azure_arm.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_bdt_config.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_business_user.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_ci_plan_env.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_cleanup.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_commit.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_issue.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_pr_create.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_pr_id.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_pull.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_tools.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_cli_version.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_commit.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_env_config.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_env_files.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_find_injection.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_find_repo.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_gh_issue.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_gh_pr.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_github_api.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_gitrepo.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_issue_do.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_issue_for_me.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_issue_show.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_issue_watch.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_lint.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_lint_models.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_lint_sql.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_lint_sql_files.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_lint_tooling.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_lint_typescript.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_logs.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_build.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_build_create_options.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_build_flow.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_choice.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_create_args.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_description_not_truncated.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_info.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_issue_link.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_markdown.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_merge_defaults.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pull.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_testdb.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_translate.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_usage.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_wait_timeout.py +0 -0
- {bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_worktree_clean.py +0 -0
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: bmsdna-devtools
|
|
3
|
+
Version: 0.51.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
|
+
|
|
1
19
|
# bmsdna-devtools
|
|
2
20
|
|
|
3
21
|
Shared developer tooling for BMS projects: PR build/check status and a
|
|
@@ -862,17 +880,32 @@ on_missing = "infer" # PR without a usable label: infer from the chan
|
|
|
862
880
|
non_code = ["docs/**", "*.md"] # files no test reads or ships; explicit per repo (full-match globs: `*.md` = root only, `**/*.md` = every folder)
|
|
863
881
|
|
|
864
882
|
[tool.bdt.ci.plan.tiers.unit] # default tiers: unit = tests/unit, e2e = tests/e2e (a tier whose folder is missing is skipped)
|
|
865
|
-
dir = "tests/unit" # areas = sub-folders;
|
|
883
|
+
dir = "tests/unit" # areas = sub-folders with tests (test_*.py / *_test.py); `route_planning` <-> `test-route-planning`
|
|
866
884
|
|
|
867
885
|
[tool.bdt.ci.plan.tiers.e2e]
|
|
868
886
|
dir = "tests/e2e" # flat folder: map the test_*.py files to areas instead
|
|
869
887
|
areas = { chat = ["test_chat*.py"], review = ["test_review_*.py"] } # unmatched files form the area `shared`
|
|
888
|
+
|
|
889
|
+
[tool.bdt.ci.plan.paths] # non-test files an area owns: changing them infers that area instead of everything
|
|
890
|
+
infra = ["infra/**"] # built-in default when the repo has an infra/ folder; add e.g. frontend = ["frontend/**"]
|
|
870
891
|
```
|
|
871
892
|
|
|
872
893
|
Labels on the PR: `test-<area>` (one per touched area, selects it in every tier), `test-shared` (just the area
|
|
873
|
-
`shared`), `test-full` (everything), `test-none` (no tests; lint and
|
|
894
|
+
`shared`), `test-infra` (the area `infra`, see below), `test-full` (everything), `test-none` (no tests; lint and
|
|
895
|
+
build still run). Legacy `e2e-<area>` labels count
|
|
874
896
|
as `test-<area>`. With the table present, `bdt pr create` requires one of them (group `test_area`, generated from the
|
|
875
|
-
same folders; a hand-written `test_area` group in `[tool.bdt.pr.required_labels]` wins).
|
|
897
|
+
same folders; a hand-written `test_area` group in `[tool.bdt.pr.required_labels]` wins). Folders without tests (output
|
|
898
|
+
folders like `test-results`, helper packages) are not areas; a changed file in one of them, or directly in the tier
|
|
899
|
+
folder, selects everything because any test may use it.
|
|
900
|
+
|
|
901
|
+
`infra` is an ordinary area that owns `infra/**` (the Bicep folder) by default, whenever the repo has an `infra/`
|
|
902
|
+
folder. An area may have no tests: an infra-only PR (labelled `test-infra`, or inferred from the changed files)
|
|
903
|
+
plans `runTests=true` but none of the configured tiers runs (every `<tier>Run` is false), so lint, types and the infra
|
|
904
|
+
guards still run. A tier you did not split by area (e.g. flat unit tests, gated on `runTests` alone) still runs, which is
|
|
905
|
+
what you want when your infra tests live in it. A
|
|
906
|
+
repo that does test its infra files (Bicep settings checks and the like) puts those tests in a `tests/unit/infra/`
|
|
907
|
+
folder (or an `infra` glob area) and the same label selects exactly them. Do not list `infra/**` under `non_code`
|
|
908
|
+
in such a repo: that would skip those tests.
|
|
876
909
|
|
|
877
910
|
Order of decision, always logged with its reason:
|
|
878
911
|
|
|
@@ -885,8 +918,8 @@ Order of decision, always logged with its reason:
|
|
|
885
918
|
warning instead of guessing. Any other PR into `test` / `main` fails the build. Area folders must not be called
|
|
886
919
|
`full` or `none` (they would collide with the labels).
|
|
887
920
|
3. PR labels decide. No usable label (none, or only unknown `test-*` ones, which are warned about): the changed files
|
|
888
|
-
(merge commit against its first parent) decide. Nothing changed or only `non_code` files -> nothing runs, only
|
|
889
|
-
tests -> those areas, any other file -> everything. `on_missing = "fail"` fails the build instead.
|
|
921
|
+
(merge commit against its first parent) decide. Nothing changed or only `non_code` files -> nothing runs, only files
|
|
922
|
+
an area owns (its tests, or its `paths`) -> those areas, any other file -> everything. `on_missing = "fail"` fails the build instead.
|
|
890
923
|
4. Anything unreadable (label API, change list) runs everything: a missing decision never silently skips tests.
|
|
891
924
|
|
|
892
925
|
Outputs (Azure Pipelines variables with `isOutput=true`; plain `name=value` lines elsewhere): `runTests`, and per tier
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: bmsdna-devtools
|
|
3
|
-
Version: 0.50.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
|
|
@@ -880,17 +862,32 @@ on_missing = "infer" # PR without a usable label: infer from the chan
|
|
|
880
862
|
non_code = ["docs/**", "*.md"] # files no test reads or ships; explicit per repo (full-match globs: `*.md` = root only, `**/*.md` = every folder)
|
|
881
863
|
|
|
882
864
|
[tool.bdt.ci.plan.tiers.unit] # default tiers: unit = tests/unit, e2e = tests/e2e (a tier whose folder is missing is skipped)
|
|
883
|
-
dir = "tests/unit" # areas = sub-folders;
|
|
865
|
+
dir = "tests/unit" # areas = sub-folders with tests (test_*.py / *_test.py); `route_planning` <-> `test-route-planning`
|
|
884
866
|
|
|
885
867
|
[tool.bdt.ci.plan.tiers.e2e]
|
|
886
868
|
dir = "tests/e2e" # flat folder: map the test_*.py files to areas instead
|
|
887
869
|
areas = { chat = ["test_chat*.py"], review = ["test_review_*.py"] } # unmatched files form the area `shared`
|
|
870
|
+
|
|
871
|
+
[tool.bdt.ci.plan.paths] # non-test files an area owns: changing them infers that area instead of everything
|
|
872
|
+
infra = ["infra/**"] # built-in default when the repo has an infra/ folder; add e.g. frontend = ["frontend/**"]
|
|
888
873
|
```
|
|
889
874
|
|
|
890
875
|
Labels on the PR: `test-<area>` (one per touched area, selects it in every tier), `test-shared` (just the area
|
|
891
|
-
`shared`), `test-full` (everything), `test-none` (no tests; lint and
|
|
876
|
+
`shared`), `test-infra` (the area `infra`, see below), `test-full` (everything), `test-none` (no tests; lint and
|
|
877
|
+
build still run). Legacy `e2e-<area>` labels count
|
|
892
878
|
as `test-<area>`. With the table present, `bdt pr create` requires one of them (group `test_area`, generated from the
|
|
893
|
-
same folders; a hand-written `test_area` group in `[tool.bdt.pr.required_labels]` wins).
|
|
879
|
+
same folders; a hand-written `test_area` group in `[tool.bdt.pr.required_labels]` wins). Folders without tests (output
|
|
880
|
+
folders like `test-results`, helper packages) are not areas; a changed file in one of them, or directly in the tier
|
|
881
|
+
folder, selects everything because any test may use it.
|
|
882
|
+
|
|
883
|
+
`infra` is an ordinary area that owns `infra/**` (the Bicep folder) by default, whenever the repo has an `infra/`
|
|
884
|
+
folder. An area may have no tests: an infra-only PR (labelled `test-infra`, or inferred from the changed files)
|
|
885
|
+
plans `runTests=true` but none of the configured tiers runs (every `<tier>Run` is false), so lint, types and the infra
|
|
886
|
+
guards still run. A tier you did not split by area (e.g. flat unit tests, gated on `runTests` alone) still runs, which is
|
|
887
|
+
what you want when your infra tests live in it. A
|
|
888
|
+
repo that does test its infra files (Bicep settings checks and the like) puts those tests in a `tests/unit/infra/`
|
|
889
|
+
folder (or an `infra` glob area) and the same label selects exactly them. Do not list `infra/**` under `non_code`
|
|
890
|
+
in such a repo: that would skip those tests.
|
|
894
891
|
|
|
895
892
|
Order of decision, always logged with its reason:
|
|
896
893
|
|
|
@@ -903,8 +900,8 @@ Order of decision, always logged with its reason:
|
|
|
903
900
|
warning instead of guessing. Any other PR into `test` / `main` fails the build. Area folders must not be called
|
|
904
901
|
`full` or `none` (they would collide with the labels).
|
|
905
902
|
3. PR labels decide. No usable label (none, or only unknown `test-*` ones, which are warned about): the changed files
|
|
906
|
-
(merge commit against its first parent) decide. Nothing changed or only `non_code` files -> nothing runs, only
|
|
907
|
-
tests -> those areas, any other file -> everything. `on_missing = "fail"` fails the build instead.
|
|
903
|
+
(merge commit against its first parent) decide. Nothing changed or only `non_code` files -> nothing runs, only files
|
|
904
|
+
an area owns (its tests, or its `paths`) -> those areas, any other file -> everything. `on_missing = "fail"` fails the build instead.
|
|
908
905
|
4. Anything unreadable (label API, change list) runs everything: a missing decision never silently skips tests.
|
|
909
906
|
|
|
910
907
|
Outputs (Azure Pipelines variables with `isOutput=true`; plain `name=value` lines elsewhere): `runTests`, and per tier
|
|
@@ -7,12 +7,15 @@ Configured under `[tool.bdt.ci.plan]` in pyproject.toml (the table must exist, e
|
|
|
7
7
|
non_code = ["docs/**", "*.md"] # files no test reads or ships; explicit per repo (`*.md` = root only, `**/*.md` = all)
|
|
8
8
|
|
|
9
9
|
[tool.bdt.ci.plan.tiers.unit] # default tiers: unit = tests/unit, e2e = tests/e2e
|
|
10
|
-
dir = "tests/unit" # areas = sub-folders (snake_case folder <-> kebab-case label)
|
|
10
|
+
dir = "tests/unit" # areas = sub-folders with tests (snake_case folder <-> kebab-case label)
|
|
11
11
|
|
|
12
12
|
[tool.bdt.ci.plan.tiers.e2e]
|
|
13
13
|
dir = "tests/e2e" # flat folder: an area table maps test files to areas instead
|
|
14
14
|
areas = { chat = ["test_chat*.py"], review = ["test_review_*.py"] } # unmatched files = area "shared"
|
|
15
15
|
|
|
16
|
+
[tool.bdt.ci.plan.paths] # non-test files an area owns: changing them infers that area, not everything
|
|
17
|
+
infra = ["infra/**"] # built-in default when the repo has an infra/ folder (areas may have no tests)
|
|
18
|
+
|
|
16
19
|
Labels: `test-<area>`, `test-full` (everything), `test-none` (no tests; lint and build still run). The legacy
|
|
17
20
|
`e2e-<area>` labels count as `test-<area>`. Order of decision (the reason is always reported):
|
|
18
21
|
|
|
@@ -21,7 +24,8 @@ Labels: `test-<area>`, `test-full` (everything), `test-none` (no tests; lint and
|
|
|
21
24
|
2. Branch flow: promotions (dev -> test -> main -> dev) run nothing; `fix/*` and `hotfix/*` into `main` are tested
|
|
22
25
|
and must be cut from `main`; any other PR into `test`/`main` is an error.
|
|
23
26
|
3. PR labels decide. Without a usable label the changed files decide (`on_missing = "infer"`): nothing changed or
|
|
24
|
-
only `non_code` files -> none, only area tests -> those areas, any other file ->
|
|
27
|
+
only `non_code` files -> none, only files an area owns (its tests, or `paths`) -> those areas, any other file ->
|
|
28
|
+
everything. An area without tests (such as `infra`) selects nothing to run: `runTests` stays true, every tier is off.
|
|
25
29
|
4. Anything unreadable (label API, change list) selects everything.
|
|
26
30
|
"""
|
|
27
31
|
|
|
@@ -49,6 +53,7 @@ FIX_PREFIXES = ("fix/", "hotfix/")
|
|
|
49
53
|
PUSH_REASONS = frozenset(
|
|
50
54
|
{"IndividualCI", "BatchedCI"}
|
|
51
55
|
) # a merge landed on the branch: deploy only
|
|
56
|
+
INFRA_AREA = "infra" # owns `infra/**` by default when the repo has an infra/ folder; usually has no tests
|
|
52
57
|
RESERVED_AREAS = frozenset(
|
|
53
58
|
{"full", "none"}
|
|
54
59
|
) # test-full / test-none are the control labels
|
|
@@ -58,10 +63,24 @@ class BranchFlowError(Exception):
|
|
|
58
63
|
"""A fix branch for `main` that was not cut from `main`."""
|
|
59
64
|
|
|
60
65
|
|
|
66
|
+
def _is_test_file(name: str) -> bool:
|
|
67
|
+
return any(PurePosixPath(name).match(g) for g in (TEST_FILE_GLOB, "*_test.py"))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _has_tests(folder: Path) -> bool:
|
|
71
|
+
return any(
|
|
72
|
+
p.is_file()
|
|
73
|
+
and _is_test_file(p.name)
|
|
74
|
+
and "__pycache__" not in p.relative_to(folder).parts
|
|
75
|
+
for p in folder.rglob("*.py")
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
61
79
|
@dataclass(frozen=True)
|
|
62
80
|
class Tier:
|
|
63
|
-
"""One test tier (unit, e2e, ...). Areas are sub-folders of `dir
|
|
64
|
-
`test_*.py` files
|
|
81
|
+
"""One test tier (unit, e2e, ...). Areas are the sub-folders of `dir` that contain tests (`test_*.py` or
|
|
82
|
+
`*_test.py`; output and helper folders are not areas), or, with a `globs` table, groups of the `test_*.py` files
|
|
83
|
+
directly in `dir`."""
|
|
65
84
|
|
|
66
85
|
name: str
|
|
67
86
|
dir: str
|
|
@@ -96,11 +115,17 @@ class Tier:
|
|
|
96
115
|
return sorted(
|
|
97
116
|
d.name
|
|
98
117
|
for d in base.iterdir()
|
|
99
|
-
if d.is_dir() and not d.name.startswith(("_", "."))
|
|
118
|
+
if d.is_dir() and not d.name.startswith(("_", ".")) and _has_tests(d)
|
|
100
119
|
)
|
|
101
120
|
|
|
102
|
-
def area_of(
|
|
103
|
-
|
|
121
|
+
def area_of(
|
|
122
|
+
self, root: Path, path: str, areas: Collection[str]
|
|
123
|
+
) -> frozenset[str] | None:
|
|
124
|
+
"""Areas owning a repo-relative file, or None when the file is not an area file of this tier (a helper
|
|
125
|
+
folder, a file directly in the tier folder): changing it can affect any test, so the plan runs everything.
|
|
126
|
+
In folder mode a file of an area folder counts, helpers like conftest.py included. A test file whose
|
|
127
|
+
whole folder was removed still names its (now gone) area. `areas` is `self.areas(root)`, computed once per
|
|
128
|
+
plan by the caller."""
|
|
104
129
|
pure = PurePosixPath(path)
|
|
105
130
|
if not pure.is_relative_to(self.dir):
|
|
106
131
|
return None
|
|
@@ -111,11 +136,10 @@ class Tier:
|
|
|
111
136
|
if len(parts) == 1 and pure.match(TEST_FILE_GLOB)
|
|
112
137
|
else None
|
|
113
138
|
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
)
|
|
139
|
+
if len(parts) < 2 or parts[0].startswith(("_", ".")):
|
|
140
|
+
return None
|
|
141
|
+
removed = not (root / self.dir / parts[0]).exists() and _is_test_file(pure.name)
|
|
142
|
+
return frozenset({parts[0]}) if parts[0] in areas or removed else None
|
|
119
143
|
|
|
120
144
|
def paths(self, root: Path, selected: Collection[str] | None) -> list[str]:
|
|
121
145
|
"""What the test runner gets: the selected areas' folders or files, or (None) the whole tier."""
|
|
@@ -138,9 +162,20 @@ class PlanConfig:
|
|
|
138
162
|
tiers: tuple[Tier, ...]
|
|
139
163
|
on_missing: OnMissing = "infer"
|
|
140
164
|
non_code: tuple[str, ...] = ()
|
|
165
|
+
paths: Mapping[str, tuple[str, ...]] = field(default_factory=dict)
|
|
141
166
|
|
|
142
167
|
def all_areas(self) -> set[str]:
|
|
143
|
-
|
|
168
|
+
"""Areas with tests in a tier, plus areas that only own paths (such as `infra`, which may have no tests)."""
|
|
169
|
+
return {a for tier in self.tiers for a in tier.areas(self.root)} | set(
|
|
170
|
+
self.paths
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
def path_owners(self, path: str) -> frozenset[str]:
|
|
174
|
+
return frozenset(
|
|
175
|
+
area
|
|
176
|
+
for area, globs in self.paths.items()
|
|
177
|
+
if any(PurePosixPath(path).full_match(g) for g in globs)
|
|
178
|
+
)
|
|
144
179
|
|
|
145
180
|
def is_non_code(self, path: str) -> bool:
|
|
146
181
|
return any(PurePosixPath(path).full_match(g) for g in self.non_code)
|
|
@@ -184,11 +219,20 @@ def load_plan_config(start: Path | None = None) -> PlanConfig | None:
|
|
|
184
219
|
tiers_raw = raw.get("tiers", {name: {} for name in DEFAULT_TIER_DIRS})
|
|
185
220
|
if not isinstance(tiers_raw, dict):
|
|
186
221
|
raise ValueError("[tool.bdt.ci.plan.tiers] must be a table")
|
|
222
|
+
paths_raw = raw.get("paths", {})
|
|
223
|
+
if not isinstance(paths_raw, dict):
|
|
224
|
+
raise ValueError("[tool.bdt.ci.plan.paths] must be a table of glob lists")
|
|
225
|
+
paths = {
|
|
226
|
+
str(area): _strings(globs, f"paths.{area}") for area, globs in paths_raw.items()
|
|
227
|
+
}
|
|
228
|
+
if (pyproject.parent / "infra").is_dir():
|
|
229
|
+
paths.setdefault(INFRA_AREA, ("infra/**",))
|
|
187
230
|
config = PlanConfig(
|
|
188
231
|
root=pyproject.parent,
|
|
189
232
|
tiers=tuple(_tier(name, t) for name, t in tiers_raw.items()),
|
|
190
233
|
on_missing=on_missing,
|
|
191
234
|
non_code=_strings(raw.get("non_code", []), "non_code"),
|
|
235
|
+
paths=paths,
|
|
192
236
|
)
|
|
193
237
|
if clash := sorted(config.all_areas() & RESERVED_AREAS):
|
|
194
238
|
raise ValueError(
|
|
@@ -308,11 +352,18 @@ def _from_labels(
|
|
|
308
352
|
def _from_files(files: list[str], config: PlanConfig, warnings: list[str]) -> Plan:
|
|
309
353
|
if not files:
|
|
310
354
|
return Plan("none", "no changed files (a sync merge)", warnings=tuple(warnings))
|
|
355
|
+
known = {tier.name: frozenset(tier.areas(config.root)) for tier in config.tiers}
|
|
311
356
|
areas: set[str] = set()
|
|
312
357
|
for path in files:
|
|
313
358
|
if config.is_non_code(path):
|
|
314
359
|
continue
|
|
315
|
-
owners = [
|
|
360
|
+
owners = [
|
|
361
|
+
owned
|
|
362
|
+
for tier in config.tiers
|
|
363
|
+
if (owned := tier.area_of(config.root, path, known[tier.name]))
|
|
364
|
+
]
|
|
365
|
+
if owned_paths := config.path_owners(path):
|
|
366
|
+
owners.append(owned_paths)
|
|
316
367
|
if not owners:
|
|
317
368
|
return _full(
|
|
318
369
|
config,
|
|
@@ -326,9 +377,9 @@ def _from_files(files: list[str], config: PlanConfig, warnings: list[str]) -> Pl
|
|
|
326
377
|
f"all {len(files)} changed file(s) are non-code",
|
|
327
378
|
warnings=tuple(warnings),
|
|
328
379
|
)
|
|
329
|
-
areas &= (
|
|
330
|
-
|
|
331
|
-
) #
|
|
380
|
+
areas &= frozenset().union(
|
|
381
|
+
*known.values(), config.paths
|
|
382
|
+
) # a removed area has nothing left to run
|
|
332
383
|
if not areas:
|
|
333
384
|
return Plan(
|
|
334
385
|
"none",
|
|
@@ -10,7 +10,7 @@ packages = ["bmsdna"]
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "bmsdna-devtools"
|
|
13
|
-
version = "0.
|
|
13
|
+
version = "0.51.0"
|
|
14
14
|
description = "Shared Azure DevOps / GitHub / git / Azure Monitor developer tooling for BMS projects"
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.14" # pgdevkit>=0.7.1 requires 3.14; was >=3.11 before adding it as a dependency
|
|
@@ -51,6 +51,10 @@ def config(repo) -> PlanConfig:
|
|
|
51
51
|
return loaded
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
def area_of(tier: Tier, root, path: str):
|
|
55
|
+
return tier.area_of(root, path, tier.areas(root))
|
|
56
|
+
|
|
57
|
+
|
|
54
58
|
def no_fix_check() -> None:
|
|
55
59
|
return None
|
|
56
60
|
|
|
@@ -160,13 +164,54 @@ def test_missing_tier_dir_has_no_areas_or_paths(tmp_path) -> None:
|
|
|
160
164
|
|
|
161
165
|
def test_area_of(config) -> None:
|
|
162
166
|
unit, e2e = config.tiers
|
|
163
|
-
|
|
164
|
-
assert
|
|
165
|
-
assert
|
|
166
|
-
assert
|
|
167
|
-
assert
|
|
168
|
-
assert
|
|
169
|
-
assert
|
|
167
|
+
root = config.root
|
|
168
|
+
assert area_of(unit, root, "tests/unit/orders/test_a.py") == {"orders"}
|
|
169
|
+
assert area_of(unit, root, "tests/unit/conftest.py") is None
|
|
170
|
+
assert area_of(unit, root, "tests/unit/__pycache__/x.pyc") is None
|
|
171
|
+
assert area_of(unit, root, "src/app.py") is None
|
|
172
|
+
assert area_of(e2e, root, "tests/e2e/test_chat_one.py") == {"chat"}
|
|
173
|
+
assert area_of(e2e, root, "tests/e2e/test_misc.py") == {"shared"}
|
|
174
|
+
assert area_of(e2e, root, "tests/e2e/conftest.py") is None
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def test_folders_without_tests_are_not_areas(config) -> None:
|
|
178
|
+
touch(
|
|
179
|
+
config.root, "tests/unit/test-results/report.xml", "tests/unit/helpers/util.py"
|
|
180
|
+
)
|
|
181
|
+
unit = config.tiers[0]
|
|
182
|
+
assert unit.areas(config.root) == ["customers", "orders", "shared"]
|
|
183
|
+
assert area_of(unit, config.root, "tests/unit/helpers/util.py") is None
|
|
184
|
+
assert area_of(unit, config.root, "tests/unit/test-results/report.xml") is None
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def test_area_folder_helpers_select_their_area(config) -> None:
|
|
188
|
+
touch(
|
|
189
|
+
config.root,
|
|
190
|
+
"tests/unit/orders/conftest.py",
|
|
191
|
+
"tests/unit/orders/fixtures/data.json",
|
|
192
|
+
)
|
|
193
|
+
unit = config.tiers[0]
|
|
194
|
+
assert area_of(unit, config.root, "tests/unit/orders/conftest.py") == {"orders"}
|
|
195
|
+
assert area_of(unit, config.root, "tests/unit/orders/fixtures/data.json") == {
|
|
196
|
+
"orders"
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def test_nested_and_suffix_style_tests_make_an_area(tmp_path) -> None:
|
|
201
|
+
touch(tmp_path, "tests/unit/billing/deep/er/orders_test.py")
|
|
202
|
+
assert Tier("unit", "tests/unit").areas(tmp_path) == ["billing"]
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def test_removed_area_test_file_still_names_the_area(config) -> None:
|
|
206
|
+
unit = config.tiers[0]
|
|
207
|
+
assert area_of(unit, config.root, "tests/unit/legacy/test_x.py") == {"legacy"}
|
|
208
|
+
assert area_of(unit, config.root, "tests/unit/legacy/helper.py") is None
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def test_changed_helper_folder_file_runs_everything(config) -> None:
|
|
212
|
+
touch(config.root, "tests/unit/helpers/util.py")
|
|
213
|
+
result = plan_for(config, pr(), files=["tests/unit/helpers/util.py"])
|
|
214
|
+
assert result.kind == "full" and "tests/unit/helpers/util.py" in result.reason
|
|
170
215
|
|
|
171
216
|
|
|
172
217
|
# --- labels ----------------------------------------------------------------------------------------------------
|
|
@@ -431,3 +476,123 @@ def test_non_code_star_is_root_only_and_double_star_is_recursive(config) -> None
|
|
|
431
476
|
assert recursive.is_non_code("README.md") and recursive.is_non_code(
|
|
432
477
|
"src/pkg/README.md"
|
|
433
478
|
)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
def test_a_directory_named_like_a_test_file_is_not_a_test(tmp_path) -> None:
|
|
482
|
+
touch(
|
|
483
|
+
tmp_path,
|
|
484
|
+
"tests/unit/helpers/test_fixture.py/data.json",
|
|
485
|
+
"tests/unit/helpers/util.py",
|
|
486
|
+
)
|
|
487
|
+
tier = Tier("unit", "tests/unit")
|
|
488
|
+
assert tier.areas(tmp_path) == []
|
|
489
|
+
assert area_of(tier, tmp_path, "tests/unit/helpers/util.py") is None
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
def test_pycache_in_the_checkout_path_does_not_hide_areas(tmp_path) -> None:
|
|
493
|
+
root = tmp_path / "__pycache__" / "repo"
|
|
494
|
+
touch(
|
|
495
|
+
root, "tests/unit/orders/test_a.py", "tests/unit/orders/__pycache__/test_a.py"
|
|
496
|
+
)
|
|
497
|
+
assert Tier("unit", "tests/unit").areas(root) == ["orders"]
|
|
498
|
+
touch(root, "tests/unit/cached/__pycache__/test_b.py")
|
|
499
|
+
assert Tier("unit", "tests/unit").areas(root) == ["orders"]
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
# --- areas that own paths (infra) -----------------------------------------------------------------------------
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def infra_config(tmp_path, *, infra_dir: bool = True, extra: str = "") -> PlanConfig:
|
|
506
|
+
touch(tmp_path, "tests/unit/orders/test_a.py")
|
|
507
|
+
if infra_dir:
|
|
508
|
+
touch(tmp_path, "infra/main.bicep", "infra/modules/app.bicep")
|
|
509
|
+
(tmp_path / "pyproject.toml").write_text(f"[tool.bdt.ci.plan]\n{extra}")
|
|
510
|
+
config = load_plan_config(tmp_path)
|
|
511
|
+
assert config is not None
|
|
512
|
+
return config
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
def test_infra_area_is_built_in_when_an_infra_folder_exists(tmp_path) -> None:
|
|
516
|
+
config = infra_config(tmp_path)
|
|
517
|
+
assert config.paths == {"infra": ("infra/**",)}
|
|
518
|
+
assert "infra" in config.all_areas()
|
|
519
|
+
assert "test-infra" in ci_plan.required_label_choices(config)
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
def test_no_infra_area_without_an_infra_folder(tmp_path) -> None:
|
|
523
|
+
config = infra_config(tmp_path, infra_dir=False)
|
|
524
|
+
assert config.paths == {} and "infra" not in config.all_areas()
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
def test_paths_table_overrides_and_extends(tmp_path) -> None:
|
|
528
|
+
config = infra_config(
|
|
529
|
+
tmp_path,
|
|
530
|
+
extra='[tool.bdt.ci.plan.paths]\ninfra = ["deploy/**"]\nfrontend = ["web/**"]\n',
|
|
531
|
+
)
|
|
532
|
+
assert config.paths == {"infra": ("deploy/**",), "frontend": ("web/**",)}
|
|
533
|
+
assert plan_for(config, pr(), files=["web/app.ts"]).areas == {"frontend"}
|
|
534
|
+
assert plan_for(config, pr(), files=["deploy/main.bicep"]).areas == {"infra"}
|
|
535
|
+
assert plan_for(config, pr(), files=["web/app.ts", "deploy/main.bicep"]).areas == {
|
|
536
|
+
"frontend",
|
|
537
|
+
"infra",
|
|
538
|
+
}
|
|
539
|
+
# the default no longer applies once overridden: infra/ files are unowned again
|
|
540
|
+
assert plan_for(config, pr(), files=["infra/main.bicep"]).kind == "full"
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
def test_invalid_paths_config_is_rejected(tmp_path) -> None:
|
|
544
|
+
touch(tmp_path, "tests/unit/orders/test_a.py")
|
|
545
|
+
(tmp_path / "pyproject.toml").write_text("[tool.bdt.ci.plan]\npaths = 3\n")
|
|
546
|
+
with pytest.raises(ValueError, match="paths"):
|
|
547
|
+
load_plan_config(tmp_path)
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
def test_infra_only_pr_infers_the_infra_area_and_runs_no_tier(tmp_path) -> None:
|
|
551
|
+
config = infra_config(tmp_path)
|
|
552
|
+
result = plan_for(
|
|
553
|
+
config, pr(), files=["infra/main.bicep", "infra/modules/app.bicep"]
|
|
554
|
+
)
|
|
555
|
+
assert (result.kind, result.areas) == ("areas", {"infra"})
|
|
556
|
+
out = ci_plan.outputs(result, config)
|
|
557
|
+
assert (
|
|
558
|
+
out["runTests"] == "true"
|
|
559
|
+
and out["unitRun"] == "false"
|
|
560
|
+
and out["unitPaths"] == ""
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def test_infra_change_next_to_code_still_runs_everything(tmp_path) -> None:
|
|
565
|
+
config = infra_config(tmp_path)
|
|
566
|
+
assert (
|
|
567
|
+
plan_for(config, pr(), files=["infra/main.bicep", "src/app.py"]).kind == "full"
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
def test_infra_label_selects_the_infra_area(tmp_path) -> None:
|
|
572
|
+
config = infra_config(tmp_path)
|
|
573
|
+
result = plan_for(config, pr(), labels=["test-infra"])
|
|
574
|
+
assert (result.kind, result.areas) == ("areas", {"infra"})
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
def test_infra_label_runs_the_infra_tests_when_the_repo_has_some(tmp_path) -> None:
|
|
578
|
+
touch(tmp_path, "tests/unit/infra/test_bicep.py")
|
|
579
|
+
config = infra_config(tmp_path)
|
|
580
|
+
result = plan_for(config, pr(), labels=["test-infra"])
|
|
581
|
+
assert ci_plan.outputs(result, config)["unitPaths"] == "tests/unit/infra"
|
|
582
|
+
changed = plan_for(config, pr(), files=["infra/main.bicep"])
|
|
583
|
+
assert ci_plan.outputs(changed, config)["unitPaths"] == "tests/unit/infra"
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
def test_infra_label_without_an_infra_folder_is_unknown(tmp_path) -> None:
|
|
587
|
+
config = infra_config(tmp_path, infra_dir=False)
|
|
588
|
+
result = plan_for(config, pr(), labels=["test-infra"], files=[])
|
|
589
|
+
assert result.kind == "none" and any("test-infra" in w for w in result.warnings)
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def test_path_area_named_like_a_control_label_is_rejected(tmp_path) -> None:
|
|
593
|
+
touch(tmp_path, "tests/unit/orders/test_a.py")
|
|
594
|
+
(tmp_path / "pyproject.toml").write_text(
|
|
595
|
+
'[tool.bdt.ci.plan]\n[tool.bdt.ci.plan.paths]\nnone = ["x/**"]\n'
|
|
596
|
+
)
|
|
597
|
+
with pytest.raises(ValueError, match="collide"):
|
|
598
|
+
load_plan_config(tmp_path)
|
|
@@ -109,9 +109,12 @@ def test_label_for_scope_matches_case_insensitively() -> None:
|
|
|
109
109
|
|
|
110
110
|
def test_required_label_groups_generates_test_area_group_from_ci_plan(tmp_path) -> None:
|
|
111
111
|
(tmp_path / "tests/unit/orders").mkdir(parents=True)
|
|
112
|
+
(tmp_path / "tests/unit/orders/test_a.py").write_text("")
|
|
113
|
+
(tmp_path / "tests/unit/test-results").mkdir() # an output folder without tests is not an area
|
|
112
114
|
write_pyproject(tmp_path, "[tool.bdt.ci.plan]\n")
|
|
113
115
|
groups = required_label_groups(tmp_path)
|
|
114
116
|
assert {"test-orders", "test-full", "test-none"} <= set(groups["test_area"])
|
|
117
|
+
assert "test-test-results" not in groups["test_area"]
|
|
115
118
|
|
|
116
119
|
|
|
117
120
|
def test_required_label_groups_keeps_a_hand_written_test_area_group(tmp_path) -> None:
|
|
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
|
|
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
|
{bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/01_ingest_claude.sql
RENAMED
|
File without changes
|
{bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/bmsdna/devtools/usage/sql/01_ingest_codex.sql
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bmsdna_devtools-0.50.0 → bmsdna_devtools-0.51.0}/tests/test_pr_description_not_truncated.py
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
|