systemlink-cli 3.0.0__tar.gz → 3.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/PKG-INFO +1 -1
  2. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/pyproject.toml +1 -1
  3. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/_version.py +1 -1
  4. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migrate_click.py +18 -9
  5. systemlink_cli-3.0.2/slcli/migration/command.py +189 -0
  6. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/flows/discover.py +10 -2
  7. systemlink_cli-3.0.2/slcli/migration/flows/migrate.py +53 -0
  8. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/orchestration.py +38 -14
  9. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/schema.py +1 -1
  10. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/state.py +3 -0
  11. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/client.py +1 -1
  12. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/discovery.py +7 -3
  13. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/discovery_task.py +8 -11
  14. systemlink_cli-3.0.2/slcli/migration/workspace_task.py +65 -0
  15. systemlink_cli-3.0.2/slcli/migration/workspaces.py +114 -0
  16. systemlink_cli-3.0.0/slcli/migration/command.py +0 -140
  17. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/LICENSE +0 -0
  18. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/dff-editor/editor.js +0 -0
  19. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/dff-editor/index.html +0 -0
  20. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/__init__.py +0 -0
  21. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/__main__.py +0 -0
  22. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/alarm_click.py +0 -0
  23. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/asset_click.py +0 -0
  24. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/cli_formatters.py +0 -0
  25. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/cli_utils.py +0 -0
  26. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/comment_click.py +0 -0
  27. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/completion_click.py +0 -0
  28. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/config.py +0 -0
  29. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/config_click.py +0 -0
  30. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/credentials.py +0 -0
  31. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/dataframe_click.py +0 -0
  32. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/dff_click.py +0 -0
  33. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/dff_decorators.py +0 -0
  34. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/example_click.py +0 -0
  35. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/example_loader.py +0 -0
  36. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/example_provisioner.py +0 -0
  37. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/README.md +0 -0
  38. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/_schema/schema-v1.0.json +0 -0
  39. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-1/README.md +0 -0
  40. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-1/config.yaml +0 -0
  41. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-2/README.md +0 -0
  42. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-2/config.yaml +0 -0
  43. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/config.yaml +0 -0
  44. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/leakage-current-results.json +0 -0
  45. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/overvoltage-results.json +0 -0
  46. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/product-xyz-compliance-report.json +0 -0
  47. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/product-xyz-specification.csv +0 -0
  48. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/thermal-response-results.json +0 -0
  49. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-5-1-parametric-insights/README.md +0 -0
  50. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-5-1-parametric-insights/config.yaml +0 -0
  51. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-7-1-test-plans/README.md +0 -0
  52. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-7-1-test-plans/config.yaml +0 -0
  53. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/README.md +0 -0
  54. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/config.yaml +0 -0
  55. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +0 -0
  56. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +0 -0
  57. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +0 -0
  58. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
  59. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/feed_click.py +0 -0
  60. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/file_click.py +0 -0
  61. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/function_click.py +0 -0
  62. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/function_templates.py +0 -0
  63. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/main.py +0 -0
  64. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/__init__.py +0 -0
  65. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/crypto.py +0 -0
  66. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/handlers.py +0 -0
  67. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/minion.py +0 -0
  68. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/models.py +0 -0
  69. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/protocol.py +0 -0
  70. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/rest.py +0 -0
  71. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/state.py +0 -0
  72. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/transport.py +0 -0
  73. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client_click.py +0 -0
  74. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_click.py +0 -0
  75. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_reachability.py +0 -0
  76. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_server.py +0 -0
  77. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_skills.py +0 -0
  78. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/__init__.py +0 -0
  79. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/api.py +0 -0
  80. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/connection.py +0 -0
  81. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/flows/__init__.py +0 -0
  82. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/prefect_server.py +0 -0
  83. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/__init__.py +0 -0
  84. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/models.py +0 -0
  85. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/workspace_client.py +0 -0
  86. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/notebook_click.py +0 -0
  87. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/paths.py +0 -0
  88. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/pkce.py +0 -0
  89. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/platform.py +0 -0
  90. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/policy_click.py +0 -0
  91. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/policy_utils.py +0 -0
  92. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/profile_credentials.py +0 -0
  93. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/profiles.py +0 -0
  94. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/response_handlers.py +0 -0
  95. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/rich_output.py +0 -0
  96. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/routine_click.py +0 -0
  97. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skill_click.py +0 -0
  98. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/SKILL.md +0 -0
  99. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/COPILOT_BATCH_RUN_PROMPT.md +0 -0
  100. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/README.md +0 -0
  101. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/evals.json +0 -0
  102. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/evals.schema.json +0 -0
  103. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/spec-import/battery-specs.csv +0 -0
  104. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/webapp-package/icon.svg +0 -0
  105. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/webapp-package/nipkg.config.json +0 -0
  106. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/webapp-package/webapp-content/index.html +0 -0
  107. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/trigger_evals.json +0 -0
  108. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/analysis-recipes.md +0 -0
  109. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/commands.md +0 -0
  110. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/datasheet-workflow.md +0 -0
  111. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/domain-concepts.md +0 -0
  112. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/example-authoring.md +0 -0
  113. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/filtering.md +0 -0
  114. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/import-specs.min.json +0 -0
  115. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/job-debugging/overview.md +0 -0
  116. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/nipkg/overview.md +0 -0
  117. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/notebook/interfaces.md +0 -0
  118. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/notebook/notebook-patterns.md +0 -0
  119. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/notebook/overview.md +0 -0
  120. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/python-test/overview.md +0 -0
  121. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/routine-examples.md +0 -0
  122. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/troubleshooting.md +0 -0
  123. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/angular-ui-packages.md +0 -0
  124. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/deployment.md +0 -0
  125. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/layout-patterns.md +0 -0
  126. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/nimble-angular.md +0 -0
  127. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/overview.md +0 -0
  128. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/systemlink-services.md +0 -0
  129. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/troubleshooting.md +0 -0
  130. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/benchmark_iteration.py +0 -0
  131. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/compare_iteration.py +0 -0
  132. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/eval_manifest.py +0 -0
  133. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/grade_eval_response.py +0 -0
  134. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/grade_iteration.py +0 -0
  135. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/prepare_eval_prompts.py +0 -0
  136. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/prepare_eval_workspace.py +0 -0
  137. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/render_eval_review.py +0 -0
  138. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/spec_import_helper.py +0 -0
  139. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/spec_click.py +0 -0
  140. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/ssl_trust.py +0 -0
  141. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/state_click.py +0 -0
  142. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/system_click.py +0 -0
  143. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/system_query_utils.py +0 -0
  144. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/systemlink-logo.svg +0 -0
  145. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/table_utils.py +0 -0
  146. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/tag_click.py +0 -0
  147. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/templates_click.py +0 -0
  148. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/testmonitor_click.py +0 -0
  149. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/universal_handlers.py +0 -0
  150. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/user_click.py +0 -0
  151. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/utils.py +0 -0
  152. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/version_click.py +0 -0
  153. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/web_editor.py +0 -0
  154. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_bootstrap.py +0 -0
  155. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_click.py +0 -0
  156. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/.gitignore +0 -0
  157. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/README.md +0 -0
  158. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/angular.json +0 -0
  159. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/package.json +0 -0
  160. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/scripts/filter-sbom.js +0 -0
  161. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app-routing.module.ts +0 -0
  162. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.component.html +0 -0
  163. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.component.scss +0 -0
  164. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.component.ts +0 -0
  165. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.module.ts +0 -0
  166. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.html +0 -0
  167. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.scss +0 -0
  168. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.ts +0 -0
  169. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/state/app-view-state.service.ts +0 -0
  170. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-context.service.ts +0 -0
  171. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-locale.ts +0 -0
  172. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/theme-sync.service.ts +0 -0
  173. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/webapp-home-data.service.ts +0 -0
  174. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.html +0 -0
  175. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.scss +0 -0
  176. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.ts +0 -0
  177. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.html +0 -0
  178. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.scss +0 -0
  179. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.ts +0 -0
  180. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.html +0 -0
  181. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.scss +0 -0
  182. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.ts +0 -0
  183. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.html +0 -0
  184. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.scss +0 -0
  185. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.ts +0 -0
  186. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.html +0 -0
  187. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.scss +0 -0
  188. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.ts +0 -0
  189. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.html +0 -0
  190. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.scss +0 -0
  191. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.ts +0 -0
  192. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.html +0 -0
  193. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.scss +0 -0
  194. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.ts +0 -0
  195. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.html +0 -0
  196. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.scss +0 -0
  197. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.ts +0 -0
  198. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.html +0 -0
  199. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.scss +0 -0
  200. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.ts +0 -0
  201. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/shared/states/view-state.model.ts +0 -0
  202. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/assets/README.md +0 -0
  203. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/index.html +0 -0
  204. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.de.json +0 -0
  205. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.en.json +0 -0
  206. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.es.json +0 -0
  207. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.fr.json +0 -0
  208. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.ja.json +0 -0
  209. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.ko.json +0 -0
  210. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.zh.json +0 -0
  211. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/localize.d.ts +0 -0
  212. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/main.ts +0 -0
  213. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/styles.scss +0 -0
  214. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/tsconfig.app.json +0 -0
  215. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/tsconfig.json +0 -0
  216. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workflow_preview.py +0 -0
  217. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workflows_click.py +0 -0
  218. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workitem_click.py +0 -0
  219. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workspace_click.py +0 -0
  220. {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workspace_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: systemlink-cli
3
- Version: 3.0.0
3
+ Version: 3.0.2
4
4
  Summary: SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates.
5
5
  License-File: LICENSE
6
6
  Author: Fred Visser
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "systemlink-cli"
3
- version = "3.0.0"
3
+ version = "3.0.2"
4
4
  description = "SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates."
5
5
  authors = ["Fred Visser <fred.visser@emerson.com>"]
6
6
  packages = [{ include = "slcli" }]
@@ -1,4 +1,4 @@
1
1
  """Version information for slcli."""
2
2
 
3
3
  # This file is auto-generated. Do not edit manually.
4
- __version__ = "3.0.0"
4
+ __version__ = "3.0.2"
@@ -86,13 +86,18 @@ def register_migrate_command(cli: click.Group) -> None:
86
86
 
87
87
  @cli.command(name="migrate", hidden=not migration_extra_installed())
88
88
  @click.option("--source-profile", help="Named source SystemLink profile for a new migration.")
89
+ @click.option(
90
+ "--destination-profile",
91
+ help="Named destination SystemLink profile for a new migration.",
92
+ )
89
93
  @click.option(
90
94
  "--workspace-mappings",
91
95
  callback=_parse_workspace_mappings,
92
96
  help=(
93
97
  "Comma-delimited SOURCE or SOURCE:DESTINATION workspace mappings. "
94
98
  "Escape ',' or ':' in a workspace name with a backslash, for example Lab\\:A:Dest. "
95
- "Only the listed source workspaces are migrated; all when omitted."
99
+ "Only the listed source workspaces are migrated; all when omitted. "
100
+ "Destination workspaces must already exist."
96
101
  ),
97
102
  )
98
103
  @click.option("--migration-id", help="Repeat discovery for an existing migration.")
@@ -103,20 +108,22 @@ def register_migrate_command(cli: click.Group) -> None:
103
108
  )
