@ngocsangairvds/vsaf 3.1.26 → 3.2.1

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 (305) hide show
  1. package/package.json +2 -2
  2. package/src/global.js +70 -10
  3. package/tools/skills/vds-scripts-skill/.openskills.json +6 -0
  4. package/tools/skills/vds-scripts-skill/QUALITY.md +44 -0
  5. package/tools/skills/vds-scripts-skill/SKILL.md +135 -0
  6. package/tools/skills/vds-scripts-skill/references/audit-commands.md +171 -0
  7. package/tools/skills/vds-scripts-skill/references/capability-index.md +34 -0
  8. package/tools/skills/vds-scripts-skill/references/development-commands.md +12 -0
  9. package/tools/skills/vds-scripts-skill/references/google-sheets.md +73 -0
  10. package/tools/skills/vds-scripts-skill/references/integration-commands.md +17 -0
  11. package/tools/skills/vds-scripts-skill/references/platform-bootstrap.md +31 -0
  12. package/tools/skills/vds-scripts-skill/references/specialist-routing.md +14 -0
  13. package/tools/skills/vds-scripts-skill/references/validation-commands.md +15 -0
  14. package/tools/skills/vsaf-build/SKILL.md +32 -2
  15. package/tools/skills/vsaf-push-prd/SKILL.md +43 -40
  16. package/tools/skills/vsaf-push-srs/SKILL.md +44 -41
  17. package/tools/skills/vsaf-ship/SKILL.md +41 -10
  18. package/tools/skills/vsaf-test/SKILL.md +8 -0
  19. package/tools/vds-scripts/.mcp.json +11 -0
  20. package/tools/vds-scripts/.secrets.baseline +133 -0
  21. package/tools/vds-scripts/AGENTS.md +152 -0
  22. package/tools/vds-scripts/CLAUDE.md +101 -0
  23. package/tools/vds-scripts/CLI_COMMAND_OPTIMIZATION.md +156 -0
  24. package/tools/vds-scripts/PACKAGE_P125B_IMPLEMENTATION_SUMMARY.md +131 -0
  25. package/tools/vds-scripts/PROJECT_COMPLETION_SUMMARY.md +45 -0
  26. package/tools/vds-scripts/README.md +97 -0
  27. package/tools/vds-scripts/bitbucket_manifest_mapping.toml +34 -0
  28. package/tools/vds-scripts/bitbucket_orchestrator/ARCHITECTURE_ANALYSIS.md +258 -0
  29. package/tools/vds-scripts/bitbucket_orchestrator/BITBUCKET_API_PRACTICES.md +393 -0
  30. package/tools/vds-scripts/bitbucket_orchestrator/EVALUATION_REPORT.md +61 -0
  31. package/tools/vds-scripts/bitbucket_orchestrator/FEATURES.md +908 -0
  32. package/tools/vds-scripts/bitbucket_orchestrator/README.md +687 -0
  33. package/tools/vds-scripts/bitbucket_orchestrator/pyproject.toml +40 -0
  34. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/__init__.py +20 -0
  35. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/async_client.py +657 -0
  36. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/cli.py +2108 -0
  37. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/client.py +2534 -0
  38. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/config.py +171 -0
  39. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/errors.py +67 -0
  40. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/factory.py +185 -0
  41. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/protocols.py +244 -0
  42. package/tools/vds-scripts/bitbucket_orchestrator/tests/__init__.py +8 -0
  43. package/tools/vds-scripts/bitbucket_orchestrator/tests/conftest.py +65 -0
  44. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_advanced_search.py +151 -0
  45. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_async_client.py +546 -0
  46. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_branch_permissions.py +145 -0
  47. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_cli.py +115 -0
  48. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client.py +157 -0
  49. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_branch_conditions.py +79 -0
  50. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_code_advanced.py +163 -0
  51. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_code_file.py +32 -0
  52. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_deployment_environments.py +194 -0
  53. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_issues.py +164 -0
  54. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_pipelines_advanced.py +179 -0
  55. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_pr_blockers.py +119 -0
  56. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_repository_variables.py +156 -0
  57. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code.py +98 -0
  58. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code_advanced.py +282 -0
  59. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code_insights.py +335 -0
  60. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_conditions.py +147 -0
  61. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_config.py +131 -0
  62. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_deployment_env.py +352 -0
  63. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_factory.py +371 -0
  64. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_fork_operations.py +204 -0
  65. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_issue_cli.py +261 -0
  66. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_pipeline_advanced.py +270 -0
  67. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_pr_blocker.py +204 -0
  68. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_protocols.py +334 -0
  69. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_repo_settings.py +343 -0
  70. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_repo_variables.py +270 -0
  71. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_webhooks.py +189 -0
  72. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_workspace.py +233 -0
  73. package/tools/vds-scripts/bitbucket_orchestrator/uv.lock +742 -0
  74. package/tools/vds-scripts/confluence_orchestrator/Dockerfile +19 -0
  75. package/tools/vds-scripts/confluence_orchestrator/README.md +412 -0
  76. package/tools/vds-scripts/confluence_orchestrator/SYNC_SCRIPTS.md +127 -0
  77. package/tools/vds-scripts/confluence_orchestrator/SYNC_STANDARDIZATION.md +108 -0
  78. package/tools/vds-scripts/confluence_orchestrator/pyproject.toml +48 -0
  79. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/__init__.py +20 -0
  80. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/cli.py +2532 -0
  81. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/config.py +175 -0
  82. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/content.py +290 -0
  83. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/content_v2.py +94 -0
  84. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/crawl_tree.py +1835 -0
  85. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/errors.py +80 -0
  86. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/eventing.py +109 -0
  87. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/http.py +1114 -0
  88. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/orchestration.py +165 -0
  89. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/reporting.py +78 -0
  90. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/tree.py +121 -0
  91. package/tools/vds-scripts/confluence_orchestrator/sync_pdfs_from_markdown.py +213 -0
  92. package/tools/vds-scripts/confluence_orchestrator/sync_pdfs_to_confluence.py +305 -0
  93. package/tools/vds-scripts/confluence_orchestrator/sync_png_attachments.py +305 -0
  94. package/tools/vds-scripts/confluence_orchestrator/tests/__init__.py +0 -0
  95. package/tools/vds-scripts/confluence_orchestrator/tests/conftest.py +8 -0
  96. package/tools/vds-scripts/confluence_orchestrator/tests/test_advanced_content.py +224 -0
  97. package/tools/vds-scripts/confluence_orchestrator/tests/test_advanced_search.py +188 -0
  98. package/tools/vds-scripts/confluence_orchestrator/tests/test_cache_management.py +247 -0
  99. package/tools/vds-scripts/confluence_orchestrator/tests/test_cli.py +499 -0
  100. package/tools/vds-scripts/confluence_orchestrator/tests/test_config.py +83 -0
  101. package/tools/vds-scripts/confluence_orchestrator/tests/test_content.py +186 -0
  102. package/tools/vds-scripts/confluence_orchestrator/tests/test_content_flags.py +27 -0
  103. package/tools/vds-scripts/confluence_orchestrator/tests/test_crawl_tree.py +2250 -0
  104. package/tools/vds-scripts/confluence_orchestrator/tests/test_draft_management.py +223 -0
  105. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing.py +71 -0
  106. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_chaos.py +37 -0
  107. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_rate_limit.py +44 -0
  108. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_timeout.py +49 -0
  109. package/tools/vds-scripts/confluence_orchestrator/tests/test_export.py +230 -0
  110. package/tools/vds-scripts/confluence_orchestrator/tests/test_history.py +204 -0
  111. package/tools/vds-scripts/confluence_orchestrator/tests/test_http.py +117 -0
  112. package/tools/vds-scripts/confluence_orchestrator/tests/test_orchestration.py +91 -0
  113. package/tools/vds-scripts/confluence_orchestrator/tests/test_reporting.py +24 -0
  114. package/tools/vds-scripts/confluence_orchestrator/tests/test_search_cql.py +34 -0
  115. package/tools/vds-scripts/confluence_orchestrator/tests/test_space_management.py +237 -0
  116. package/tools/vds-scripts/confluence_orchestrator/tests/test_space_permissions.py +332 -0
  117. package/tools/vds-scripts/confluence_orchestrator/tests/test_user_group_management.py +388 -0
  118. package/tools/vds-scripts/confluence_orchestrator/uv.lock +1023 -0
  119. package/tools/vds-scripts/git_orchestrator/ENHANCEMENT_SUMMARY.md +119 -0
  120. package/tools/vds-scripts/git_orchestrator/README.md +280 -0
  121. package/tools/vds-scripts/git_orchestrator/VERIFICATION_REPORT.md +152 -0
  122. package/tools/vds-scripts/git_orchestrator/pyproject.toml +35 -0
  123. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/__init__.py +7 -0
  124. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/__main__.py +4 -0
  125. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/cli.py +847 -0
  126. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/logging_config.py +63 -0
  127. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/manifest.py +129 -0
  128. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/orchestrator.py +819 -0
  129. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/reporting.py +53 -0
  130. package/tools/vds-scripts/git_orchestrator/tests/__init__.py +0 -0
  131. package/tools/vds-scripts/git_orchestrator/tests/test_cli_settings.py +21 -0
  132. package/tools/vds-scripts/git_orchestrator/tests/test_integration.py +74 -0
  133. package/tools/vds-scripts/git_orchestrator/tests/test_manifest.py +79 -0
  134. package/tools/vds-scripts/git_orchestrator/tests/test_orchestrator.py +204 -0
  135. package/tools/vds-scripts/git_orchestrator/tests/test_public_api.py +236 -0
  136. package/tools/vds-scripts/git_orchestrator/tests/test_resilience.py +345 -0
  137. package/tools/vds-scripts/git_orchestrator/uv.lock +271 -0
  138. package/tools/vds-scripts/jira_orchestrator/README.md +770 -0
  139. package/tools/vds-scripts/jira_orchestrator/pyproject.toml +39 -0
  140. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/__init__.py +1 -0
  141. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/adapter.py +1320 -0
  142. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/cli.py +2271 -0
  143. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/config.py +138 -0
  144. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/errors.py +67 -0
  145. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/reporting.py +65 -0
  146. package/tools/vds-scripts/jira_orchestrator/tests/__init__.py +1 -0
  147. package/tools/vds-scripts/jira_orchestrator/tests/conftest.py +86 -0
  148. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_agile_list_payloads.py +54 -0
  149. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_bulk_operations.py +69 -0
  150. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_components.py +57 -0
  151. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_createmeta.py +45 -0
  152. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_dashboard.py +117 -0
  153. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_issue_properties.py +54 -0
  154. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_permissions_compat.py +42 -0
  155. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_reindex.py +42 -0
  156. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_remote_links.py +76 -0
  157. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_transitions.py +91 -0
  158. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_user_management.py +110 -0
  159. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_version_management.py +133 -0
  160. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_watchers.py +41 -0
  161. package/tools/vds-scripts/jira_orchestrator/tests/test_advanced_search.py +164 -0
  162. package/tools/vds-scripts/jira_orchestrator/tests/test_agile.py +256 -0
  163. package/tools/vds-scripts/jira_orchestrator/tests/test_application_properties.py +193 -0
  164. package/tools/vds-scripts/jira_orchestrator/tests/test_backlog.py +91 -0
  165. package/tools/vds-scripts/jira_orchestrator/tests/test_bulk_operations.py +277 -0
  166. package/tools/vds-scripts/jira_orchestrator/tests/test_cli.py +106 -0
  167. package/tools/vds-scripts/jira_orchestrator/tests/test_components.py +106 -0
  168. package/tools/vds-scripts/jira_orchestrator/tests/test_config.py +164 -0
  169. package/tools/vds-scripts/jira_orchestrator/tests/test_dashboard.py +122 -0
  170. package/tools/vds-scripts/jira_orchestrator/tests/test_discover_fields.py +207 -0
  171. package/tools/vds-scripts/jira_orchestrator/tests/test_filter_management.py +333 -0
  172. package/tools/vds-scripts/jira_orchestrator/tests/test_issue_archiving.py +164 -0
  173. package/tools/vds-scripts/jira_orchestrator/tests/test_issue_links.py +257 -0
  174. package/tools/vds-scripts/jira_orchestrator/tests/test_issue_properties.py +171 -0
  175. package/tools/vds-scripts/jira_orchestrator/tests/test_link_types.py +314 -0
  176. package/tools/vds-scripts/jira_orchestrator/tests/test_parse_set.py +37 -0
  177. package/tools/vds-scripts/jira_orchestrator/tests/test_permissions.py +273 -0
  178. package/tools/vds-scripts/jira_orchestrator/tests/test_reindex.py +81 -0
  179. package/tools/vds-scripts/jira_orchestrator/tests/test_remote_links.py +254 -0
  180. package/tools/vds-scripts/jira_orchestrator/tests/test_security_schemes.py +170 -0
  181. package/tools/vds-scripts/jira_orchestrator/tests/test_transitions_changelog.py +114 -0
  182. package/tools/vds-scripts/jira_orchestrator/tests/test_user_management.py +226 -0
  183. package/tools/vds-scripts/jira_orchestrator/tests/test_version_management.py +339 -0
  184. package/tools/vds-scripts/jira_orchestrator/tests/test_watchers.py +101 -0
  185. package/tools/vds-scripts/jira_orchestrator/tests/test_worklog.py +223 -0
  186. package/tools/vds-scripts/jira_orchestrator/uv.lock +738 -0
  187. package/tools/vds-scripts/mcp_server/Dockerfile +34 -0
  188. package/tools/vds-scripts/mcp_server/README.md +140 -0
  189. package/tools/vds-scripts/mcp_server/pyproject.toml +42 -0
  190. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/__init__.py +4 -0
  191. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/config.py +36 -0
  192. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/server.py +66 -0
  193. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/__init__.py +14 -0
  194. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/bitbucket_tools.py +47 -0
  195. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/confluence_tools.py +59 -0
  196. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/git_tools.py +71 -0
  197. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/jira_tools.py +63 -0
  198. package/tools/vds-scripts/mcp_server/tests/__init__.py +2 -0
  199. package/tools/vds-scripts/mcp_server/tests/conftest.py +29 -0
  200. package/tools/vds-scripts/mcp_server/tests/unit/__init__.py +2 -0
  201. package/tools/vds-scripts/mcp_server/tests/unit/test_bitbucket_tools.py +25 -0
  202. package/tools/vds-scripts/mcp_server/tests/unit/test_confluence_tools.py +25 -0
  203. package/tools/vds-scripts/mcp_server/tests/unit/test_git_tools.py +32 -0
  204. package/tools/vds-scripts/mcp_server/tests/unit/test_jira_tools.py +32 -0
  205. package/tools/vds-scripts/mcp_server/tests/verification/__init__.py +2 -0
  206. package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_confluence_tools.py +40 -0
  207. package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_jira_tools.py +37 -0
  208. package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_tool_registration.py +47 -0
  209. package/tools/vds-scripts/mcp_server/uv.lock +1032 -0
  210. package/tools/vds-scripts/mypy.ini +5 -0
  211. package/tools/vds-scripts/pyproject.toml +29 -0
  212. package/tools/vds-scripts/repo-manifest.yaml +273 -0
  213. package/tools/vds-scripts/repo-manifest.yaml.example +25 -0
  214. package/tools/vds-scripts/scripts/BRD-Validation-API.postman_collection.json +706 -0
  215. package/tools/vds-scripts/scripts/BRD-Validation-README.md +308 -0
  216. package/tools/vds-scripts/scripts/README.md +162 -0
  217. package/tools/vds-scripts/scripts/bootstrap_uv.sh +30 -0
  218. package/tools/vds-scripts/scripts/brd-validation-environment.json +51 -0
  219. package/tools/vds-scripts/scripts/brd-validation-test-results.json +13023 -0
  220. package/tools/vds-scripts/scripts/brd_coverage_report.json +276 -0
  221. package/tools/vds-scripts/scripts/create_memory_session.py +35 -0
  222. package/tools/vds-scripts/scripts/deployment/load_docker_images_offline.sh +90 -0
  223. package/tools/vds-scripts/scripts/final_completion_report.md +139 -0
  224. package/tools/vds-scripts/scripts/folder_structure_report.json +321 -0
  225. package/tools/vds-scripts/scripts/generate_completion_report.py +125 -0
  226. package/tools/vds-scripts/scripts/generate_intellij_modules.py +150 -0
  227. package/tools/vds-scripts/scripts/link_integrity_report.json +807 -0
  228. package/tools/vds-scripts/scripts/move_audit_artifact_pages.py +255 -0
  229. package/tools/vds-scripts/scripts/move_audit_artifact_pages_rest.py +165 -0
  230. package/tools/vds-scripts/scripts/move_wrong_dept_pages.py +216 -0
  231. package/tools/vds-scripts/scripts/save_intellij_memories.py +120 -0
  232. package/tools/vds-scripts/scripts/save_memories_to_vds_ai.py +83 -0
  233. package/tools/vds-scripts/scripts/save_memories_vds_style.py +129 -0
  234. package/tools/vds-scripts/scripts/search_intellij_memories.py +50 -0
  235. package/tools/vds-scripts/scripts/setup_intellij_workspace.py +65 -0
  236. package/tools/vds-scripts/scripts/target-state-automation/README.md +89 -0
  237. package/tools/vds-scripts/scripts/target-state-automation/confluence_sync_coordinator.sh +27 -0
  238. package/tools/vds-scripts/scripts/target-state-automation/coordination.sh +114 -0
  239. package/tools/vds-scripts/scripts/target-state-automation/diagram_coordinator.sh +25 -0
  240. package/tools/vds-scripts/scripts/target-state-automation/docs_root.sh +22 -0
  241. package/tools/vds-scripts/scripts/target-state-automation/generate_diagrams.sh +22 -0
  242. package/tools/vds-scripts/scripts/target-state-automation/markdown_coordinator.sh +25 -0
  243. package/tools/vds-scripts/scripts/target-state-automation/progress_dashboard.sh +17 -0
  244. package/tools/vds-scripts/scripts/target-state-automation/schema_coordinator.sh +25 -0
  245. package/tools/vds-scripts/scripts/target-state-automation/sync_confluence.sh +30 -0
  246. package/tools/vds-scripts/scripts/target-state-automation/update_dependencies.sh +19 -0
  247. package/tools/vds-scripts/scripts/target-state-automation/validate_links.sh +86 -0
  248. package/tools/vds-scripts/scripts/target-state-automation/validate_markdown.sh +52 -0
  249. package/tools/vds-scripts/scripts/target-state-automation/validate_schemas.sh +26 -0
  250. package/tools/vds-scripts/scripts/target-state-automation/validate_structure.sh +98 -0
  251. package/tools/vds-scripts/scripts/update_modules_xml.py +190 -0
  252. package/tools/vds-scripts/scripts/uv-workspace-alignment-verification-2026-03-25.md +128 -0
  253. package/tools/vds-scripts/scripts/validate_brd_coverage.py +179 -0
  254. package/tools/vds-scripts/scripts/validate_folder_structure.py +240 -0
  255. package/tools/vds-scripts/scripts/validate_link_integrity.py +272 -0
  256. package/tools/vds-scripts/scripts/vds_sh_helpers.sh +180 -0
  257. package/tools/vds-scripts/scripts/verification/phase2_portable_paths_ubuntu_docker.sh +26 -0
  258. package/tools/vds-scripts/scripts/worktree_uv.sh +48 -0
  259. package/tools/vds-scripts/uv.lock +8 -0
  260. package/tools/vds-scripts/vds_cli/README.md +126 -0
  261. package/tools/vds-scripts/vds_cli/VERIFICATION_REPORT.md +41 -0
  262. package/tools/vds-scripts/vds_cli/pyproject.toml +38 -0
  263. package/tools/vds-scripts/vds_cli/src/vds_cli/__init__.py +3 -0
  264. package/tools/vds-scripts/vds_cli/src/vds_cli/cli.py +173 -0
  265. package/tools/vds-scripts/vds_cli/src/vds_cli/docs_sync.py +1203 -0
  266. package/tools/vds-scripts/vds_cli/src/vds_cli/env.py +41 -0
  267. package/tools/vds-scripts/vds_cli/src/vds_cli/google_sheets_orchestrator/__init__.py +3 -0
  268. package/tools/vds-scripts/vds_cli/src/vds_cli/google_sheets_orchestrator/google_sheets_orchestrator.py +198 -0
  269. package/tools/vds-scripts/vds_cli/src/vds_cli/router.py +93 -0
  270. package/tools/vds-scripts/vds_cli/src/vds_cli/sync_api.py +647 -0
  271. package/tools/vds-scripts/vds_cli/src/vds_cli/sync_service.py +266 -0
  272. package/tools/vds-scripts/vds_cli/tests/__init__.py +2 -0
  273. package/tools/vds-scripts/vds_cli/tests/conftest.py +49 -0
  274. package/tools/vds-scripts/vds_cli/tests/unit/__init__.py +2 -0
  275. package/tools/vds-scripts/vds_cli/tests/unit/test_cli.py +143 -0
  276. package/tools/vds-scripts/vds_cli/tests/unit/test_docs_sync.py +422 -0
  277. package/tools/vds-scripts/vds_cli/tests/unit/test_env.py +51 -0
  278. package/tools/vds-scripts/vds_cli/tests/unit/test_router.py +72 -0
  279. package/tools/vds-scripts/vds_cli/tests/unit/test_sync_api.py +357 -0
  280. package/tools/vds-scripts/vds_cli/tests/unit/test_sync_service.py +160 -0
  281. package/tools/vds-scripts/vds_cli/tests/verification/__init__.py +2 -0
  282. package/tools/vds-scripts/vds_cli/tests/verification/test_bitbucket_real.py +33 -0
  283. package/tools/vds-scripts/vds_cli/tests/verification/test_confluence_real.py +35 -0
  284. package/tools/vds-scripts/vds_cli/tests/verification/test_jira_real.py +41 -0
  285. package/tools/vds-scripts/vds_cli/uv.lock +524 -0
  286. package/tools/vds-scripts/vds_cli_common/README.md +190 -0
  287. package/tools/vds-scripts/vds_cli_common/pyproject.toml +92 -0
  288. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/__init__.py +34 -0
  289. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/completers.py +139 -0
  290. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/context.py +201 -0
  291. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/env.py +119 -0
  292. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/errors.py +318 -0
  293. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/output.py +284 -0
  294. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/paths.py +78 -0
  295. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/testing.py +213 -0
  296. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/version.py +85 -0
  297. package/tools/vds-scripts/vds_cli_common/tests/__init__.py +1 -0
  298. package/tools/vds-scripts/vds_cli_common/tests/test_completers.py +148 -0
  299. package/tools/vds-scripts/vds_cli_common/tests/test_context.py +192 -0
  300. package/tools/vds-scripts/vds_cli_common/tests/test_env.py +102 -0
  301. package/tools/vds-scripts/vds_cli_common/tests/test_errors.py +186 -0
  302. package/tools/vds-scripts/vds_cli_common/tests/test_output.py +229 -0
  303. package/tools/vds-scripts/vds_cli_common/tests/test_paths.py +61 -0
  304. package/tools/vds-scripts/vds_cli_common/tests/test_testing.py +138 -0
  305. package/tools/vds-scripts/vds_cli_common/tests/test_version.py +64 -0
