bmsdna-devtools 1.0.0__tar.gz → 1.1.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.
Files changed (153) hide show
  1. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/PKG-INFO +8 -3
  2. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/README.md +7 -2
  3. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/ci_plan.py +9 -5
  4. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/ci_plan_env.py +33 -5
  5. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/pyproject.toml +1 -1
  6. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_ci_plan_env.py +167 -0
  7. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/uv.lock +2 -2
  8. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/.github/workflows/auto-release.yml +0 -0
  9. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/.github/workflows/python-publish.yml +0 -0
  10. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/.github/workflows/python-test.yml +0 -0
  11. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/.gitignore +0 -0
  12. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/.python-version +0 -0
  13. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/__init__.py +0 -0
  14. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/_api_dump.py +0 -0
  15. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/ado_auth.py +0 -0
  16. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/ado_issue.py +0 -0
  17. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/agent_mentions.py +0 -0
  18. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/api_usage.py +0 -0
  19. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/app_service_logs.py +0 -0
  20. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/azure_arm.py +0 -0
  21. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/azure_auth.py +0 -0
  22. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/bdt_config.py +0 -0
  23. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/business_user.py +0 -0
  24. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/cli.py +0 -0
  25. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/cli_tools.py +0 -0
  26. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/commit.py +0 -0
  27. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/dead_code.py +0 -0
  28. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/__init__.py +0 -0
  29. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/advisories.py +0 -0
  30. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/cli.py +0 -0
  31. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/cooldown.py +0 -0
  32. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/lockfiles.py +0 -0
  33. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/osv.py +0 -0
  34. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/deps/versions.py +0 -0
  35. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/env_config.py +0 -0
  36. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/env_files.py +0 -0
  37. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/find_injection.py +0 -0
  38. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/find_repo.py +0 -0
  39. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/gh_args.py +0 -0
  40. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/gh_issue.py +0 -0
  41. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/gh_pr.py +0 -0
  42. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/github_api.py +0 -0
  43. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/gitrepo.py +0 -0
  44. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/injection_frontend.py +0 -0
  45. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/injection_python.py +0 -0
  46. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/issue_do.py +0 -0
  47. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/issue_show.py +0 -0
  48. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/issue_watch.py +0 -0
  49. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint.py +0 -0
  50. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint_findings.py +0 -0
  51. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint_models.py +0 -0
  52. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint_sql.py +0 -0
  53. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint_sql_files.py +0 -0
  54. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint_tooling.py +0 -0
  55. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/lint_typescript.py +0 -0
  56. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/logs.py +0 -0
  57. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_build.py +0 -0
  58. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_cancel.py +0 -0
  59. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_choice.py +0 -0
  60. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_create_args.py +0 -0
  61. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_drift.py +0 -0
  62. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_info.py +0 -0
  63. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_issue_link.py +0 -0
  64. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_labels.py +0 -0
  65. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_list.py +0 -0
  66. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_markdown.py +0 -0
  67. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_merge_defaults.py +0 -0
  68. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pr_ref.py +0 -0
  69. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/pull.py +0 -0
  70. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/testdb.py +0 -0
  71. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/translate.py +0 -0
  72. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/__init__.py +0 -0
  73. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/cli.py +0 -0
  74. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/pipeline.py +0 -0
  75. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/pricing.py +0 -0
  76. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/report.py +0 -0
  77. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/00_schema.sql +0 -0
  78. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/01_ingest_claude.sql +0 -0
  79. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/01_ingest_codex.sql +0 -0
  80. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/02_messages.sql +0 -0
  81. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/03_markers.sql +0 -0
  82. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/04_facts.sql +0 -0
  83. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/usage/sql/05_views.sql +0 -0
  84. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/bmsdna/devtools/worktree.py +0 -0
  85. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/justfile +0 -0
  86. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/prek.toml +0 -0
  87. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/skills/bmsdna-devtools/SKILL.md +0 -0
  88. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/conftest.py +0 -0
  89. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/fake_github.py +0 -0
  90. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_ado_auth.py +0 -0
  91. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_ado_issue.py +0 -0
  92. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_ado_issue_flow.py +0 -0
  93. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_agent_mentions.py +0 -0
  94. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_api_usage.py +0 -0
  95. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_app_service_logs.py +0 -0
  96. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_azure_arm.py +0 -0
  97. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_bdt_config.py +0 -0
  98. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_business_user.py +0 -0
  99. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_ci_plan.py +0 -0
  100. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_cleanup.py +0 -0
  101. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_commit.py +0 -0
  102. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_deps.py +0 -0
  103. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_issue.py +0 -0
  104. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_pr_create.py +0 -0
  105. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_pr_id.py +0 -0
  106. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_pull.py +0 -0
  107. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_tools.py +0 -0
  108. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_cli_version.py +0 -0
  109. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_commit.py +0 -0
  110. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_deps_advisories.py +0 -0
  111. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_deps_cooldown.py +0 -0
  112. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_deps_lockfiles.py +0 -0
  113. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_deps_osv.py +0 -0
  114. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_deps_versions.py +0 -0
  115. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_env_config.py +0 -0
  116. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_env_files.py +0 -0
  117. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_find_injection.py +0 -0
  118. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_find_repo.py +0 -0
  119. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_gh_issue.py +0 -0
  120. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_gh_pr.py +0 -0
  121. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_github_api.py +0 -0
  122. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_gitrepo.py +0 -0
  123. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_issue_do.py +0 -0
  124. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_issue_for_me.py +0 -0
  125. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_issue_show.py +0 -0
  126. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_issue_watch.py +0 -0
  127. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_lint.py +0 -0
  128. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_lint_models.py +0 -0
  129. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_lint_sql.py +0 -0
  130. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_lint_sql_files.py +0 -0
  131. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_lint_tooling.py +0 -0
  132. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_lint_typescript.py +0 -0
  133. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_logs.py +0 -0
  134. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_build.py +0 -0
  135. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_build_create_options.py +0 -0
  136. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_build_flow.py +0 -0
  137. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_cancel_build.py +0 -0
  138. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_choice.py +0 -0
  139. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_create_args.py +0 -0
  140. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_description_not_truncated.py +0 -0
  141. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_drift.py +0 -0
  142. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_info.py +0 -0
  143. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_issue_link.py +0 -0
  144. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_labels.py +0 -0
  145. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_list.py +0 -0
  146. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_markdown.py +0 -0
  147. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pr_merge_defaults.py +0 -0
  148. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_pull.py +0 -0
  149. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_testdb.py +0 -0
  150. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_translate.py +0 -0
  151. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_usage.py +0 -0
  152. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_wait_timeout.py +0 -0
  153. {bmsdna_devtools-1.0.0 → bmsdna_devtools-1.1.0}/tests/test_worktree_clean.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bmsdna-devtools
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Summary: Shared Azure DevOps / GitHub / git / Azure Monitor developer tooling for BMS projects
5
5
  Requires-Python: >=3.14