104
109
  def migrate(
105
110
  source_profile: Optional[str],
111
+ destination_profile: Optional[str],
106
112
  workspace_mappings: Optional[Dict[str, str]],
107
113
  migration_id: Optional[str],
108
114
  prefect_api_url: Optional[str],
109
115
  ) -> None:
110
116
  """Discover and migrate resources from a SystemLink Server."""
111
- if migration_id is not None and (
112
- source_profile is not None or workspace_mappings is not None
113
- ):
117
+ new_run_options = (source_profile, destination_profile, workspace_mappings)
118
+ if migration_id is not None and any(value is not None for value in new_run_options):
114
119
  raise click.UsageError(
115
- "--migration-id cannot be combined with --source-profile or --workspace-mappings"
120
+ "--migration-id cannot be combined with --source-profile, "
121
+ "--destination-profile, or --workspace-mappings"
116
122
  )
117
- if migration_id is None and source_profile is None:
123
+ if migration_id is None and (source_profile is None or destination_profile is None):
118
124
  raise click.UsageError(
119
- "Provide --source-profile for a new migration or --migration-id for an existing one"
125
+ "Provide --source-profile and --destination-profile for a new migration "
126
+ "or --migration-id for an existing one"
120
127
  )
121
128
 
122
129
  try:
@@ -131,5 +138,7 @@ def register_migrate_command(cli: click.Group) -> None:
131
138
 
