@ngocsangairvds/vsaf 3.1.27 → 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 (303) 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-ship/SKILL.md +41 -10
  16. package/tools/skills/vsaf-test/SKILL.md +8 -0
  17. package/tools/vds-scripts/.mcp.json +11 -0
  18. package/tools/vds-scripts/.secrets.baseline +133 -0
  19. package/tools/vds-scripts/AGENTS.md +152 -0
  20. package/tools/vds-scripts/CLAUDE.md +101 -0
  21. package/tools/vds-scripts/CLI_COMMAND_OPTIMIZATION.md +156 -0
  22. package/tools/vds-scripts/PACKAGE_P125B_IMPLEMENTATION_SUMMARY.md +131 -0
  23. package/tools/vds-scripts/PROJECT_COMPLETION_SUMMARY.md +45 -0
  24. package/tools/vds-scripts/README.md +97 -0
  25. package/tools/vds-scripts/bitbucket_manifest_mapping.toml +34 -0
  26. package/tools/vds-scripts/bitbucket_orchestrator/ARCHITECTURE_ANALYSIS.md +258 -0
  27. package/tools/vds-scripts/bitbucket_orchestrator/BITBUCKET_API_PRACTICES.md +393 -0
  28. package/tools/vds-scripts/bitbucket_orchestrator/EVALUATION_REPORT.md +61 -0
  29. package/tools/vds-scripts/bitbucket_orchestrator/FEATURES.md +908 -0
  30. package/tools/vds-scripts/bitbucket_orchestrator/README.md +687 -0
  31. package/tools/vds-scripts/bitbucket_orchestrator/pyproject.toml +40 -0
  32. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/__init__.py +20 -0
  33. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/async_client.py +657 -0
  34. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/cli.py +2108 -0
  35. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/client.py +2534 -0
  36. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/config.py +171 -0
  37. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/errors.py +67 -0
  38. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/factory.py +185 -0
  39. package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/protocols.py +244 -0
  40. package/tools/vds-scripts/bitbucket_orchestrator/tests/__init__.py +8 -0
  41. package/tools/vds-scripts/bitbucket_orchestrator/tests/conftest.py +65 -0
  42. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_advanced_search.py +151 -0
  43. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_async_client.py +546 -0
  44. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_branch_permissions.py +145 -0
  45. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_cli.py +115 -0
  46. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client.py +157 -0
  47. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_branch_conditions.py +79 -0
  48. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_code_advanced.py +163 -0
  49. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_code_file.py +32 -0
  50. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_deployment_environments.py +194 -0
  51. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_issues.py +164 -0
  52. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_pipelines_advanced.py +179 -0
  53. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_pr_blockers.py +119 -0
  54. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_repository_variables.py +156 -0
  55. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code.py +98 -0
  56. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code_advanced.py +282 -0
  57. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code_insights.py +335 -0
  58. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_conditions.py +147 -0
  59. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_config.py +131 -0
  60. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_deployment_env.py +352 -0
  61. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_factory.py +371 -0
  62. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_fork_operations.py +204 -0
  63. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_issue_cli.py +261 -0
  64. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_pipeline_advanced.py +270 -0
  65. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_pr_blocker.py +204 -0
  66. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_protocols.py +334 -0
  67. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_repo_settings.py +343 -0
  68. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_repo_variables.py +270 -0
  69. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_webhooks.py +189 -0
  70. package/tools/vds-scripts/bitbucket_orchestrator/tests/test_workspace.py +233 -0
  71. package/tools/vds-scripts/bitbucket_orchestrator/uv.lock +742 -0
  72. package/tools/vds-scripts/confluence_orchestrator/Dockerfile +19 -0
  73. package/tools/vds-scripts/confluence_orchestrator/README.md +412 -0
  74. package/tools/vds-scripts/confluence_orchestrator/SYNC_SCRIPTS.md +127 -0
  75. package/tools/vds-scripts/confluence_orchestrator/SYNC_STANDARDIZATION.md +108 -0
  76. package/tools/vds-scripts/confluence_orchestrator/pyproject.toml +48 -0
  77. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/__init__.py +20 -0
  78. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/cli.py +2532 -0
  79. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/config.py +175 -0
  80. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/content.py +290 -0
  81. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/content_v2.py +94 -0
  82. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/crawl_tree.py +1835 -0
  83. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/errors.py +80 -0
  84. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/eventing.py +109 -0
  85. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/http.py +1114 -0
  86. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/orchestration.py +165 -0
  87. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/reporting.py +78 -0
  88. package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/tree.py +121 -0
  89. package/tools/vds-scripts/confluence_orchestrator/sync_pdfs_from_markdown.py +213 -0
  90. package/tools/vds-scripts/confluence_orchestrator/sync_pdfs_to_confluence.py +305 -0
  91. package/tools/vds-scripts/confluence_orchestrator/sync_png_attachments.py +305 -0
  92. package/tools/vds-scripts/confluence_orchestrator/tests/__init__.py +0 -0
  93. package/tools/vds-scripts/confluence_orchestrator/tests/conftest.py +8 -0
  94. package/tools/vds-scripts/confluence_orchestrator/tests/test_advanced_content.py +224 -0
  95. package/tools/vds-scripts/confluence_orchestrator/tests/test_advanced_search.py +188 -0
  96. package/tools/vds-scripts/confluence_orchestrator/tests/test_cache_management.py +247 -0
  97. package/tools/vds-scripts/confluence_orchestrator/tests/test_cli.py +499 -0
  98. package/tools/vds-scripts/confluence_orchestrator/tests/test_config.py +83 -0
  99. package/tools/vds-scripts/confluence_orchestrator/tests/test_content.py +186 -0
  100. package/tools/vds-scripts/confluence_orchestrator/tests/test_content_flags.py +27 -0
  101. package/tools/vds-scripts/confluence_orchestrator/tests/test_crawl_tree.py +2250 -0
  102. package/tools/vds-scripts/confluence_orchestrator/tests/test_draft_management.py +223 -0
  103. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing.py +71 -0
  104. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_chaos.py +37 -0
  105. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_rate_limit.py +44 -0
  106. package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_timeout.py +49 -0
  107. package/tools/vds-scripts/confluence_orchestrator/tests/test_export.py +230 -0
  108. package/tools/vds-scripts/confluence_orchestrator/tests/test_history.py +204 -0
  109. package/tools/vds-scripts/confluence_orchestrator/tests/test_http.py +117 -0
  110. package/tools/vds-scripts/confluence_orchestrator/tests/test_orchestration.py +91 -0
  111. package/tools/vds-scripts/confluence_orchestrator/tests/test_reporting.py +24 -0
  112. package/tools/vds-scripts/confluence_orchestrator/tests/test_search_cql.py +34 -0
  113. package/tools/vds-scripts/confluence_orchestrator/tests/test_space_management.py +237 -0
  114. package/tools/vds-scripts/confluence_orchestrator/tests/test_space_permissions.py +332 -0
  115. package/tools/vds-scripts/confluence_orchestrator/tests/test_user_group_management.py +388 -0
  116. package/tools/vds-scripts/confluence_orchestrator/uv.lock +1023 -0
  117. package/tools/vds-scripts/git_orchestrator/ENHANCEMENT_SUMMARY.md +119 -0
  118. package/tools/vds-scripts/git_orchestrator/README.md +280 -0
  119. package/tools/vds-scripts/git_orchestrator/VERIFICATION_REPORT.md +152 -0
  120. package/tools/vds-scripts/git_orchestrator/pyproject.toml +35 -0
  121. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/__init__.py +7 -0
  122. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/__main__.py +4 -0
  123. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/cli.py +847 -0
  124. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/logging_config.py +63 -0
  125. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/manifest.py +129 -0
  126. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/orchestrator.py +819 -0
  127. package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/reporting.py +53 -0
  128. package/tools/vds-scripts/git_orchestrator/tests/__init__.py +0 -0
  129. package/tools/vds-scripts/git_orchestrator/tests/test_cli_settings.py +21 -0
  130. package/tools/vds-scripts/git_orchestrator/tests/test_integration.py +74 -0
  131. package/tools/vds-scripts/git_orchestrator/tests/test_manifest.py +79 -0
  132. package/tools/vds-scripts/git_orchestrator/tests/test_orchestrator.py +204 -0
  133. package/tools/vds-scripts/git_orchestrator/tests/test_public_api.py +236 -0
  134. package/tools/vds-scripts/git_orchestrator/tests/test_resilience.py +345 -0
  135. package/tools/vds-scripts/git_orchestrator/uv.lock +271 -0
  136. package/tools/vds-scripts/jira_orchestrator/README.md +770 -0
  137. package/tools/vds-scripts/jira_orchestrator/pyproject.toml +39 -0
  138. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/__init__.py +1 -0
  139. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/adapter.py +1320 -0
  140. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/cli.py +2271 -0
  141. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/config.py +138 -0
  142. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/errors.py +67 -0
  143. package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/reporting.py +65 -0
  144. package/tools/vds-scripts/jira_orchestrator/tests/__init__.py +1 -0
  145. package/tools/vds-scripts/jira_orchestrator/tests/conftest.py +86 -0
  146. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_agile_list_payloads.py +54 -0
  147. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_bulk_operations.py +69 -0
  148. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_components.py +57 -0
  149. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_createmeta.py +45 -0
  150. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_dashboard.py +117 -0
  151. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_issue_properties.py +54 -0
  152. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_permissions_compat.py +42 -0
  153. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_reindex.py +42 -0
  154. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_remote_links.py +76 -0
  155. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_transitions.py +91 -0
  156. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_user_management.py +110 -0
  157. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_version_management.py +133 -0
  158. package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_watchers.py +41 -0
  159. package/tools/vds-scripts/jira_orchestrator/tests/test_advanced_search.py +164 -0
  160. package/tools/vds-scripts/jira_orchestrator/tests/test_agile.py +256 -0
  161. package/tools/vds-scripts/jira_orchestrator/tests/test_application_properties.py +193 -0
  162. package/tools/vds-scripts/jira_orchestrator/tests/test_backlog.py +91 -0
  163. package/tools/vds-scripts/jira_orchestrator/tests/test_bulk_operations.py +277 -0
  164. package/tools/vds-scripts/jira_orchestrator/tests/test_cli.py +106 -0
  165. package/tools/vds-scripts/jira_orchestrator/tests/test_components.py +106 -0
  166. package/tools/vds-scripts/jira_orchestrator/tests/test_config.py +164 -0
  167. package/tools/vds-scripts/jira_orchestrator/tests/test_dashboard.py +122 -0
  168. package/tools/vds-scripts/jira_orchestrator/tests/test_discover_fields.py +207 -0
  169. package/tools/vds-scripts/jira_orchestrator/tests/test_filter_management.py +333 -0
  170. package/tools/vds-scripts/jira_orchestrator/tests/test_issue_archiving.py +164 -0
  171. package/tools/vds-scripts/jira_orchestrator/tests/test_issue_links.py +257 -0
  172. package/tools/vds-scripts/jira_orchestrator/tests/test_issue_properties.py +171 -0
  173. package/tools/vds-scripts/jira_orchestrator/tests/test_link_types.py +314 -0
  174. package/tools/vds-scripts/jira_orchestrator/tests/test_parse_set.py +37 -0
  175. package/tools/vds-scripts/jira_orchestrator/tests/test_permissions.py +273 -0
  176. package/tools/vds-scripts/jira_orchestrator/tests/test_reindex.py +81 -0
  177. package/tools/vds-scripts/jira_orchestrator/tests/test_remote_links.py +254 -0
  178. package/tools/vds-scripts/jira_orchestrator/tests/test_security_schemes.py +170 -0
  179. package/tools/vds-scripts/jira_orchestrator/tests/test_transitions_changelog.py +114 -0
  180. package/tools/vds-scripts/jira_orchestrator/tests/test_user_management.py +226 -0
  181. package/tools/vds-scripts/jira_orchestrator/tests/test_version_management.py +339 -0
  182. package/tools/vds-scripts/jira_orchestrator/tests/test_watchers.py +101 -0
  183. package/tools/vds-scripts/jira_orchestrator/tests/test_worklog.py +223 -0
  184. package/tools/vds-scripts/jira_orchestrator/uv.lock +738 -0
  185. package/tools/vds-scripts/mcp_server/Dockerfile +34 -0
  186. package/tools/vds-scripts/mcp_server/README.md +140 -0
  187. package/tools/vds-scripts/mcp_server/pyproject.toml +42 -0
  188. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/__init__.py +4 -0
  189. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/config.py +36 -0
  190. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/server.py +66 -0
  191. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/__init__.py +14 -0
  192. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/bitbucket_tools.py +47 -0
  193. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/confluence_tools.py +59 -0
  194. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/git_tools.py +71 -0
  195. package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/jira_tools.py +63 -0
  196. package/tools/vds-scripts/mcp_server/tests/__init__.py +2 -0
  197. package/tools/vds-scripts/mcp_server/tests/conftest.py +29 -0
  198. package/tools/vds-scripts/mcp_server/tests/unit/__init__.py +2 -0
  199. package/tools/vds-scripts/mcp_server/tests/unit/test_bitbucket_tools.py +25 -0
  200. package/tools/vds-scripts/mcp_server/tests/unit/test_confluence_tools.py +25 -0
  201. package/tools/vds-scripts/mcp_server/tests/unit/test_git_tools.py +32 -0
  202. package/tools/vds-scripts/mcp_server/tests/unit/test_jira_tools.py +32 -0
  203. package/tools/vds-scripts/mcp_server/tests/verification/__init__.py +2 -0
  204. package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_confluence_tools.py +40 -0
  205. package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_jira_tools.py +37 -0
  206. package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_tool_registration.py +47 -0
  207. package/tools/vds-scripts/mcp_server/uv.lock +1032 -0
  208. package/tools/vds-scripts/mypy.ini +5 -0
  209. package/tools/vds-scripts/pyproject.toml +29 -0
  210. package/tools/vds-scripts/repo-manifest.yaml +273 -0
  211. package/tools/vds-scripts/repo-manifest.yaml.example +25 -0
  212. package/tools/vds-scripts/scripts/BRD-Validation-API.postman_collection.json +706 -0
  213. package/tools/vds-scripts/scripts/BRD-Validation-README.md +308 -0
  214. package/tools/vds-scripts/scripts/README.md +162 -0
  215. package/tools/vds-scripts/scripts/bootstrap_uv.sh +30 -0
  216. package/tools/vds-scripts/scripts/brd-validation-environment.json +51 -0
  217. package/tools/vds-scripts/scripts/brd-validation-test-results.json +13023 -0
  218. package/tools/vds-scripts/scripts/brd_coverage_report.json +276 -0
  219. package/tools/vds-scripts/scripts/create_memory_session.py +35 -0
  220. package/tools/vds-scripts/scripts/deployment/load_docker_images_offline.sh +90 -0
  221. package/tools/vds-scripts/scripts/final_completion_report.md +139 -0
  222. package/tools/vds-scripts/scripts/folder_structure_report.json +321 -0
  223. package/tools/vds-scripts/scripts/generate_completion_report.py +125 -0
  224. package/tools/vds-scripts/scripts/generate_intellij_modules.py +150 -0
  225. package/tools/vds-scripts/scripts/link_integrity_report.json +807 -0
  226. package/tools/vds-scripts/scripts/move_audit_artifact_pages.py +255 -0
  227. package/tools/vds-scripts/scripts/move_audit_artifact_pages_rest.py +165 -0
  228. package/tools/vds-scripts/scripts/move_wrong_dept_pages.py +216 -0
  229. package/tools/vds-scripts/scripts/save_intellij_memories.py +120 -0
  230. package/tools/vds-scripts/scripts/save_memories_to_vds_ai.py +83 -0
  231. package/tools/vds-scripts/scripts/save_memories_vds_style.py +129 -0
  232. package/tools/vds-scripts/scripts/search_intellij_memories.py +50 -0
  233. package/tools/vds-scripts/scripts/setup_intellij_workspace.py +65 -0
  234. package/tools/vds-scripts/scripts/target-state-automation/README.md +89 -0
  235. package/tools/vds-scripts/scripts/target-state-automation/confluence_sync_coordinator.sh +27 -0
  236. package/tools/vds-scripts/scripts/target-state-automation/coordination.sh +114 -0
  237. package/tools/vds-scripts/scripts/target-state-automation/diagram_coordinator.sh +25 -0
  238. package/tools/vds-scripts/scripts/target-state-automation/docs_root.sh +22 -0
  239. package/tools/vds-scripts/scripts/target-state-automation/generate_diagrams.sh +22 -0
  240. package/tools/vds-scripts/scripts/target-state-automation/markdown_coordinator.sh +25 -0
  241. package/tools/vds-scripts/scripts/target-state-automation/progress_dashboard.sh +17 -0
  242. package/tools/vds-scripts/scripts/target-state-automation/schema_coordinator.sh +25 -0
  243. package/tools/vds-scripts/scripts/target-state-automation/sync_confluence.sh +30 -0
  244. package/tools/vds-scripts/scripts/target-state-automation/update_dependencies.sh +19 -0
  245. package/tools/vds-scripts/scripts/target-state-automation/validate_links.sh +86 -0
  246. package/tools/vds-scripts/scripts/target-state-automation/validate_markdown.sh +52 -0
  247. package/tools/vds-scripts/scripts/target-state-automation/validate_schemas.sh +26 -0
  248. package/tools/vds-scripts/scripts/target-state-automation/validate_structure.sh +98 -0
  249. package/tools/vds-scripts/scripts/update_modules_xml.py +190 -0
  250. package/tools/vds-scripts/scripts/uv-workspace-alignment-verification-2026-03-25.md +128 -0
  251. package/tools/vds-scripts/scripts/validate_brd_coverage.py +179 -0
  252. package/tools/vds-scripts/scripts/validate_folder_structure.py +240 -0
  253. package/tools/vds-scripts/scripts/validate_link_integrity.py +272 -0
  254. package/tools/vds-scripts/scripts/vds_sh_helpers.sh +180 -0
  255. package/tools/vds-scripts/scripts/verification/phase2_portable_paths_ubuntu_docker.sh +26 -0
  256. package/tools/vds-scripts/scripts/worktree_uv.sh +48 -0
  257. package/tools/vds-scripts/uv.lock +8 -0
  258. package/tools/vds-scripts/vds_cli/README.md +126 -0
  259. package/tools/vds-scripts/vds_cli/VERIFICATION_REPORT.md +41 -0
  260. package/tools/vds-scripts/vds_cli/pyproject.toml +38 -0
  261. package/tools/vds-scripts/vds_cli/src/vds_cli/__init__.py +3 -0
  262. package/tools/vds-scripts/vds_cli/src/vds_cli/cli.py +173 -0
  263. package/tools/vds-scripts/vds_cli/src/vds_cli/docs_sync.py +1203 -0
  264. package/tools/vds-scripts/vds_cli/src/vds_cli/env.py +41 -0
  265. package/tools/vds-scripts/vds_cli/src/vds_cli/google_sheets_orchestrator/__init__.py +3 -0
  266. package/tools/vds-scripts/vds_cli/src/vds_cli/google_sheets_orchestrator/google_sheets_orchestrator.py +198 -0
  267. package/tools/vds-scripts/vds_cli/src/vds_cli/router.py +93 -0
  268. package/tools/vds-scripts/vds_cli/src/vds_cli/sync_api.py +647 -0
  269. package/tools/vds-scripts/vds_cli/src/vds_cli/sync_service.py +266 -0
  270. package/tools/vds-scripts/vds_cli/tests/__init__.py +2 -0
  271. package/tools/vds-scripts/vds_cli/tests/conftest.py +49 -0
  272. package/tools/vds-scripts/vds_cli/tests/unit/__init__.py +2 -0
  273. package/tools/vds-scripts/vds_cli/tests/unit/test_cli.py +143 -0
  274. package/tools/vds-scripts/vds_cli/tests/unit/test_docs_sync.py +422 -0
  275. package/tools/vds-scripts/vds_cli/tests/unit/test_env.py +51 -0
  276. package/tools/vds-scripts/vds_cli/tests/unit/test_router.py +72 -0
  277. package/tools/vds-scripts/vds_cli/tests/unit/test_sync_api.py +357 -0
  278. package/tools/vds-scripts/vds_cli/tests/unit/test_sync_service.py +160 -0
  279. package/tools/vds-scripts/vds_cli/tests/verification/__init__.py +2 -0
  280. package/tools/vds-scripts/vds_cli/tests/verification/test_bitbucket_real.py +33 -0
  281. package/tools/vds-scripts/vds_cli/tests/verification/test_confluence_real.py +35 -0
  282. package/tools/vds-scripts/vds_cli/tests/verification/test_jira_real.py +41 -0
  283. package/tools/vds-scripts/vds_cli/uv.lock +524 -0
  284. package/tools/vds-scripts/vds_cli_common/README.md +190 -0
  285. package/tools/vds-scripts/vds_cli_common/pyproject.toml +92 -0
  286. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/__init__.py +34 -0
  287. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/completers.py +139 -0
  288. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/context.py +201 -0
  289. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/env.py +119 -0
  290. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/errors.py +318 -0
  291. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/output.py +284 -0
  292. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/paths.py +78 -0
  293. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/testing.py +213 -0
  294. package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/version.py +85 -0
  295. package/tools/vds-scripts/vds_cli_common/tests/__init__.py +1 -0
  296. package/tools/vds-scripts/vds_cli_common/tests/test_completers.py +148 -0
  297. package/tools/vds-scripts/vds_cli_common/tests/test_context.py +192 -0
  298. package/tools/vds-scripts/vds_cli_common/tests/test_env.py +102 -0
  299. package/tools/vds-scripts/vds_cli_common/tests/test_errors.py +186 -0
  300. package/tools/vds-scripts/vds_cli_common/tests/test_output.py +229 -0
  301. package/tools/vds-scripts/vds_cli_common/tests/test_paths.py +61 -0
  302. package/tools/vds-scripts/vds_cli_common/tests/test_testing.py +138 -0
  303. package/tools/vds-scripts/vds_cli_common/tests/test_version.py +64 -0