6
6
  Requires-Dist: azure-identity>=1.19.0
@@ -1003,8 +1003,8 @@ Order of decision, always logged with its reason:
1003
1003
  4. Anything unreadable (label API, change list) runs everything: a missing decision never silently skips tests.
1004
1004
 
1005
1005
  Outputs (Azure Pipelines variables with `isOutput=true`; plain `name=value` lines elsewhere): `runTests`, and per tier
1006
- (`unit`, `e2e`, ...) `<tier>Run`, `<tier>Areas` and `<tier>Paths`, a shell-quoted argument list for the runner (repo-
1007
- relative). A tier you do not configure and split by area (e.g. flat unit tests) is simply gated on `runTests`. For
1006
+ (`unit`, `e2e`, ...) `<tier>Run`, `<tier>Areas` and `<tier>Paths`, a shell-quoted argument list for the runner (relative to the
1007
+ `pyproject.toml` folder). A tier you do not configure and split by area (e.g. flat unit tests) is simply gated on `runTests`. For
1008
1008
  custom sharding or a runner that does not take paths, use `<tier>Areas` (a space-separated list: keep area names free
1009
1009
  of whitespace if you split it): in folder mode the `<tier>Paths` of a full run
1010
1010
  is the bare tier folder, which may also hold things that are not tests (`.venv`, `test-results`); in glob mode it is the