132
139
  if migration_id is not None:
133
140
  command.resume_migration(migration_id, prefect_api_url)
134
- elif source_profile is not None:
135
- command.start_migration(source_profile, workspace_mappings, prefect_api_url)
141
+ elif source_profile is not None and destination_profile is not None:
142
+ command.start_migration(
143
+ source_profile, destination_profile, workspace_mappings, prefect_api_url
144
+ )
@@ -0,0 +1,189 @@
1
+ """Compose a migration run for the ``migrate`` command."""
2
+
3
+ import logging
4
+ from collections.abc import Generator
5
+ from contextlib import contextmanager
6
+ from pathlib import Path
7
+ from typing import Dict, Optional
8
+ from urllib.parse import urlparse
9
+
10
+ import click
11
+ import requests
12
+
13
+ from slcli._version import __version__
14
+ from slcli.migration.connection import MigrationConnection, resolve_migration_connection
15
+ from slcli.migration.orchestration import prefect_server, run_migration
16
+ from slcli.migration.state import (
17
+ MigrationRun,
18
+ RunMetadata,
19
+ create_migration_run,
20
+ open_migration_run,
21
+ )
22
+ from slcli.migration.testmonitor.models import TestMonitorDiscovery
23
+ from slcli.migration.workspaces import WorkspaceMapping, WorkspaceMappingError
24
+ from slcli.utils import handle_api_error
25
+
26
+ _logger = logging.getLogger("slcli.migration")
27
+ MIGRATION_LOG = "migration.log"
28
+
29
+
30
+ def start_migration(
31
+ source_profile: str,
32
+ destination_profile: str,
33
+ workspace_mappings: Optional[Dict[str, str]],
34
+ prefect_api_url: Optional[str],
35
+ ) -> None:
36
+ """Create a new migration run, then discover resources and synchronize workspaces."""
37
+ source = resolve_migration_connection(source_profile)
38
+ destination = resolve_migration_connection(destination_profile)
39
+ _echo_connections(source, destination)
40
+ run = create_migration_run(source_profile, destination_profile, workspace_mappings)
41
+ _, metadata = open_migration_run(run.migration_id, run.directory.parent)
42
+ _migrate(run, metadata, source, destination, prefect_api_url)
43
+
44
+
45
+ def resume_migration(migration_id: str, prefect_api_url: Optional[str]) -> None:
46
+ """Resume migration run with the original inputs and cached state."""
47
+ try:
48
+ run, metadata = open_migration_run(migration_id)
49
+ except ValueError as exc:
50
+ raise click.ClickException(str(exc)) from exc
51
+ source = resolve_migration_connection(metadata.source_profile)
52
+ destination = resolve_migration_connection(metadata.destination_profile)
53
+ _echo_connections(source, destination)
54
+ _migrate(run, metadata, source, destination, prefect_api_url)
55
+
56
+
57
+ def format_summary(discovery: TestMonitorDiscovery) -> str:
58
+ """Return deterministic Test Monitor discovery counts and failures."""
59
+ lines = [
60
+ "Test Monitor discovery:",
61
+ f" Products: {len(discovery.products)}",
62
+ f" Terminal results: {len(discovery.results)}",
63
+ f" Failed workspaces: {len(discovery.failures)}",
64
+ *(f" {failure.workspace}: {failure.error_type}" for failure in discovery.failures),
65
+ ]
66
+ if discovery.failures:
67
+ lines.append(" Product workspaces were inferred without the failed workspaces.")
68
+ return "\n".join(lines)
69
+
70
+
71
+ def _all_workspaces_failed(discovery: TestMonitorDiscovery) -> bool:
72
+ return bool(discovery.workspaces) and len(discovery.failures) == len(discovery.workspaces)
73
+
74
+
75
+ def format_workspace_mapping(mapping: WorkspaceMapping) -> str:
76
+ """Return each source workspace and the destination workspace it migrates to."""
77
+ return "\n".join(
78
+ [
79
+ "Workspace mapping:",
80
+ *(
81
+ f" {workspace.source_name} -> {workspace.destination_name}"
82
+ for workspace in mapping.workspaces
83
+ ),
84
+ ]
85
+ )
86
+
87
+
88
+ def _echo_connections(source: MigrationConnection, destination: MigrationConnection) -> None:
89
+ for role, connection in (("Source", source), ("Destination", destination)):
90
+ click.echo(f"{role}: {connection.profile_name} ({connection.base_url})")
91
+ if urlparse(connection.base_url).scheme.lower() != "https":
92
+ click.echo(f"Warning: {role.lower()} connection does not use HTTPS.", err=True)
93
+ if connection.ssl_verify is False:
94
+ click.echo(
95
+ f"Warning: {role.lower()} TLS certificate verification is disabled.", err=True
96
+ )
97
+
98
+
99
+ def _mapping_error(
100
+ exc: WorkspaceMappingError, workspace_mappings: Optional[Dict[str, str]]
101
+ ) -> click.ClickException:
102
+ # TODO(AB#4088608): Synchronize workspaces will create missing destination workspaces.
103
+ hint = (
104
+ "Destination workspaces are not created by migration."
105
+ if workspace_mappings is not None
106
+ else "Create the destination workspaces or select workspaces with "
107
+ "--workspace-mappings. Destination workspaces are not created by migration."
108
+ )
109
+ return click.ClickException(f"{exc}. {hint}")
110
+
111
+
112
+ @contextmanager
113
+ def _run_log(log_path: Path) -> Generator[None, None, None]:
114
+ """Write migration logs to the run directory for the duration of the run."""
115
+ handler = logging.FileHandler(log_path, encoding="utf-8")
116
+ handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(name)s %(message)s"))
117
+ previous_level = _logger.level
118
+ _logger.addHandler(handler)
119
+ _logger.setLevel(logging.INFO)
120
+ try:
121
+ yield
122
+ finally:
123
+ _logger.removeHandler(handler)
124
+ _logger.setLevel(previous_level)
125
+ handler.close()
126
+
127
+
128
+ def _migrate(
129
+ run: MigrationRun,
130
+ metadata: RunMetadata,
131
+ source: MigrationConnection,
132
+ destination: MigrationConnection,
133
+ prefect_api_url: Optional[str],
134
+ ) -> None:
135
+ click.echo(f"Migration ID: {run.migration_id}")
136
+ log_path = run.directory / MIGRATION_LOG
137
+ workspace_mappings = metadata.workspace_mappings
138
+ workspaces = list(workspace_mappings) if workspace_mappings is not None else None
139
+ server_mode = "managed" if prefect_api_url is None else "external"
140
+ with _run_log(log_path):
141
+ _logger.info(
142
+ "Migration started: migration=%s cli=%s profile=%s endpoint=%s workspaces=%s "
143
+ "destination_profile=%s destination_endpoint=%s prefect_server=%s",
144
+ run.migration_id,
145
+ __version__,
146
+ source.profile_name,
147
+ source.base_url,
148
+ workspaces if workspaces is not None else "all",
149
+ destination.profile_name,
150
+ destination.base_url,
151
+ server_mode,
152
+ )
153
+ try:
154
+ with prefect_server(run, prefect_api_url) as api_url:
155
+ outcome = run_migration(run, metadata, api_url)
156
+ except WorkspaceMappingError as exc:
157
+ _log_failure(exc, log_path)
158
+ raise _mapping_error(exc, workspace_mappings) from exc
159
+ except requests.RequestException as exc:
160
+ _log_failure(exc, log_path)
161
+ handle_api_error(exc)
162
+ raise
163
+ except BaseException as exc:
164
+ _log_failure(exc, log_path)
165
+ raise
166
+ _logger.info(
167
+ "Workspace mapping: %s",
168
+ [
169
+ f"{w.source_name}({w.source_id}) -> {w.destination_name}({w.destination_id})"
170
+ for w in outcome.mapping.workspaces
171
+ ],
172
+ )
173
+ test_monitor = outcome.discovery.test_monitor
174
+ _logger.info(
175
+ "Discovery completed: products=%d results=%d failed_workspaces=%s",
176
+ len(test_monitor.products),
177
+ len(test_monitor.results),
178
+ [failure.workspace for failure in test_monitor.failures],
179
+ )
180
+ click.echo(format_workspace_mapping(outcome.mapping))
181
+ click.echo(format_summary(test_monitor))
182
+ click.echo(f"Log: {log_path}")
183
+ if _all_workspaces_failed(test_monitor):
184
+ raise click.ClickException("Discovery failed for every workspace.")
185
+
186
+
187
+ def _log_failure(exc: BaseException, log_path: Path) -> None:
188
+ _logger.error("Migration failed: %s: %s", type(exc).__name__, exc)
189
+ click.echo(f"Log: {log_path}", err=True)
@@ -8,6 +8,8 @@ from pydantic import ConfigDict
8
8
  from slcli.migration.schema import VersionedModel