@@ -0,0 +1,258 @@
1
+ # Bitbucket Orchestrator Architecture Analysis
2
+
3
+ ## Overview
4
+
5
+ This document verifies that there is **no duplicate logic** in the Bitbucket-related code across the VDS scripts
6
+ ecosystem. All Bitbucket operations follow a clean, single-source-of-truth architecture.
7
+
8
+ ## Architecture Layers
9
+
10
+ ```
11
+ ┌─────────────────────────────────────────────────────────────┐
12
+ │ User/Agent Interface │
13
+ └────────────────────┬────────────────────────────────────────┘
14
+
15
+ ┌───────────┴───────────┐
16
+ │ │
17
+ ┌────▼────┐ ┌─────▼─────┐
18
+ │ VDS CLI │ │ MCP Server │
19
+ └────┬────┘ └─────┬─────┘
20
+ │ │
21
+ │ Routes to │ Calls VDS CLI
22
+ │ │
23
+ ┌────▼───────────────────────▼────┐
24
+ │ Bitbucket Orchestrator │
25
+ │ (Single Source of Truth) │
26
+ └────┬────────────────────────────┘
27
+
28
+ ┌────▼────┐
29
+ │ SDK │
30
+ │ (atlassian-python-api) │
31
+ └─────────┘
32
+ ```
33
+
34
+ ## Single Source of Truth
35
+
36
+ ### 1. Bitbucket Client (`bitbucket_orchestrator/src/vds_bitbucket_orchestrator/client.py`)
37
+
38
+ **Status**: ✅ **ONLY** place that directly uses `AtlassianBitbucket` SDK
39
+
40
+ ```python
41
+ from atlassian import Bitbucket as AtlassianBitbucket
42
+
43
+ class BitbucketClient:
44
+ """Bitbucket client wrapper using atlassian-python-api SDK."""
45
+ def __init__(self, settings: BitbucketSettings):
46
+ # Only place that creates AtlassianBitbucket instance
47
+ self._client = AtlassianBitbucket(...)
48
+ ```
49
+
50
+ **Verification**:
51
+
52
+ - ✅ Only file that imports `AtlassianBitbucket`
53
+ - ✅ All Bitbucket API calls go through this client
54
+ - ✅ All error handling centralized here
55
+ - ✅ All retry logic centralized here
56
+
57
+ ### 2. Configuration Loading (`bitbucket_orchestrator/src/vds_bitbucket_orchestrator/config.py`)
58
+
59
+ **Status**: ✅ **ONLY** place that loads Bitbucket settings
60
+
61
+ ```python
62
+ def load_settings(...) -> BitbucketSettings:
63
+ """Load orchestrator settings from the environment."""
64
+ # Only place that creates BitbucketSettings
65
+ ```
66
+
67
+ **Verification**:
68
+
69
+ - ✅ Only file that defines `BitbucketSettings`
70
+ - ✅ Only file that implements `load_settings()` for Bitbucket
71
+ - ✅ Consistent with other orchestrators (JIRA, Confluence)
72
+
73
+ ### 3. Client Factory (`bitbucket_orchestrator/src/vds_bitbucket_orchestrator/cli.py`)
74
+
75
+ **Status**: ✅ **ONLY** place that builds BitbucketClient instances
76
+
77
+ ```python
78
+ def _build_client(settings: BitbucketSettings) -> BitbucketClient:
79
+ """Build and return a configured BitbucketClient."""
80
+ return BitbucketClient(settings)
81
+ ```
82
+
83
+ **Verification**:
84
+
85
+ - ✅ Single factory function for client creation
86
+ - ✅ Used consistently across all CLI commands
87
+ - ✅ No duplicate client initialization logic
88
+
89
+ ## Integration Points (No Duplication)
90
+
91
+ ### 1. VDS CLI Router (`vds_cli/src/vds_cli/router.py`)
92
+
93
+ **Status**: ✅ **NO** Bitbucket logic, only routing
94
+
95
+ ```python
96
+ ORCHESTRATORS = {
97
+ "bitbucket": {
98
+ "module": "vds_bitbucket_orchestrator.cli",
99
+ "path": "bitbucket_orchestrator",
100
+ },
101
+ }
102
+
103
+ def run_orchestrator(service: str, args: list[str], script_dir: Path) -> int:
104
+ """Run orchestrator via uv."""
105
+ # Simply routes to orchestrator, no Bitbucket-specific logic
106
+ ```
107
+
108
+ **Verification**:
109
+
110
+ - ✅ No Bitbucket API calls
111
+ - ✅ No Bitbucket client creation
112
+ - ✅ No Bitbucket configuration loading
113
+ - ✅ Pure routing logic only
114
+
115
+ ### 2. VDS CLI Main (`vds_cli/src/vds_cli/cli.py`)
116
+
117
+ **Status**: ✅ **NO** Bitbucket logic, only command registration
118
+
119
+ ```python
120
+ @app.command(context_settings=PASS_THRU_CONTEXT)
121
+ def bitbucket(ctx: typer.Context) -> None:
122
+ """Bitbucket operations."""
123
+ _run_service("bitbucket", list(ctx.args)) # Routes to orchestrator
124
+ ```
125
+
126
+ **Verification**:
127
+
128
+ - ✅ No Bitbucket API calls
129
+ - ✅ No Bitbucket client creation
130
+ - ✅ No Bitbucket configuration loading
131
+ - ✅ Pure command registration only
132
+
133
+ ### 3. MCP Server Tools (`mcp_server/src/vds_mcp_server/tools/bitbucket_tools.py`)
134
+
135
+ **Status**: ✅ **NO** direct Bitbucket API calls, uses VDS CLI
136
+
137
+ ```python
138
+ def register_bitbucket_tools(mcp: FastMCP, execute_cli: Callable[..., Any]) -> None:
139
+ """Register Bitbucket tools with MCP server."""
140
+
141
+ @mcp.tool()
142
+ async def bitbucket_list_projects() -> str:
143
+ # Uses VDS CLI, not direct API calls
144
+ result = await execute_cli("bitbucket", "projects")
145
+ ```
146
+
147
+ **Verification**:
148
+
149
+ - ✅ No direct `AtlassianBitbucket` usage
150
+ - ✅ No direct `BitbucketClient` usage
151
+ - ✅ No direct `BitbucketSettings` usage
152
+ - ✅ Uses VDS CLI as abstraction layer
153
+ - ✅ Proper separation of concerns
154
+
155
+ ### 4. Git Orchestrator (`git_orchestrator/src/vds_git_orchestrator/orchestrator.py`)
156
+
157
+ **Status**: ✅ **NO** Bitbucket-specific code
158
+
159
+ **Verification**:
160
+
161
+ - ✅ No Bitbucket imports
162
+ - ✅ No Bitbucket API calls
163
+ - ✅ Only Git operations (uses Bitbucket as Git remote, not API)
164
+ - ✅ References `VDS_BITBUCKET_HTTP_BASE` for Git URL construction only
165
+
166
+ ## Method Mapping Verification
167
+
168
+ All Bitbucket operations map to a single implementation:
169
+
170
+ | Operation | Implementation Location | Duplicates? | |-----------|------------------------|-------------| |
171
+ `create_repository()` | `bitbucket_orchestrator/client.py` | ❌ None | | `get_repository()` |
172
+ `bitbucket_orchestrator/client.py` | ❌ None | | `update_repository()` | `bitbucket_orchestrator/client.py` | ❌ None | |
173
+ `delete_repository()` | `bitbucket_orchestrator/client.py` | ❌ None | | `fork_repository()` |
174
+ `bitbucket_orchestrator/client.py` | ❌ None | | `list_repositories()` | `bitbucket_orchestrator/client.py` | ❌ None | |
175
+ `create_pull_request()` | `bitbucket_orchestrator/client.py` | ❌ None | | All other operations |
176
+ `bitbucket_orchestrator/client.py` | ❌ None |
177
+
178
+ ## Configuration Verification
179
+
180
+ All Bitbucket configuration loading maps to a single implementation:
181
+
182
+ | Configuration | Implementation Location | Duplicates? | |---------------|------------------------|-------------| |
183
+ `BitbucketSettings` | `bitbucket_orchestrator/config.py` | ❌ None | | `load_settings()` |
184
+ `bitbucket_orchestrator/config.py` | ❌ None | | Environment variable parsing | `bitbucket_orchestrator/config.py` | ❌
185
+ None |
186
+
187
+ ## Client Initialization Verification
188
+
189
+ All Bitbucket client creation maps to a single implementation:
190
+
191
+ | Initialization | Implementation Location | Duplicates? | |----------------|------------------------|-------------| |
192
+ `BitbucketClient.__init__()` | `bitbucket_orchestrator/client.py` | ❌ None | | `_build_client()` |
193
+ `bitbucket_orchestrator/cli.py` | ❌ None | | SDK client creation | `bitbucket_orchestrator/client.py` | ❌ None |
194
+
195
+ ## Test Coverage Verification
196
+
197
+ All tests use the same client initialization pattern:
198
+
199
+ ```python
200
+ # All tests use this pattern - no duplication
201
+ @patch("vds_bitbucket_orchestrator.client.AtlassianBitbucket")
202
+ def test_something(mock_bitbucket_class: Mock, mock_settings: BitbucketSettings):
203
+ client = BitbucketClient(mock_settings)
204
+ # Test implementation
205
+ ```
206
+
207
+ **Verification**:
208
+
209
+ - ✅ All tests mock `AtlassianBitbucket` at the same location
210
+ - ✅ All tests use `BitbucketClient` from same module
211
+ - ✅ All tests use `BitbucketSettings` from same module
212
+ - ✅ No duplicate test setup logic
213
+
214
+ ## Summary
215
+
216
+ ### ✅ No Duplication Found
217
+
218
+ 1. **Single SDK Usage**: Only `bitbucket_orchestrator/client.py` uses `AtlassianBitbucket`
219
+ 1. **Single Configuration**: Only `bitbucket_orchestrator/config.py` handles settings
220
+ 1. **Single Client Factory**: Only `bitbucket_orchestrator/cli.py` has `_build_client()`
221
+ 1. **Clean Integration**: VDS CLI and MCP Server use orchestrator, don't duplicate logic
222
+ 1. **Consistent Patterns**: All components follow the same architecture
223
+
224
+ ### Architecture Benefits
225
+
226
+ 1. **Maintainability**: Changes to Bitbucket logic only need to be made in one place
227
+ 1. **Consistency**: All consumers get the same behavior
228
+ 1. **Testability**: Single point to mock for testing
229
+ 1. **Error Handling**: Centralized error handling and retry logic
230
+ 1. **Documentation**: Single source of truth for API practices
231
+
232
+ ### Verification Commands
233
+
234
+ ```bash
235
+ # Verify only one place imports AtlassianBitbucket
236
+ grep -r "from atlassian import Bitbucket\|AtlassianBitbucket" docs-nttc/scripts/
237
+ # Result: Only bitbucket_orchestrator/client.py
238
+
239
+ # Verify only one place defines BitbucketSettings
240
+ grep -r "class BitbucketSettings" docs-nttc/scripts/
241
+ # Result: Only bitbucket_orchestrator/config.py
242
+
243
+ # Verify only one place has _build_client for Bitbucket
244
+ grep -r "def _build_client.*Bitbucket" docs-nttc/scripts/
245
+ # Result: Only bitbucket_orchestrator/cli.py
246
+ ```
247
+
248
+ ## Conclusion
249
+
250
+ ✅ **No duplicate logic found**. The Bitbucket orchestrator follows a clean, single-source-of-truth architecture with
251
+ proper separation of concerns:
252
+
253
+ - **Orchestrator**: Implements all Bitbucket logic
254
+ - **VDS CLI**: Routes commands to orchestrator
255
+ - **MCP Server**: Uses VDS CLI as abstraction layer
256
+ - **Git Orchestrator**: Uses Bitbucket as Git remote only, no API calls
257
+
258
+ All components work together without duplication, ensuring maintainability and consistency.
@@ -0,0 +1,393 @@
1
+ # Bitbucket API Practices - VDS Orchestrator
2
+
3
+ This document outlines the practices used in the VDS Bitbucket Orchestrator, aligned with the
4
+ [Atlassian Python API documentation](https://atlassian-python-api.readthedocs.io/bitbucket.html).
5
+
6
+ ## Implementation Approach
7
+
8
+ ### 1. SDK Usage
9
+
10
+ We use the `atlassian-python-api` SDK (v4.0.7) as the **exclusive** method for all Bitbucket operations. This ensures:
11
+
12
+ - ✅ Consistent API interactions across all operations
13
+ - ✅ Automatic handling of Server/DC vs Cloud mode differences
14
+ - ✅ Built-in retry logic and error handling
15
+ - ✅ Type safety and validation
16
+
17
+ **Reference**: [Atlassian Python API - BitBucket module](https://atlassian-python-api.readthedocs.io/bitbucket.html)
18
+
19
+ ### 2. Method Mapping
20
+
21
+ Our client wrapper maps directly to SDK methods:
22
+
23
+ | SDK Method | Our Wrapper | Documentation Reference | |------------|-------------|-------------------------| |
24
+ `create_repo()` | `create_repository()` |
25
+ [Create repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#create-a-new-repository) | | `get_repo()`
26
+ | `get_repository()` |
27
+ [Get repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#get-single-repository) | | `update_repo()` |
28
+ `update_repository()` |
29
+ [Update repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#update-single-repository) | |
30
+ `fork_repository()` | `fork_repository()` |
31
+ [Fork repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#fork-repo-inside-same-project) | |
32
+ `fork_repository_new_project()` | `fork_repository()` |
33
+ [Fork to new project](https://atlassian-python-api.readthedocs.io/bitbucket.html#fork-repo-to-new-project) | |
34
+ `get_repo_labels()` | `get_repository_labels()` |
35
+ [Get labels](https://atlassian-python-api.readthedocs.io/bitbucket.html#get-labels-for-a-single-repository) | |
36
+ `set_repo_label()` | `set_repository_label()` |
37
+ [Set label](https://atlassian-python-api.readthedocs.io/bitbucket.html#set-label-for-a-single-repository) |
38
+
39
+ ### 3. Repository Management
40
+
41
+ #### Create Repository
42
+
43
+ ```python
44
+ # SDK method (from documentation)
45
+ bitbucket.create_repo(project_key, repository, forkable=False, is_private=True)
46
+
47
+ # Our implementation
48
+ client.create_repository(
49
+ project_key="INSURANCE",
50
+ repository="vds-ai-memory",
51
+ forkable=False,
52
+ is_private=True
53
+ )
54
+ ```
55
+
56
+ **Reference**: [Create repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#create-a-new-repository)
57
+
58
+ #### Get Repository
59
+
60
+ ```python
61
+ # SDK method
62
+ bitbucket.get_repo(project_key, repository_slug)
63
+
64
+ # Our implementation
65
+ client.get_repository(project_key="INSURANCE", repository_slug="vds-ai-memory")
66
+ ```
67
+
68
+ **Reference**: [Get repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#get-single-repository)
69
+
70
+ #### Update Repository
71
+
72
+ ```python
73
+ # SDK method
74
+ bitbucket.update_repo(project_key, repository_slug, description="Repo description")
75
+
76
+ # Our implementation
77
+ client.update_repository(
78
+ project_key="INSURANCE",
79
+ repository_slug="vds-ai-memory",
80
+ description="Updated description"
81
+ )
82
+ ```
83
+
84
+ **Reference**: [Update repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#update-single-repository)
85
+
86
+ #### Delete Repository
87
+
88
+ ```python
89
+ # SDK method (DANGER!)
90
+ bitbucket.delete_repo(project_key, repository_slug)
91
+
92
+ # Our implementation
93
+ client.delete_repository(
94
+ project_key="INSURANCE",
95
+ repository_slug="vds-ai-memory"
96
+ )
97
+ ```
98
+
99
+ **⚠️ Warning**: This operation is irreversible. Use with extreme caution.
100
+
101
+ **Reference**:
102
+ [Delete repository](https://atlassian-python-api.readthedocs.io/bitbucket.html#delete-a-repository-danger)
103
+
104
+ #### Fork Repository
105
+
106
+ ```python
107
+ # SDK method - Fork within same project
108
+ bitbucket.fork_repository(project_key, repository_slug, new_repository_slug)
109
+
110
+ # SDK method - Fork to new project
111
+ bitbucket.fork_repository_new_project(
112
+ project_key, repository_slug, new_project_key, new_repository_slug
113
+ )
114
+
115
+ # Our implementation (handles both cases)
116
+ client.fork_repository(
117
+ project_key="INSURANCE",
118
+ repository_slug="vds-ai-memory",
119
+ new_project_key="LEP", # Optional - if None, forks within same project
120
+ new_repository_slug="vds-ai-memory-fork"
121
+ )
122
+ ```
123
+
124
+ **Reference**:
125
+
126
+ - [Fork within same project](https://atlassian-python-api.readthedocs.io/bitbucket.html#fork-repo-inside-same-project)
127
+ - [Fork to new project](https://atlassian-python-api.readthedocs.io/bitbucket.html#fork-repo-to-new-project)
128
+
129
+ ### 4. Project Management
130
+
131
+ #### List Projects
132
+
133
+ ```python
134
+ # SDK method
135
+ bitbucket.project_list()
136
+
137
+ # Our implementation
138
+ client.list_projects(limit=50)
139
+ ```
140
+
141
+ **Reference**: [Project list](https://atlassian-python-api.readthedocs.io/bitbucket.html#project-list)
142
+
143
+ #### Create Project
144
+
145
+ ```python
146
+ # SDK method
147
+ bitbucket.create_project(key, name, description="My pretty project")
148
+
149
+ # Our implementation
150
+ client.create_project(
151
+ key="INSURANCE",
152
+ name="Insurance Platform",
153
+ description="Digital Insurance Platform"
154
+ )
155
+ ```
156
+
157
+ **Reference**: [Create project](https://atlassian-python-api.readthedocs.io/bitbucket.html#create-project)
158
+
159
+ ### 5. Pull Request Management
160
+
161
+ #### List Pull Requests
162
+
163
+ ```python
164
+ # SDK method
165
+ bitbucket.get_pull_requests(project, repository, state='OPEN', order='newest', limit=100)
166
+
167
+ # Our implementation
168
+ client.list_pull_requests(
169
+ project_key="INSURANCE",
170
+ repository_slug="vds-ai-memory",
171
+ state="OPEN",
172
+ order="newest",
173
+ limit=100
174
+ )
175
+ ```
176
+
177
+ **Reference**: [Get pull requests](https://atlassian-python-api.readthedocs.io/bitbucket.html#get-pull-requests)
178
+
179
+ #### Create Pull Request
180
+
181
+ ```python
182
+ # SDK method
183
+ bitbucket.open_pull_request(
184
+ source_project, source_repo, dest_project, dest_repo,
185
+ source_branch, destination_branch, title, description
186
+ )
187
+
188
+ # Our implementation
189
+ client.create_pull_request(
190
+ source_project="INSURANCE",
191
+ source_repo="vds-ai-memory",
192
+ dest_project="INSURANCE",
193
+ dest_repo="vds-ai-memory",
194
+ source_branch="feature/new-feature",
195
+ destination_branch="main",
196
+ title="Add new feature",
197
+ description="Description of changes"
198
+ )
199
+ ```
200
+
201
+ **Reference**:
202
+ [Create pull request](https://atlassian-python-api.readthedocs.io/bitbucket.html#create-a-new-pull-request-between-two-branches)
203
+
204
+ ### 6. Permission Management
205
+
206
+ #### Grant Repository Permissions
207
+
208
+ ```python
209
+ # SDK method - User permissions
210
+ bitbucket.repo_grant_user_permissions(project_key, repo_key, username, permission)
211
+
212
+ # SDK method - Group permissions
213
+ bitbucket.repo_grant_group_permissions(project_key, repo_key, groupname, permission)
214
+
215
+ # Our implementation
216
+ client.grant_user_repository_permissions(
217
+ project_key="INSURANCE",
218
+ repository_slug="vds-ai-memory",
219
+ username="developer",
220
+ permission="REPO_WRITE"
221
+ )
222
+
223
+ client.grant_group_repository_permissions(
224
+ project_key="INSURANCE",
225
+ repository_slug="vds-ai-memory",
226
+ group_name="developers",
227
+ permission="REPO_READ"
228
+ )
229
+ ```
230
+
231
+ **Reference**:
232
+
233
+ - [Grant user permissions](https://atlassian-python-api.readthedocs.io/bitbucket.html#grant-repository-permission-to-an-specific-user)
234
+ - [Grant group permissions](https://atlassian-python-api.readthedocs.io/bitbucket.html#grant-repository-permission-to-an-specific-group)
235
+
236
+ ### 7. Code Operations
237
+
238
+ #### Get Commits
239
+
240
+ ```python
241
+ # SDK method
242
+ bitbucket.get_commits(project, repository, hash_oldest, hash_newest, limit=99999)
243
+
244
+ # Our implementation
245
+ client.get_commits(
246
+ project_key="INSURANCE",
247
+ repository_slug="vds-ai-memory",
248
+ from_hash="abc123",
249
+ to_hash="def456",
250
+ limit=50
251
+ )
252
+ ```
253
+
254
+ **Reference**: [Get commit list](https://atlassian-python-api.readthedocs.io/bitbucket.html#get-commit-list-from-repo)
255
+
256
+ #### Get Diff
257
+
258
+ ```python
259
+ # SDK method
260
+ bitbucket.get_diff(project, repository, path, hash_oldest, hash_newest)
261
+
262
+ # Our implementation
263
+ client.get_diff(
264
+ project_key="INSURANCE",
265
+ repository_slug="vds-ai-memory",
266
+ file_path="app/main.py",
267
+ from_hash="abc123",
268
+ to_hash="def456"
269
+ )
270
+ ```
271
+
272
+ **Reference**: [Get diff](https://atlassian-python-api.readthedocs.io/bitbucket.html#get-diff)
273
+
274
+ ### 8. Error Handling
275
+
276
+ Our implementation wraps SDK methods with comprehensive error handling:
277
+
278
+ ```python
279
+ def create_repository(self, project_key: str, repository: str, ...):
280
+ """Create a new repository."""
281
+ try:
282
+ result = self._client.create_repo(project_key, repository, ...)
283
+ self._log.info("repository_created", ...)
284
+ return result
285
+ except Exception as exc:
286
+ self._handle_api_error(exc, f"create_repository {repository}")
287
+ ```
288
+
289
+ **Benefits**:
290
+
291
+ - ✅ Consistent error types across all operations
292
+ - ✅ Structured logging for debugging
293
+ - ✅ Context preservation in error messages
294
+ - ✅ Automatic retry for transient errors
295
+
296
+ ### 9. Cloud vs Server/DC Mode
297
+
298
+ The SDK automatically handles differences between Bitbucket Cloud and Server/DC:
299
+
300
+ ```python
301
+ # Our implementation detects mode automatically
302
+ if settings.is_cloud_mode:
303
+ self._client = AtlassianBitbucket(
304
+ url=url, timeout=self._timeout, cloud=True,
305
+ workspace=settings.cloud_workspace, **auth_kwargs
306
+ )
307
+ else:
308
+ self._client = AtlassianBitbucket(
309
+ url=url, timeout=self._timeout, **auth_kwargs
310
+ )
311
+ ```
312
+
313
+ **Reference**: The SDK handles mode differences automatically based on URL and configuration.
314
+
315
+ ### 10. Retry Logic
316
+
317
+ We implement exponential backoff for transient errors:
318
+
319
+ ```python
320
+ @retry_with_backoff(max_retries=3, backoff_factor=1.0)
321
+ def create_repository(self, ...):
322
+ # Automatically retries on transport/rate limit errors
323
+ ...
324
+ ```
325
+
326
+ **Benefits**:
327
+
328
+ - ✅ Handles rate limiting gracefully
329
+ - ✅ Retries transient network errors
330
+ - ✅ Prevents unnecessary failures
331
+
332
+ ## CLI Usage Examples
333
+
334
+ ### Create Repository
335
+
336
+ ```bash
337
+ # Using VDS CLI
338
+ uv run --project vds_cli vds-cli bitbucket repositories INSURANCE
339
+
340
+ # Or using orchestrator directly
341
+ cd vds-scripts/bitbucket_orchestrator
342
+ uv run --project bitbucket_orchestrator python -m vds_bitbucket_orchestrator.cli repositories INSURANCE
343
+ ```
344
+
345
+ ### Create Repository via Python
346
+
347
+ ```python
348
+ from vds_bitbucket_orchestrator.client import BitbucketClient
349
+ from vds_bitbucket_orchestrator.config import load_settings
350
+
351
+ settings = load_settings(strict=True)
352
+ client = BitbucketClient(settings)
353
+
354
+ # Create repository (as we did for vds-ai-memory)
355
+ result = client.create_repository(
356
+ project_key="INSURANCE",
357
+ repository="vds-ai-memory",
358
+ forkable=False,
359
+ is_private=True
360
+ )
361
+ ```
362
+
363
+ ## Best Practices
364
+
365
+ 1. **Always use the SDK methods**: Never make direct HTTP calls
366
+ 1. **Use our wrapper**: Provides consistent error handling and logging
367
+ 1. **Handle errors properly**: Use try/except with our error types
368
+ 1. **Log operations**: All operations are automatically logged
369
+ 1. **Respect rate limits**: Retry logic handles this automatically
370
+ 1. **Check mode**: Cloud vs Server/DC differences are handled automatically
371
+
372
+ ## Verification
373
+
374
+ To verify our implementation matches the SDK:
375
+
376
+ ```bash
377
+ # Check available SDK methods
378
+ cd vds-scripts/bitbucket_orchestrator
379
+ uv run --project bitbucket_orchestrator python -c "
380
+ from atlassian import Bitbucket
381
+ import inspect
382
+ methods = [m for m in dir(Bitbucket) if 'repo' in m.lower() and not m.startswith('_')]
383
+ print('\n'.join(sorted(methods)))
384
+ "
385
+ ```
386
+
387
+ ## References
388
+
389
+ - **Official Documentation**:
390
+ [Atlassian Python API - BitBucket module](https://atlassian-python-api.readthedocs.io/bitbucket.html)
391
+ - **VDS Orchestrator**: `vds-scripts/bitbucket_orchestrator/`
392
+ - **CLI Usage**: `vds-scripts/bitbucket_orchestrator/README.md`
393
+ - **Repository**: `http://bitbucket.digital.vn/scm/insurance/vds-scripts.git`