@@ -0,0 +1,343 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+ from tempfile import NamedTemporaryFile
5
+ from unittest.mock import Mock, patch
6
+
7
+ from typer.testing import CliRunner
8
+ from vds_bitbucket_orchestrator.cli import app
9
+ from vds_bitbucket_orchestrator.errors import BitbucketClientError
10
+
11
+
12
+ def _runner() -> CliRunner:
13
+ return CliRunner()
14
+
15
+
16
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
17
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
18
+ def test_repo_settings_branching_model_get(mock_load: Mock, mock_build: Mock) -> None:
19
+ """Test branching model get."""
20
+ runner = _runner()
21
+ settings = Mock()
22
+ mock_load.return_value = settings
23
+
24
+ client = Mock()
25
+ client.get_branching_model.return_value = {"development": {"branch": {"name": "develop"}}}
26
+ mock_build.return_value.__enter__.return_value = client
27
+
28
+ result = runner.invoke(app, ["repo-settings", "branching-model", "get", "PRJ", "repo"])
29
+ assert result.exit_code == 0
30
+ client.get_branching_model.assert_called_once_with("PRJ", "repo")
31
+
32
+
33
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
34
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
35
+ def test_repo_settings_branching_model_set_requires_yes(mock_load: Mock, mock_build: Mock) -> None:
36
+ """Test that branching model set requires --yes."""
37
+ runner = _runner()
38
+ settings = Mock()
39
+ mock_load.return_value = settings
40
+
41
+ with NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
42
+ f.write('{"development": {"branch": {"name": "develop"}}}')
43
+ model_file = Path(f.name)
44
+
45
+ try:
46
+ result = runner.invoke(
47
+ app, ["repo-settings", "branching-model", "set", "PRJ", "repo", "--model-file", str(model_file)]
48
+ )
49
+ assert result.exit_code != 0
50
+ assert "Refusing to set branching model without --yes" in result.stderr
51
+ finally:
52
+ model_file.unlink()
53
+
54
+
55
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
56
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
57
+ def test_repo_settings_branching_model_set_success(mock_load: Mock, mock_build: Mock) -> None:
58
+ """Test successful branching model set."""
59
+ runner = _runner()
60
+ settings = Mock()
61
+ mock_load.return_value = settings
62
+
63
+ client = Mock()
64
+ client.set_branching_model.return_value = {"development": {"branch": {"name": "develop"}}}
65
+ mock_build.return_value.__enter__.return_value = client
66
+
67
+ with NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
68
+ f.write('{"development": {"branch": {"name": "develop"}}}')
69
+ model_file = Path(f.name)
70
+
71
+ try:
72
+ result = runner.invoke(
73
+ app,
74
+ [
75
+ "repo-settings",
76
+ "branching-model",
77
+ "set",
78
+ "PRJ",
79
+ "repo",
80
+ "--model-file",
81
+ str(model_file),
82
+ "--yes",
83
+ ],
84
+ )
85
+ assert result.exit_code == 0
86
+ client.set_branching_model.assert_called_once()
87
+ call_args = client.set_branching_model.call_args
88
+ assert call_args[0][0] == "PRJ"
89
+ assert call_args[0][1] == "repo"
90
+ assert call_args[0][2] == {"development": {"branch": {"name": "develop"}}}
91
+ finally:
92
+ model_file.unlink()
93
+
94
+
95
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
96
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
97
+ def test_repo_settings_default_branch_get(mock_load: Mock, mock_build: Mock) -> None:
98
+ """Test default branch get."""
99
+ runner = _runner()
100
+ settings = Mock()
101
+ mock_load.return_value = settings
102
+
103
+ client = Mock()
104
+ client.get_default_branch.return_value = {"id": "refs/heads/main"}
105
+ mock_build.return_value.__enter__.return_value = client
106
+
107
+ result = runner.invoke(app, ["repo-settings", "default-branch", "get", "PRJ", "repo"])
108
+ assert result.exit_code == 0
109
+ client.get_default_branch.assert_called_once_with("PRJ", "repo")
110
+
111
+
112
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
113
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
114
+ def test_repo_settings_default_branch_set_requires_yes(mock_load: Mock, mock_build: Mock) -> None:
115
+ """Test that default branch set requires --yes."""
116
+ runner = _runner()
117
+ settings = Mock()
118
+ mock_load.return_value = settings
119
+
120
+ result = runner.invoke(app, ["repo-settings", "default-branch", "set", "PRJ", "repo", "--branch", "main"])
121
+ assert result.exit_code != 0
122
+ assert "Refusing to set default branch without --yes" in result.stderr
123
+
124
+
125
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
126
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
127
+ def test_repo_settings_default_branch_set_requires_branch(mock_load: Mock, mock_build: Mock) -> None:
128
+ """Test that default branch set requires --branch."""
129
+ runner = _runner()
130
+ settings = Mock()
131
+ mock_load.return_value = settings
132
+
133
+ result = runner.invoke(app, ["repo-settings", "default-branch", "set", "PRJ", "repo", "--yes"])
134
+ assert result.exit_code != 0
135
+ assert "--branch required" in result.stderr
136
+
137
+
138
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
139
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
140
+ def test_repo_settings_default_branch_set_success(mock_load: Mock, mock_build: Mock) -> None:
141
+ """Test successful default branch set."""
142
+ runner = _runner()
143
+ settings = Mock()
144
+ mock_load.return_value = settings
145
+
146
+ client = Mock()
147
+ client.set_default_branch.return_value = {"id": "refs/heads/main"}
148
+ mock_build.return_value.__enter__.return_value = client
149
+
150
+ result = runner.invoke(
151
+ app, ["repo-settings", "default-branch", "set", "PRJ", "repo", "--branch", "main", "--yes"]
152
+ )
153
+ assert result.exit_code == 0
154
+ client.set_default_branch.assert_called_once_with("PRJ", "repo", "main")
155
+
156
+
157
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
158
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
159
+ def test_repo_settings_hooks_get(mock_load: Mock, mock_build: Mock) -> None:
160
+ """Test hooks get."""
161
+ runner = _runner()
162
+ settings = Mock()
163
+ mock_load.return_value = settings
164
+
165
+ client = Mock()
166
+ client.get_repo_hook_settings.return_value = [{"key": "hook1", "enabled": True}]
167
+ mock_build.return_value.__enter__.return_value = client
168
+
169
+ result = runner.invoke(app, ["repo-settings", "hooks", "get", "PRJ", "repo"])
170
+ assert result.exit_code == 0
171
+ client.get_repo_hook_settings.assert_called_once_with("PRJ", "repo", start=0, limit=None, filter_type=None)
172
+
173
+
174
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
175
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
176
+ def test_repo_settings_hooks_enable_requires_yes(mock_load: Mock, mock_build: Mock) -> None:
177
+ """Test that hooks enable requires --yes."""
178
+ runner = _runner()
179
+ settings = Mock()
180
+ mock_load.return_value = settings
181
+
182
+ result = runner.invoke(app, ["repo-settings", "hooks", "enable", "PRJ", "repo", "--hook-key", "hook1"])
183
+ assert result.exit_code != 0
184
+ assert "Refusing to enable hook without --yes" in result.stderr
185
+
186
+
187
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
188
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
189
+ def test_repo_settings_hooks_enable_success(mock_load: Mock, mock_build: Mock) -> None:
190
+ """Test successful hooks enable."""
191
+ runner = _runner()
192
+ settings = Mock()
193
+ mock_load.return_value = settings
194
+
195
+ client = Mock()
196
+ client.enable_repo_hook_settings.return_value = {"key": "hook1", "enabled": True}
197
+ mock_build.return_value.__enter__.return_value = client
198
+
199
+ result = runner.invoke(
200
+ app, ["repo-settings", "hooks", "enable", "PRJ", "repo", "--hook-key", "hook1", "--yes"]
201
+ )
202
+ assert result.exit_code == 0
203
+ client.enable_repo_hook_settings.assert_called_once_with("PRJ", "repo", "hook1")
204
+
205
+
206
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
207
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
208
+ def test_repo_settings_hooks_disable_success(mock_load: Mock, mock_build: Mock) -> None:
209
+ """Test successful hooks disable."""
210
+ runner = _runner()
211
+ settings = Mock()
212
+ mock_load.return_value = settings
213
+
214
+ client = Mock()
215
+ client.disable_repo_hook_settings.return_value = {"key": "hook1", "enabled": False}
216
+ mock_build.return_value.__enter__.return_value = client
217
+
218
+ result = runner.invoke(
219
+ app, ["repo-settings", "hooks", "disable", "PRJ", "repo", "--hook-key", "hook1", "--yes"]
220
+ )
221
+ assert result.exit_code == 0
222
+ client.disable_repo_hook_settings.assert_called_once_with("PRJ", "repo", "hook1")
223
+
224
+
225
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
226
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
227
+ def test_repo_settings_lfs_get(mock_load: Mock, mock_build: Mock) -> None:
228
+ """Test LFS get."""
229
+ runner = _runner()
230
+ settings = Mock()
231
+ mock_load.return_value = settings
232
+
233
+ client = Mock()
234
+ client.get_lfs_repo_status.return_value = {"enabled": True}
235
+ mock_build.return_value.__enter__.return_value = client
236
+
237
+ result = runner.invoke(app, ["repo-settings", "lfs", "get", "PRJ", "repo"])
238
+ assert result.exit_code == 0
239
+ client.get_lfs_repo_status.assert_called_once_with("PRJ", "repo")
240
+
241
+
242
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
243
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
244
+ def test_repo_settings_lfs_set_requires_yes(mock_load: Mock, mock_build: Mock) -> None:
245
+ """Test that LFS set requires --yes."""
246
+ runner = _runner()
247
+ settings = Mock()
248
+ mock_load.return_value = settings
249
+
250
+ result = runner.invoke(app, ["repo-settings", "lfs", "set", "PRJ", "repo", "--enabled"])
251
+ assert result.exit_code != 0
252
+ assert "Refusing to set LFS status without --yes" in result.stderr
253
+
254
+
255
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
256
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
257
+ def test_repo_settings_lfs_set_requires_enabled_flag(mock_load: Mock, mock_build: Mock) -> None:
258
+ """Test that LFS set requires --enabled or --disabled."""
259
+ runner = _runner()
260
+ settings = Mock()
261
+ mock_load.return_value = settings
262
+
263
+ result = runner.invoke(app, ["repo-settings", "lfs", "set", "PRJ", "repo", "--yes"])
264
+ assert result.exit_code != 0
265
+ assert "--enabled or --disabled required" in result.stderr
266
+
267
+
268
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
269
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
270
+ def test_repo_settings_lfs_set_enabled(mock_load: Mock, mock_build: Mock) -> None:
271
+ """Test successful LFS set enabled."""
272
+ runner = _runner()
273
+ settings = Mock()
274
+ mock_load.return_value = settings
275
+
276
+ client = Mock()
277
+ client.set_lfs_repo_status.return_value = {"enabled": True}
278
+ mock_build.return_value.__enter__.return_value = client
279
+
280
+ result = runner.invoke(app, ["repo-settings", "lfs", "set", "PRJ", "repo", "--enabled", "--yes"])
281
+ assert result.exit_code == 0
282
+ client.set_lfs_repo_status.assert_called_once_with("PRJ", "repo", True)
283
+
284
+
285
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
286
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
287
+ def test_repo_settings_lfs_set_disabled(mock_load: Mock, mock_build: Mock) -> None:
288
+ """Test successful LFS set disabled."""
289
+ runner = _runner()
290
+ settings = Mock()
291
+ mock_load.return_value = settings
292
+
293
+ client = Mock()
294
+ client.set_lfs_repo_status.return_value = {"enabled": False}
295
+ mock_build.return_value.__enter__.return_value = client
296
+
297
+ result = runner.invoke(app, ["repo-settings", "lfs", "set", "PRJ", "repo", "--disabled", "--yes"])
298
+ assert result.exit_code == 0
299
+ client.set_lfs_repo_status.assert_called_once_with("PRJ", "repo", False)
300
+
301
+
302
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
303
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
304
+ def test_repo_settings_unknown_category(mock_load: Mock, mock_build: Mock) -> None:
305
+ """Test that unknown category raises error."""
306
+ runner = _runner()
307
+ settings = Mock()
308
+ mock_load.return_value = settings
309
+
310
+ result = runner.invoke(app, ["repo-settings", "unknown", "get", "PRJ", "repo"])
311
+ assert result.exit_code != 0
312
+ assert "Unknown category" in result.stderr
313
+
314
+
315
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
316
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
317
+ def test_repo_settings_unknown_action(mock_load: Mock, mock_build: Mock) -> None:
318
+ """Test that unknown action raises error."""
319
+ runner = _runner()
320
+ settings = Mock()
321
+ mock_load.return_value = settings
322
+
323
+ result = runner.invoke(app, ["repo-settings", "branching-model", "unknown", "PRJ", "repo"])
324
+ assert result.exit_code != 0
325
+ assert "Unknown action" in result.stderr
326
+
327
+
328
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
329
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
330
+ def test_repo_settings_client_error(mock_load: Mock, mock_build: Mock) -> None:
331
+ """Test that client errors are handled."""
332
+ runner = _runner()
333
+ settings = Mock()
334
+ mock_load.return_value = settings
335
+
336
+ client = Mock()
337
+ client.get_branching_model.side_effect = BitbucketClientError("Client error", context={})
338
+ mock_build.return_value.__enter__.return_value = client
339
+
340
+ result = runner.invoke(app, ["repo-settings", "branching-model", "get", "PRJ", "repo"])
341
+ assert result.exit_code != 0
342
+ assert "Error" in result.stderr
343
+
@@ -0,0 +1,270 @@
1
+ from __future__ import annotations
2
+
3
+ from unittest.mock import Mock, patch
4
+
5
+ import pytest
6
+ from typer.testing import CliRunner
7
+ from vds_bitbucket_orchestrator.cli import app
8
+
9
+
10
+ @pytest.fixture
11
+ def runner() -> CliRunner:
12
+ return CliRunner()
13
+
14
+
15
+ @pytest.fixture
16
+ def mock_client() -> Mock:
17
+ client = Mock()
18
+ client.list_repository_variables.return_value = [
19
+ {"uuid": "{uuid}", "key": "API_TOKEN", "secured": True},
20
+ ]
21
+ client.get_repository_variable.return_value = {"uuid": "{uuid}", "key": "API_TOKEN", "secured": True}
22
+ client.create_repository_variable.return_value = {"uuid": "{uuid}", "key": "API_TOKEN", "secured": True}
23
+ client.update_repository_variable.return_value = {"uuid": "{uuid}", "key": "API_TOKEN", "secured": False}
24
+ return client
25
+
26
+
27
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
28
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
29
+ def test_repo_variables_list_success(mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock) -> None:
30
+ settings = Mock()
31
+ settings.is_cloud_mode = True
32
+ mock_load.return_value = settings
33
+ mock_build.return_value.__enter__.return_value = mock_client
34
+
35
+ result = runner.invoke(
36
+ app,
37
+ [
38
+ "--no-markdown",
39
+ "repo-variables",
40
+ "list",
41
+ "--workspace",
42
+ "workspace",
43
+ "--repo-slug",
44
+ "repository",
45
+ ],
46
+ )
47
+
48
+ assert result.exit_code == 0
49
+ assert "API_TOKEN" in result.stdout
50
+ mock_client.list_repository_variables.assert_called_once_with("workspace", "repository")
51
+
52
+
53
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
54
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
55
+ def test_repo_variables_get_success(mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock) -> None:
56
+ settings = Mock()
57
+ settings.is_cloud_mode = True
58
+ mock_load.return_value = settings
59
+ mock_build.return_value.__enter__.return_value = mock_client
60
+
61
+ result = runner.invoke(
62
+ app,
63
+ [
64
+ "--no-markdown",
65
+ "repo-variables",
66
+ "get",
67
+ "--workspace",
68
+ "workspace",
69
+ "--repo-slug",
70
+ "repository",
71
+ "--uuid",
72
+ "{uuid}",
73
+ ],
74
+ )
75
+
76
+ assert result.exit_code == 0
77
+ mock_client.get_repository_variable.assert_called_once_with("workspace", "repository", "{uuid}")
78
+
79
+
80
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
81
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
82
+ def test_repo_variables_create_requires_yes(
83
+ mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock
84
+ ) -> None:
85
+ settings = Mock()
86
+ settings.is_cloud_mode = True
87
+ mock_load.return_value = settings
88
+ mock_build.return_value.__enter__.return_value = mock_client
89
+
90
+ result = runner.invoke(
91
+ app,
92
+ [
93
+ "repo-variables",
94
+ "create",
95
+ "--workspace",
96
+ "workspace",
97
+ "--repo-slug",
98
+ "repository",
99
+ "--key",
100
+ "API_TOKEN",
101
+ "--value",
102
+ "secret",
103
+ ],
104
+ )
105
+
106
+ assert result.exit_code != 0
107
+ assert "Refusing to create variable without --yes" in result.stdout or "Refusing to create variable without --yes" in result.stderr
108
+ mock_client.create_repository_variable.assert_not_called()
109
+
110
+
111
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
112
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
113
+ def test_repo_variables_create_success(
114
+ mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock
115
+ ) -> None:
116
+ settings = Mock()
117
+ settings.is_cloud_mode = True
118
+ mock_load.return_value = settings
119
+ mock_build.return_value.__enter__.return_value = mock_client
120
+
121
+ result = runner.invoke(
122
+ app,
123
+ [
124
+ "--no-markdown",
125
+ "repo-variables",
126
+ "create",
127
+ "--workspace",
128
+ "workspace",
129
+ "--repo-slug",
130
+ "repository",
131
+ "--key",
132
+ "API_TOKEN",
133
+ "--value",
134
+ "secret",
135
+ "--secured",
136
+ "true",
137
+ "--yes",
138
+ ],
139
+ )
140
+
141
+ assert result.exit_code == 0
142
+ mock_client.create_repository_variable.assert_called_once_with(
143
+ "workspace",
144
+ "repository",
145
+ "API_TOKEN",
146
+ "secret",
147
+ secured=True,
148
+ )
149
+
150
+
151
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
152
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
153
+ def test_repo_variables_update_requires_fields(
154
+ mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock
155
+ ) -> None:
156
+ settings = Mock()
157
+ settings.is_cloud_mode = True
158
+ mock_load.return_value = settings
159
+ mock_build.return_value.__enter__.return_value = mock_client
160
+
161
+ result = runner.invoke(
162
+ app,
163
+ [
164
+ "repo-variables",
165
+ "update",
166
+ "--workspace",
167
+ "workspace",
168
+ "--repo-slug",
169
+ "repository",
170
+ "--uuid",
171
+ "{uuid}",
172
+ "--yes",
173
+ ],
174
+ )
175
+
176
+ assert result.exit_code != 0
177
+ assert "Provide at least one" in result.stdout or "Provide at least one" in result.stderr
178
+ mock_client.update_repository_variable.assert_not_called()
179
+
180
+
181
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
182
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
183
+ def test_repo_variables_update_success(
184
+ mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock
185
+ ) -> None:
186
+ settings = Mock()
187
+ settings.is_cloud_mode = True
188
+ mock_load.return_value = settings
189
+ mock_build.return_value.__enter__.return_value = mock_client
190
+
191
+ result = runner.invoke(
192
+ app,
193
+ [
194
+ "--no-markdown",
195
+ "repo-variables",
196
+ "update",
197
+ "--workspace",
198
+ "workspace",
199
+ "--repo-slug",
200
+ "repository",
201
+ "--uuid",
202
+ "{uuid}",
203
+ "--value",
204
+ "updated",
205
+ "--yes",
206
+ ],
207
+ )
208
+
209
+ assert result.exit_code == 0
210
+ mock_client.update_repository_variable.assert_called_once_with(
211
+ "workspace",
212
+ "repository",
213
+ "{uuid}",
214
+ key=None,
215
+ value="updated",
216
+ secured=None,
217
+ )
218
+
219
+
220
+ @patch("vds_bitbucket_orchestrator.cli._build_client")
221
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
222
+ def test_repo_variables_delete_success(
223
+ mock_load: Mock, mock_build: Mock, runner: CliRunner, mock_client: Mock
224
+ ) -> None:
225
+ settings = Mock()
226
+ settings.is_cloud_mode = True
227
+ mock_load.return_value = settings
228
+ mock_build.return_value.__enter__.return_value = mock_client
229
+
230
+ result = runner.invoke(
231
+ app,
232
+ [
233
+ "--no-markdown",
234
+ "repo-variables",
235
+ "delete",
236
+ "--workspace",
237
+ "workspace",
238
+ "--repo-slug",
239
+ "repository",
240
+ "--uuid",
241
+ "{uuid}",
242
+ "--yes",
243
+ ],
244
+ )
245
+
246
+ assert result.exit_code == 0
247
+ mock_client.delete_repository_variable.assert_called_once_with("workspace", "repository", "{uuid}")
248
+
249
+
250
+ @patch("vds_bitbucket_orchestrator.cli.load_settings")
251
+ def test_repo_variables_requires_cloud(mock_load: Mock, runner: CliRunner) -> None:
252
+ settings = Mock()
253
+ settings.is_cloud_mode = False
254
+ mock_load.return_value = settings
255
+
256
+ result = runner.invoke(
257
+ app,
258
+ [
259
+ "repo-variables",
260
+ "list",
261
+ "--workspace",
262
+ "workspace",
263
+ "--repo-slug",
264
+ "repository",
265
+ ],
266
+ )
267
+
268
+ assert result.exit_code != 0
269
+ assert "Cloud mode" in result.stdout or "Cloud mode" in result.stderr
270
+