9
9
  from slcli.migration.testmonitor.discovery_task import discover_test_monitor_task
10
10
  from slcli.migration.testmonitor.models import TestMonitorDiscovery
11
+ from slcli.migration.workspace_task import discover_workspaces_task
12
+ from slcli.migration.workspaces import DiscoveredWorkspaces
11
13
 
12
14
 
13
15
  class MigrationDiscovery(VersionedModel):
@@ -15,6 +17,7 @@ class MigrationDiscovery(VersionedModel):
15
17
 
16
18
  model_config = ConfigDict(frozen=True)
17
19
 
20
+ workspaces: DiscoveredWorkspaces
18
21
  test_monitor: TestMonitorDiscovery
19
22
 
20
23
 
@@ -29,13 +32,18 @@ def discover_flow(
29
32
  source_profile: str,
30
33
  workspaces: Optional[List[str]],
31
34
  ) -> MigrationDiscovery:
32
- """Run one persisted discovery task per supported resource type.
35
+ """Discover source workspaces, then each supported resource type within them.
33
36
 
34
37
  Args:
35
38
  migration_id: Migration that scopes task cache keys.
36
39
  source_profile: Name of the source profile.
37
40
  workspaces: Source workspace names to discover; all workspaces when None.
41
+
42
+ Raises:
43
+ WorkspaceMappingError: If a requested workspace does not exist on the source.
38
44
  """
45
+ discovered = discover_workspaces_task(migration_id, source_profile, workspaces)
39
46
  return MigrationDiscovery(
40
- test_monitor=discover_test_monitor_task(migration_id, source_profile, workspaces)
47
+ workspaces=discovered,
48
+ test_monitor=discover_test_monitor_task(migration_id, source_profile, discovered),
41
49
  )
@@ -0,0 +1,53 @@
1
+ """Migration flow: discover, then synchronize workspaces."""
2
+
3
+ from typing import Dict, List, Optional
4
+
5
+ from prefect import flow
6
+ from pydantic import ConfigDict
7
+
8
+ from slcli.migration.flows.discover import MigrationDiscovery, discover_flow
9
+ from slcli.migration.schema import VersionedModel
10
+ from slcli.migration.workspace_task import synchronize_workspaces_task
11
+ from slcli.migration.workspaces import WorkspaceMapping
12
+
13
+
14
+ class MigrationOutcome(VersionedModel):
15
+ """Discovery and workspace mapping of one run."""
16
+
17
+ model_config = ConfigDict(frozen=True)
18
+
19
+ discovery: MigrationDiscovery
20
+ mapping: WorkspaceMapping
21
+
22
+
23
+ @flow(
24
+ name="systemlink-migration",
25
+ flow_run_name="migration-{migration_id}",
26
+ persist_result=True,
27
+ result_serializer="json",
28
+ )
29
+ def migrate_flow(
30
+ migration_id: str,
31
+ source_profile: str,
32
+ destination_profile: str,
33
+ workspace_mappings: Optional[Dict[str, str]],
34
+ ) -> MigrationOutcome:
35
+ """Discover source resources, then synchronize workspaces to the destination.
36
+
37
+ Args:
38
+ migration_id: Migration that scopes task cache keys.
39
+ source_profile: Name of the source profile.
40
+ destination_profile: Name of the destination profile.
41
+ workspace_mappings: Source to destination workspace names; all by name when None.
42
+
43
+ Raises:
44
+ WorkspaceMappingError: If a source or destination workspace does not exist.
45
+ """
46
+ workspaces: Optional[List[str]] = (
47
+ list(workspace_mappings) if workspace_mappings is not None else None
48
+ )
49
+ discovery = discover_flow(migration_id, source_profile, workspaces)
50
+ mapping = synchronize_workspaces_task(
51
+ migration_id, destination_profile, discovery.workspaces, workspace_mappings
52
+ )
53
+ return MigrationOutcome(discovery=discovery, mapping=mapping)
@@ -13,8 +13,9 @@ from prefect.settings import (
13
13
  )
14
14
 
15
15
  from slcli.migration.flows.discover import MigrationDiscovery, discover_flow
16
+ from slcli.migration.flows.migrate import MigrationOutcome, migrate_flow
16
17
  from slcli.migration.prefect_server import ManagedPrefectServer
17
- from slcli.migration.state import MigrationRun
18
+ from slcli.migration.state import MigrationRun, RunMetadata
18
19
 
19
20
 
20
21
  @contextmanager
@@ -33,6 +34,23 @@ def prefect_server(run: MigrationRun, api_url: Optional[str] = None) -> Generato
33
34
  yield managed_api_url
34
35
 
35
36
 
37
+ @contextmanager
38
+ def _run_settings(run: MigrationRun, api_url: str) -> Generator[None, None, None]:
39
+ with temporary_settings(
40
+ updates={
41
+ PREFECT_HOME: run.client_home,
42
+ PREFECT_API_URL: api_url,
43
+ PREFECT_LOGGING_TO_API_ENABLED: False,
44
+ "results.local_storage_path": run.results_path,
45
+ }
46
+ ):
47
+ try:
48
+ yield
49
+ finally:
50
+ # Deliver queued task-state events before the server may be stopped.
51
+ EventsWorker.drain_all()
52
+
53
+
36
54
  def run_discovery(
37
55
  run: MigrationRun,
38
56
  source_profile: str,
@@ -47,16 +65,22 @@ def run_discovery(
47
65
  workspaces: Source workspace names to discover; all workspaces when None.
48
66
  api_url: Prefect API URL from :func:`prefect_server`.
49
67
  """