@@ -1034,6 +1034,11 @@ list of test files either way. A moved file counts as changed under both its old
1034
1034
  Dry run locally: `uv run bdt ci plan --pr-source feat/x --pr-target dev --label test-orders` (or without `--label` to
1035
1035
  see what the changed files select).
1036
1036
 
1037
+ A project in a sub-folder of a monorepo: run the plan and the test runner in that folder (where its `pyproject.toml`
1038
+ is). Changed files are matched relative to it, so a file outside is a `../` path: own it with `paths`
1039
+ (`infra = ["../infra/**"]`) or ignore it with `non_code` (`["../other-app/**"]`). Any other outside file (a shared
1040
+ folder) selects everything.
1041
+
1037
1042
  ## `bdt lint`
1038
1043
 
1039
1044
  Static checks (implementing [bmsuisse/skills#52](https://github.com/bmsuisse/skills/issues/52))
@@ -984,8 +984,8 @@ Order of decision, always logged with its reason:
984
984
  4. Anything unreadable (label API, change list) runs everything: a missing decision never silently skips tests.
985
985
 
986
986
  Outputs (Azure Pipelines variables with `isOutput=true`; plain `name=value` lines elsewhere): `runTests`, and per tier
987
- (`unit`, `e2e`, ...) `<tier>Run`, `<tier>Areas` and `<tier>Paths`, a shell-quoted argument list for the runner (repo-
988
- relative). A tier you do not configure and split by area (e.g. flat unit tests) is simply gated on `runTests`. For
987
+ (`unit`, `e2e`, ...) `<tier>Run`, `<tier>Areas` and `<tier>Paths`, a shell-quoted argument list for the runner (relative to the
988
+ `pyproject.toml` folder). A tier you do not configure and split by area (e.g. flat unit tests) is simply gated on `runTests`. For
989
989
  custom sharding or a runner that does not take paths, use `<tier>Areas` (a space-separated list: keep area names free
990
990
  of whitespace if you split it): in folder mode the `<tier>Paths` of a full run
991
991
  is the bare tier folder, which may also hold things that are not tests (`.venv`, `test-results`); in glob mode it is the
@@ -1015,6 +1015,11 @@ list of test files either way. A moved file counts as changed under both its old
1015
1015
  Dry run locally: `uv run bdt ci plan --pr-source feat/x --pr-target dev --label test-orders` (or without `--label` to
1016
1016
  see what the changed files select).
1017
1017
 
1018
+ A project in a sub-folder of a monorepo: run the plan and the test runner in that folder (where its `pyproject.toml`
1019
+ is). Changed files are matched relative to it, so a file outside is a `../` path: own it with `paths`
1020
+ (`infra = ["../infra/**"]`) or ignore it with `non_code` (`["../other-app/**"]`). Any other outside file (a shared
1021
+ folder) selects everything.
1022
+
1018
1023
  ## `bdt lint`
1019
1024
 
1020
1025
  Static checks (implementing [bmsuisse/skills#52](https://github.com/bmsuisse/skills/issues/52))
@@ -16,6 +16,10 @@ Configured under `[tool.bdt.ci.plan]` in pyproject.toml (the table must exist, e
16
16
  [tool.bdt.ci.plan.paths] # non-test files an area owns: changing them infers that area, not everything
17
17
  infra = ["infra/**"] # built-in default when the repo has an infra/ folder (areas may have no tests)
18
18
 
19
+ Monorepo: run the command in the project's folder (the one with the pyproject.toml). Changed files are matched relative
20
+ to that folder, so a file outside it is a `../` path: own it with `paths` (`infra = ["../infra/**"]`) or ignore it with
21
+ `non_code` (`["../other-app/**"]`); any other file outside it (a shared folder) still selects everything.
22
+
19
23
  Labels: `test-<area>`, `test-full` (everything), `test-none` (no tests; lint and build still run). The legacy
20
24
  `e2e-<area>` labels count as `test-<area>`. Order of decision (the reason is always reported):
21
25
 
@@ -100,11 +104,11 @@ class Tier:
100
104
  )
101
105
 
102
106
  def area_of(self, root: Path, path: str, areas: Collection[str]) -> frozenset[str] | None:
103
- """Areas owning a repo-relative file, or None when the file is not an area file of this tier (a helper
104
- folder, a file directly in the tier folder): changing it can affect any test, so the plan runs everything.
105
- In folder mode a file of an area folder counts, helpers like conftest.py included. A test file whose
106
- whole folder was removed still names its (now gone) area. `areas` is `self.areas(root)`, computed once per
107
- plan by the caller."""
107
+ """Areas owning a file (a path relative to the pyproject.toml folder), or None when the file is not an area
108
+ file of this tier (a helper folder, a file directly in the tier folder): changing it can affect any test, so the
109
+ plan runs everything. In folder mode a file of an area folder counts, helpers like conftest.py included. A test
110
+ file whose whole folder was removed still names its (now gone) area. `areas` is `self.areas(root)`, computed once
111
+ per plan by the caller."""
108
112
  pure = PurePosixPath(path)
109
113
  if not pure.is_relative_to(self.dir):
110
114
  return None
@@ -111,15 +111,43 @@ def _git(
111
111
  return done
112
112
 
113
113
 
114
- def changed_files(target: str, *, merge_checkout: bool) -> list[str]:
114
+ def relative_to_root(files: list[str], root: Path) -> list[str]:
115
+ """Git lists paths relative to the repository root, the plan config (`dir`, `paths`, `non_code`) and the paths it
116
+ outputs are relative to the folder of the pyproject.toml. They are the same thing unless the project lives in a
117
+ sub-folder of a monorepo: then a file of the project is listed relative to it (`backend/app.py`) and one outside it
118
+ keeps its place as a `../` path (`../infra/main.bicep`), which the config can match like any other path.
119
+ The project's own prefix comes from git (`--show-prefix`) and is cut from git's own spelling of each path: no
120
+ file-system lookups, so symlinks, case-insensitive file systems and unusual folder names cannot skew it."""
121
+ prefix = _git("-C", str(root), "rev-parse", "--show-prefix").stdout.removesuffix("\n")
122
+ base = prefix.rstrip("/").split("/") if prefix else []
123
+ if not base:
124
+ return files
125
+ result = []
126
+ for name in files:
127
+ parts = name.split("/")
128
+ common = 0
129
+ while common < len(base) and common < len(parts) - 1 and parts[common] == base[common]:
130
+ common += 1
131
+ result.append("../" * (len(base) - common) + "/".join(parts[common:]))
132
+ return result
133
+
134
+
135
+ def changed_files(target: str, *, merge_checkout: bool, root: Path | None = None) -> list[str]:
115
136
  """Files the PR changes: in CI HEAD is the synthetic PR merge commit, compared with its first parent (the target);
116
137
  for a local dry run the branch is compared with `origin/<target>` (it may contain ordinary merges).
138
+ With `root` (the project folder, when it is not the repository root) the paths are relative to it, see
139
+ `relative_to_root`.
117
140
  `--no-renames` lists a moved file under its old path too: rename detection would hide the old path, so code moved
118
141
  into a `non_code` folder (or a test moved between areas) would look like nothing happened to the old place.
119
- `-z` keeps non-ASCII and other unusual names unquoted (git's default quoting would defeat every glob)."""
142
+ `-c diff.relative=false` keeps the paths relative to the repository root whatever the user configured (the plan
143
+ normalises them itself, see `relative_to_root`; unlike `--no-relative` it works on any git version). `-z` keeps non-ASCII and other unusual names unquoted (git's default
144
+ quoting would defeat every glob)."""
120
145
  diff = ("HEAD^1", "HEAD") if merge_checkout else (f"origin/{target}...HEAD",)
121
- out = _git("diff", "--name-only", "--no-renames", "-z", *diff).stdout
122
- return [path for path in out.split("\0") if path] # -z: git would quote names like test_\303\274ber.py
146
+ # `-C root`: the same repository the prefix is taken from, whatever the process cwd is.
147
+ where = ["-C", str(root)] if root is not None else []
148
+ out = _git(*where, "-c", "diff.relative=false", "diff", "--name-only", "--no-renames", "-z", *diff).stdout
149
+ files = [path for path in out.split("\0") if path] # -z: git would quote names like test_\303\274ber.py
150
+ return files if root is None else relative_to_root(files, root)
123
151
 
124
152
 
125
153
  def verify_fix_base(env: Mapping[str, str]) -> None:
@@ -214,7 +242,7 @@ def run(
214
242
  ctx,
215
243
  config,
216
244
  labels=label_provider,
217
- changed_files=lambda: changed_files(ctx.target, merge_checkout=not dry_run),
245
+ changed_files=lambda: changed_files(ctx.target, merge_checkout=not dry_run, root=config.root),
218
246
  verify_fix_base=lambda: verify_fix_base(env),
219
247
  )
220
248
  for warning in plan.warnings:
@@ -10,7 +10,7 @@ packages = ["bmsdna"]
10
10
 
11
11
  [project]
12
12
  name = "bmsdna-devtools"
13
- version = "1.0.0"
13
+ version = "1.1.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
@@ -369,3 +369,170 @@ def test_changed_files_keeps_non_ascii_names_unquoted(clone, monkeypatch) -> Non
369
369
  git(clone, "add", "-A")
370
370
  git(clone, "commit", "-q", "-m", "umlaut")
371
371
  assert ci_plan_env.changed_files("main", merge_checkout=False) == ["tests/test_über.py"]
372
+
373
+
374
+ # --- a project in a sub-folder of a monorepo ----------------------------------------------------------------------
375
+
376
+
377
+ def test_changed_files_are_relative_to_the_project_folder(clone, monkeypatch) -> None:
378
+ """The project lives in app/: its files are listed relative to it, all others keep their place as `../` paths."""
379
+ git(clone, "checkout", "-q", "-b", "feat")
380
+ for name in ("app/code.py", "infra/main.bicep", "other/x.txt"):
381
+ (clone / name).parent.mkdir(exist_ok=True)
382
+ (clone / name).write_text(name)
383
+ git(clone, "add", "-A")
384
+ git(clone, "commit", "-q", "-m", "mono")
385
+ monkeypatch.chdir(clone / "app")
386
+
387
+ inside = ci_plan_env.changed_files("main", merge_checkout=False, root=clone / "app")
388
+ assert sorted(inside) == ["../infra/main.bicep", "../other/x.txt", "code.py"]
389
+ at_top = ci_plan_env.changed_files("main", merge_checkout=False, root=clone)
390
+ assert sorted(at_top) == ["app/code.py", "infra/main.bicep", "other/x.txt"] # root == repository root: unchanged
391
+ assert sorted(ci_plan_env.changed_files("main", merge_checkout=False)) == sorted(at_top) # no root: unchanged
392
+
393
+
394
+ @pytest.fixture
395
+ def monorepo(clone, monkeypatch):
396
+ """dev holds a project in app/ (config: shared infra/ owned by `infra`, other-app/ ignored) next to infra/,
397
+ other-app/ and a shared database/; HEAD is a feature branch cut from it, the cwd is the project folder."""
398
+ git(clone, "checkout", "-q", "dev")
399
+ files = {
400
+ "app/pyproject.toml": (
401
+ '[tool.bdt.ci.plan]\nnon_code = ["../other-app/**"]\n\n[tool.bdt.ci.plan.paths]\ninfra = ["../infra/**"]\n'
402
+ ),
403
+ "app/tests/unit/orders/test_a.py": "",
404
+ "infra/main.bicep": "a",
405
+ "other-app/x.py": "a",
406
+ "database/a.sql": "a",
407
+ }
408
+ for name, content in files.items():
409
+ (clone / name).parent.mkdir(parents=True, exist_ok=True)
410
+ (clone / name).write_text(content)
411
+ git(clone, "add", "-A")
412
+ git(clone, "commit", "-q", "-m", "monorepo")
413
+ git(clone, "push", "-q", "origin", "dev")
414
+ git(clone, "checkout", "-q", "-b", "feat")
415
+ for key in (*PR_ENV, "BUILD_REASON"):
416
+ monkeypatch.delenv(key, raising=False)
417
+ monkeypatch.chdir(clone / "app")
418
+ return clone
419
+
420
+
421
+ def _dry_run_changing(monorepo, name: str) -> str:
422
+ (monorepo / name).write_text("changed")
423
+ git(monorepo, "add", "-A")
424
+ git(monorepo, "commit", "-q", "-m", "change")
425
+ result = CliRunner().invoke(app, ["ci", "plan", "--pr-source", "feat", "--pr-target", "dev"])
426
+ assert result.exit_code == 0, result.output
427
+ return result.output
428
+
429
+
430
+ def test_monorepo_shared_infra_selects_the_infra_area_only(monorepo) -> None:
431
+ output = _dry_run_changing(monorepo, "infra/main.bicep")
432
+ assert "test plan: areas (changed area tests: infra)" in output
433
+ assert "runTests=true" in output and "unitRun=false" in output
434
+
435
+
436
+ def test_monorepo_other_app_changes_run_no_tests(monorepo) -> None:
437
+ output = _dry_run_changing(monorepo, "other-app/x.py")
438
+ assert "test plan: none" in output and "runTests=false" in output
439
+
440
+
441
+ def test_monorepo_shared_folder_changes_run_everything(monorepo) -> None:
442
+ output = _dry_run_changing(monorepo, "database/a.sql")
443
+ assert "test plan: full (../database/a.sql is not owned by an area" in output
444
+ assert "unitPaths=tests/unit" in output
445
+
446
+
447
+ def test_monorepo_own_test_file_selects_its_area(monorepo) -> None:
448
+ output = _dry_run_changing(monorepo, "app/tests/unit/orders/test_a.py")
449
+ assert "test plan: areas (changed area tests: orders)" in output
450
+ assert "unitPaths=tests/unit/orders" in output
451
+
452
+
453
+ def test_changed_files_ignore_a_configured_diff_relative(clone, monkeypatch) -> None:
454
+ """`git config diff.relative true` would make git itself drop what is outside the folder and re-root the rest."""
455
+ git(clone, "config", "diff.relative", "true")
456
+ git(clone, "checkout", "-q", "-b", "feat")
457
+ for name in ("app/code.py", "infra/main.bicep"):
458
+ (clone / name).parent.mkdir(exist_ok=True)
459
+ (clone / name).write_text(name)
460
+ git(clone, "add", "-A")
461
+ git(clone, "commit", "-q", "-m", "mono")
462
+ monkeypatch.chdir(clone / "app")
463
+ assert sorted(ci_plan_env.changed_files("main", merge_checkout=False, root=clone / "app")) == [
464
+ "../infra/main.bicep",
465
+ "code.py",
466
+ ]
467
+
468
+
469
+ def test_changed_files_of_a_project_nested_two_levels_deep(clone, monkeypatch) -> None:
470
+ git(clone, "checkout", "-q", "-b", "feat")
471
+ for name in ("apps/app/code.py", "apps/other/x.py", "apps/app/sub/y.py", "infra/main.bicep"):
472
+ (clone / name).parent.mkdir(parents=True, exist_ok=True)
473
+ (clone / name).write_text(name)
474
+ git(clone, "add", "-A")
475
+ git(clone, "commit", "-q", "-m", "mono")
476
+ monkeypatch.chdir(clone) # the process cwd does not matter, the project root does
477
+ files = ci_plan_env.changed_files("main", merge_checkout=False, root=clone / "apps" / "app")
478
+ assert sorted(files) == ["../../infra/main.bicep", "../other/x.py", "code.py", "sub/y.py"]
479
+
480
+
481
+ def test_changed_files_for_a_repository_folder_ending_in_a_space(tmp_path, monkeypatch) -> None:
482
+ """Paths come from git's own spelling, not from comparing file-system paths: odd folder names change nothing."""
483
+ work = tmp_path / "repo "
484
+ work.mkdir()
485
+ git(work, "init", "-q", "-b", "main")
486
+ commit(work, "m1")
487
+ git(work, "update-ref", "refs/remotes/origin/main", "HEAD")
488
+ git(work, "checkout", "-q", "-b", "feat")
489
+ (work / "app").mkdir()
490
+ (work / "app/code.py").write_text("x")
491
+ git(work, "add", "-A")
492
+ git(work, "commit", "-q", "-m", "app")
493
+ monkeypatch.chdir(work / "app")
494
+ assert ci_plan_env.changed_files("main", merge_checkout=False, root=work / "app") == ["code.py"]
495
+ assert ci_plan_env.changed_files("main", merge_checkout=False, root=work) == ["app/code.py"]
496
+
497
+
498
+ def test_changed_files_of_the_merge_commit_in_ci_for_a_sub_folder_project(clone, monkeypatch) -> None:
499
+ """The CI path (HEAD is the PR merge commit, compared with its first parent), with the project in a sub-folder."""
500
+ git(clone, "checkout", "-q", "-b", "feat")
501
+ for name in ("app/code.py", "infra/main.bicep"):
502
+ (clone / name).parent.mkdir(exist_ok=True)
503
+ (clone / name).write_text(name)
504
+ git(clone, "add", "-A")
505
+ git(clone, "commit", "-q", "-m", "mono")
506
+ git(clone, "checkout", "-q", "main")
507
+ git(clone, "merge", "-q", "--no-ff", "-m", "merge", "feat")
508
+ monkeypatch.chdir(clone)
509
+ files = ci_plan_env.changed_files("main", merge_checkout=True, root=clone / "app")
510
+ assert sorted(files) == ["../infra/main.bicep", "code.py"]
511
+
512
+
513
+ def test_a_sibling_folder_sharing_the_project_folder_name_as_a_prefix_stays_outside(clone, monkeypatch) -> None:
514
+ git(clone, "checkout", "-q", "-b", "feat")
515
+ for name in ("app/code.py", "app2/code.py"):
516
+ (clone / name).parent.mkdir(exist_ok=True)
517
+ (clone / name).write_text(name)
518
+ git(clone, "add", "-A")
519
+ git(clone, "commit", "-q", "-m", "mono")
520
+ monkeypatch.chdir(clone / "app")
521
+ assert sorted(ci_plan_env.changed_files("main", merge_checkout=False, root=clone / "app")) == [
522
+ "../app2/code.py",
523
+ "code.py",
524
+ ]
525
+
526
+
527
+ def test_the_diff_runs_in_the_project_repository_not_the_process_cwd(clone, tmp_path, monkeypatch) -> None:
528
+ """cwd is another repository: the prefix and the diff must both come from the project's."""
529
+ git(clone, "checkout", "-q", "-b", "feat")
530
+ (clone / "app").mkdir()
531
+ (clone / "app/code.py").write_text("x")
532
+ git(clone, "add", "-A")
533
+ git(clone, "commit", "-q", "-m", "app")
534
+ elsewhere = tmp_path / "elsewhere"
535
+ elsewhere.mkdir()
536
+ git(elsewhere, "init", "-q", "-b", "main")
537
+ monkeypatch.chdir(elsewhere)
538
+ assert ci_plan_env.changed_files("main", merge_checkout=False, root=clone / "app") == ["code.py"]
@@ -1,5 +1,5 @@
1
1
  version = 1
2
- revision = 3
2
+ revision = 5
3
3
  requires-python = ">=3.14"
4
4
 
5
5
  [[package]]
@@ -51,7 +51,7 @@ wheels = [
51
51
 
52
52
  [[package]]
53
53
  name = "bmsdna-devtools"
54
- version = "1.0.0"
54
+ version = "1.1.0"
55
55
  source = { editable = "." }
56
56
  dependencies = [
57
57
  { name = "azure-identity" },