50
- with temporary_settings(
51
- updates={
52
- PREFECT_HOME: run.client_home,
53
- PREFECT_API_URL: api_url,
54
- PREFECT_LOGGING_TO_API_ENABLED: False,
55
- "results.local_storage_path": run.results_path,
56
- }
57
- ):
58
- try:
59
- return discover_flow(run.migration_id, source_profile, workspaces)
60
- finally:
61
- # Deliver queued task-state events before the server may be stopped.
62
- EventsWorker.drain_all()
68
+ with _run_settings(run, api_url):
69
+ return discover_flow(run.migration_id, source_profile, workspaces)
70
+
71
+
72
+ def run_migration(run: MigrationRun, metadata: RunMetadata, api_url: str) -> MigrationOutcome:
73
+ """Run the migration flow for a run on a Prefect server.
74
+
75
+ Args:
76
+ run: Migration run that provides the client home and result storage.
77
+ metadata: Persisted run inputs, including profiles and workspace mappings.
78
+ api_url: Prefect API URL from :func:`prefect_server`.
79
+ """
80
+ with _run_settings(run, api_url):
81
+ return migrate_flow(
82
+ run.migration_id,
83
+ metadata.source_profile,
84
+ metadata.destination_profile,
85
+ metadata.workspace_mappings,
86
+ )
@@ -2,7 +2,7 @@
2
2
 
3
3
  from pydantic import BaseModel, field_validator
4
4
 
5
- SCHEMA_VERSION = 1
5
+ SCHEMA_VERSION = 2
6
6
 
7
7
 
8
8
  class VersionedModel(BaseModel):
@@ -28,6 +28,7 @@ class RunMetadata(VersionedModel):
28
28
  migration_id: str
29
29
  cli_version: str = __version__
30
30
  source_profile: str
31
+ destination_profile: str
31
32
  workspace_mappings: Optional[Dict[str, str]]
32
33
  created_at: datetime
33
34
 
@@ -91,6 +92,7 @@ def _validate_created_migration_id(migration_id: str) -> None:
91
92
 
92
93
  def create_migration_run(
93
94
  source_profile: str,
95
+ destination_profile: str,
94
96
  workspace_mappings: Optional[Dict[str, str]],
95
97
  root: Optional[Path] = None,
96
98
  ) -> MigrationRun:
@@ -106,6 +108,7 @@ def create_migration_run(
106
108
  RunMetadata(
107
109
  migration_id=migration_id,
108
110
  source_profile=source_profile,
111
+ destination_profile=destination_profile,
109
112
  workspace_mappings=workspace_mappings,
110
113
  created_at=datetime.now(timezone.utc),
111
114
  )
@@ -35,7 +35,7 @@ class Result(ApiModel):
35
35
  workspace: Optional[str] = None
36
36
  status: ResultStatus
37
37
  updated_at: AwareDatetime
38
- properties: Dict[str, str] = {}
38
+ properties: Dict[str, Optional[str]] = {}
39
39
 
40
40
 
41
41
  class _Page(ApiModel):
@@ -113,8 +113,10 @@ def discover_test_monitor(
113
113
 
114
114
  Only selected workspaces are queried, so product ownership is inferred from
115
115
  their results alone. A failed workspace is reported and excluded from that
116
- inference. Products with no results are included only when all workspaces are
117
- discovered without failures, since a failed workspace could hide their results.
116
+ inference. Products with no results belong to Default, so they are included
117
+ only when every workspace, Default among them, is discovered without failures.
118
+ A failed workspace could hide their results. Every discovered item's workspace
119
+ is therefore a selected workspace.
118
120
 
119
121
  Args:
120
122
  client: Test Monitor queries for the source server.
@@ -129,7 +131,9 @@ def discover_test_monitor(
129
131
  scan = _scan_results(
130
132
  client, {name: id_ for name, id_ in all_workspaces.items() if name in selected}
131
133
  )
132
- migrate_products_with_no_results = selected_workspaces is None and not scan.failures
134
+ migrate_products_with_no_results = (
135
+ selected == set(all_workspaces) and DEFAULT_WORKSPACE in selected and not scan.failures
136
+ )
133
137
  products: List[DiscoveredProduct] = []
134
138
  product_ids_by_part_number: Dict[str, str] = {}
135
139
  for product in client.query_products():
@@ -1,7 +1,5 @@
1
1
  """Persisted Prefect task for Test Monitor discovery."""
2
2
 
3
- from typing import List, Optional
4
-
5
3
  from prefect import task
6
4
  from prefect.cache_policies import INPUTS
7
5
 
@@ -9,7 +7,7 @@ from slcli.migration.connection import resolve_migration_connection
9
7
  from slcli.migration.testmonitor.client import TestMonitorClient
10
8
  from slcli.migration.testmonitor.discovery import discover_test_monitor
11
9
  from slcli.migration.testmonitor.models import TestMonitorDiscovery
12
- from slcli.migration.workspace_client import WorkspaceClient
10
+ from slcli.migration.workspaces import DiscoveredWorkspaces
13
11
 
14
12
 
15
13
  @task(
@@ -22,17 +20,16 @@ from slcli.migration.workspace_client import WorkspaceClient
22
20
  def discover_test_monitor_task(
23
21
  migration_id: str,
24
22
  source_profile: str,
25
- workspaces: Optional[List[str]],
23
+ workspaces: DiscoveredWorkspaces,
26
24
  ) -> TestMonitorDiscovery:
27
- """Discover Test Monitor resources from a source profile.
25
+ """Discover Test Monitor resources in the discovered source workspaces.
28
26
 
29
27
  Inputs are references, never credentials. ``migration_id`` is unused by the
30
28
  body but scopes the cache key to one migration.
31
29
  """
32
30
  connection = resolve_migration_connection(source_profile)
33
- session = connection.create_session()
34
- all_workspaces = {
35
- workspace.name: workspace.id
36
- for workspace in WorkspaceClient(connection, session).query_workspaces()
37
- }
38
- return discover_test_monitor(TestMonitorClient(connection, session), all_workspaces, workspaces)
31
+ return discover_test_monitor(
32
+ TestMonitorClient(connection),
33
+ {workspace.name: workspace.id for workspace in workspaces.source},
34
+ workspaces.selected,
35
+ )
@@ -0,0 +1,65 @@
1
+ """Persisted Prefect tasks for migration workspaces."""
2
+
3
+ from typing import Dict, List, Optional
4
+
5
+ from prefect import task
6
+ from prefect.cache_policies import INPUTS
7
+
8
+ from slcli.migration.connection import resolve_migration_connection
9
+ from slcli.migration.workspace_client import WorkspaceClient
10
+ from slcli.migration.workspaces import (
11
+ DiscoveredWorkspaces,
12
+ WorkspaceMapping,
13
+ discover_workspaces,
14
+ synchronize_workspaces,
15
+ )
16
+
17
+
18
+ @task(
19
+ name="discover-workspaces",
20
+ persist_result=True,
21
+ result_serializer="json",
22
+ cache_result_in_memory=False,
23
+ cache_policy=INPUTS,
24
+ )
25
+ def discover_workspaces_task(
26
+ migration_id: str, source_profile: str, workspaces: Optional[List[str]]
27
+ ) -> DiscoveredWorkspaces:
28
+ """Discover the source workspaces in scope of a migration.
29
+
30
+ ``migration_id`` is unused by the body but scopes the cache key to one migration.
31
+
32
+ Raises:
33
+ WorkspaceMappingError: If a requested workspace does not exist on the source.
34
+ """
35
+ source = WorkspaceClient(resolve_migration_connection(source_profile)).query_workspaces()
36
+ return discover_workspaces(source, workspaces)
37
+
38
+
39
+ # Later migration tasks are cached by the mapping, so a resumed run must reuse
40
+ # the mapping it synchronized first. A synchronization that raised is not cached.
41
+ @task(
42
+ name="synchronize-workspaces",
43
+ persist_result=True,
44
+ result_serializer="json",
45
+ cache_result_in_memory=False,
46
+ cache_policy=INPUTS,
47
+ )
48
+ def synchronize_workspaces_task(
49
+ migration_id: str,
50
+ destination_profile: str,
51
+ discovered: DiscoveredWorkspaces,
52
+ workspace_mappings: Optional[Dict[str, str]],
53
+ ) -> WorkspaceMapping:
54
+ """Map discovered source workspaces to destination workspaces.
55
+
56
+ ``migration_id`` is unused by the body but scopes the cache key to one migration.
57
+
58
+ Raises:
59
+ WorkspaceMappingError: If a destination workspace does not exist.
60
+ """
61
+ # TODO(AB#4088608): Create missing destination workspaces.
62
+ destination = WorkspaceClient(
63
+ resolve_migration_connection(destination_profile)
64
+ ).query_workspaces()
65
+ return synchronize_workspaces(discovered, destination, workspace_mappings)