systemlink-cli 3.1.1__tar.gz → 3.2.1__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 (228) hide show
  1. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/PKG-INFO +1 -1
  2. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/pyproject.toml +2 -1
  3. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/_version.py +1 -1
  4. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migrate_click.py +1 -1
  5. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/command.py +5 -9
  6. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/connection.py +25 -10
  7. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/flows/migrate.py +8 -3
  8. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/client.py +5 -2
  9. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/discovery.py +12 -5
  10. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/discovery_task.py +1 -0
  11. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/workspace_client.py +18 -0
  12. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/workspace_task.py +18 -12
  13. systemlink_cli-3.2.1/slcli/migration/workspaces.py +163 -0
  14. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/commands.md +5 -1
  15. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/workspace_click.py +6 -6
  16. systemlink_cli-3.1.1/slcli/migration/workspaces.py +0 -125
  17. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/LICENSE +0 -0
  18. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/dff-editor/editor.js +0 -0
  19. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/dff-editor/index.html +0 -0
  20. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/__init__.py +0 -0
  21. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/__main__.py +0 -0
  22. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/alarm_click.py +0 -0
  23. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/asset_click.py +0 -0
  24. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/cli_formatters.py +0 -0
  25. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/cli_utils.py +0 -0
  26. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/comment_click.py +0 -0
  27. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/completion_click.py +0 -0
  28. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/config.py +0 -0
  29. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/config_click.py +0 -0
  30. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/credentials.py +0 -0
  31. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/dataframe_click.py +0 -0
  32. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/dff_click.py +0 -0
  33. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/dff_decorators.py +0 -0
  34. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/example_click.py +0 -0
  35. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/example_loader.py +0 -0
  36. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/example_provisioner.py +0 -0
  37. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/README.md +0 -0
  38. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/_schema/schema-v1.0.json +0 -0
  39. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-1/README.md +0 -0
  40. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-1/config.yaml +0 -0
  41. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-2/README.md +0 -0
  42. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-2/config.yaml +0 -0
  43. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/config.yaml +0 -0
  44. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/leakage-current-results.json +0 -0
  45. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/overvoltage-results.json +0 -0
  46. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/product-xyz-compliance-report.json +0 -0
  47. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/product-xyz-specification.csv +0 -0
  48. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/thermal-response-results.json +0 -0
  49. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/exercise-5-1-parametric-insights/README.md +0 -0
  50. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/exercise-5-1-parametric-insights/config.yaml +0 -0
  51. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/exercise-7-1-test-plans/README.md +0 -0
  52. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/exercise-7-1-test-plans/config.yaml +0 -0
  53. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/README.md +0 -0
  54. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/config.yaml +0 -0
  55. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +0 -0
  56. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +0 -0
  57. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +0 -0
  58. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
  59. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/feed_click.py +0 -0
  60. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/file_click.py +0 -0
  61. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/function_click.py +0 -0
  62. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/function_templates.py +0 -0
  63. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/main.py +0 -0
  64. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/__init__.py +0 -0
  65. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/crypto.py +0 -0
  66. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/handlers.py +0 -0
  67. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/minion.py +0 -0
  68. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/models.py +0 -0
  69. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/protocol.py +0 -0
  70. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/rest.py +0 -0
  71. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/state.py +0 -0
  72. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client/transport.py +0 -0
  73. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/managed_client_click.py +0 -0
  74. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/mcp_click.py +0 -0
  75. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/mcp_reachability.py +0 -0
  76. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/mcp_server.py +0 -0
  77. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/mcp_skills.py +0 -0
  78. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/__init__.py +0 -0
  79. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/annotations.py +0 -0
  80. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/api.py +0 -0
  81. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/flows/__init__.py +0 -0
  82. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/flows/batching.py +0 -0
  83. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/flows/discover.py +0 -0
  84. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/flows/service.py +0 -0
  85. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/orchestration.py +0 -0
  86. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/prefect_server.py +0 -0
  87. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/schema.py +0 -0
  88. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/state.py +0 -0
  89. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/summary.py +0 -0
  90. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/__init__.py +0 -0
  91. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/migration.py +0 -0
  92. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/migration_task.py +0 -0
  93. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/models.py +0 -0
  94. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/records.py +0 -0
  95. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/writer.py +0 -0
  96. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/notebook_click.py +0 -0
  97. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/paths.py +0 -0
  98. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/pkce.py +0 -0
  99. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/platform.py +0 -0
  100. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/policy_click.py +0 -0
  101. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/policy_utils.py +0 -0
  102. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/profile_credentials.py +0 -0
  103. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/profiles.py +0 -0
  104. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/response_handlers.py +0 -0
  105. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/rich_output.py +0 -0
  106. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/routine_click.py +0 -0
  107. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skill_click.py +0 -0
  108. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/SKILL.md +0 -0
  109. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/COPILOT_BATCH_RUN_PROMPT.md +0 -0
  110. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/README.md +0 -0
  111. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/evals.json +0 -0
  112. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/evals.schema.json +0 -0
  113. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/spec-import/battery-specs.csv +0 -0
  114. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/webapp-package/icon.svg +0 -0
  115. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/webapp-package/nipkg.config.json +0 -0
  116. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/webapp-package/webapp-content/index.html +0 -0
  117. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/trigger_evals.json +0 -0
  118. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/analysis-recipes.md +0 -0
  119. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/datasheet-workflow.md +0 -0
  120. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/domain-concepts.md +0 -0
  121. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/example-authoring.md +0 -0
  122. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/filtering.md +0 -0
  123. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/import-specs.min.json +0 -0
  124. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/job-debugging/overview.md +0 -0
  125. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/nipkg/overview.md +0 -0
  126. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/notebook/interfaces.md +0 -0
  127. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/notebook/notebook-patterns.md +0 -0
  128. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/notebook/overview.md +0 -0
  129. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/python-test/overview.md +0 -0
  130. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/routine-examples.md +0 -0
  131. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/troubleshooting.md +0 -0
  132. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/angular-ui-packages.md +0 -0
  133. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/deployment.md +0 -0
  134. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/layout-patterns.md +0 -0
  135. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/nimble-angular.md +0 -0
  136. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/overview.md +0 -0
  137. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/systemlink-services.md +0 -0
  138. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/troubleshooting.md +0 -0
  139. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/benchmark_iteration.py +0 -0
  140. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/compare_iteration.py +0 -0
  141. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/eval_manifest.py +0 -0
  142. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/grade_eval_response.py +0 -0
  143. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/grade_iteration.py +0 -0
  144. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/prepare_eval_prompts.py +0 -0
  145. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/prepare_eval_workspace.py +0 -0
  146. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/render_eval_review.py +0 -0
  147. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/spec_import_helper.py +0 -0
  148. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/spec_click.py +0 -0
  149. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/ssl_trust.py +0 -0
  150. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/state_click.py +0 -0
  151. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/system_click.py +0 -0
  152. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/system_query_utils.py +0 -0
  153. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/systemlink-logo.svg +0 -0
  154. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/table_utils.py +0 -0
  155. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/tag_click.py +0 -0
  156. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/templates_click.py +0 -0
  157. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/testmonitor_click.py +0 -0
  158. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/universal_handlers.py +0 -0
  159. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/user_click.py +0 -0
  160. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/utils.py +0 -0
  161. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/version_click.py +0 -0
  162. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/web_editor.py +0 -0
  163. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_bootstrap.py +0 -0
  164. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_click.py +0 -0
  165. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/.gitignore +0 -0
  166. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/README.md +0 -0
  167. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/angular.json +0 -0
  168. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/package.json +0 -0
  169. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/scripts/filter-sbom.js +0 -0
  170. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app-routing.module.ts +0 -0
  171. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.component.html +0 -0
  172. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.component.scss +0 -0
  173. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.component.ts +0 -0
  174. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.module.ts +0 -0
  175. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.html +0 -0
  176. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.scss +0 -0
  177. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.ts +0 -0
  178. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/state/app-view-state.service.ts +0 -0
  179. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-context.service.ts +0 -0
  180. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-locale.ts +0 -0
  181. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/theme-sync.service.ts +0 -0
  182. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/webapp-home-data.service.ts +0 -0
  183. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.html +0 -0
  184. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.scss +0 -0
  185. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.ts +0 -0
  186. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.html +0 -0
  187. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.scss +0 -0
  188. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.ts +0 -0
  189. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.html +0 -0
  190. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.scss +0 -0
  191. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.ts +0 -0
  192. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.html +0 -0
  193. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.scss +0 -0
  194. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.ts +0 -0
  195. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.html +0 -0
  196. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.scss +0 -0
  197. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.ts +0 -0
  198. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.html +0 -0
  199. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.scss +0 -0
  200. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.ts +0 -0
  201. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.html +0 -0
  202. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.scss +0 -0
  203. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.ts +0 -0
  204. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.html +0 -0
  205. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.scss +0 -0
  206. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.ts +0 -0
  207. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.html +0 -0
  208. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.scss +0 -0
  209. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.ts +0 -0
  210. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/states/view-state.model.ts +0 -0
  211. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/assets/README.md +0 -0
  212. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/index.html +0 -0
  213. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.de.json +0 -0
  214. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.en.json +0 -0
  215. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.es.json +0 -0
  216. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.fr.json +0 -0
  217. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.ja.json +0 -0
  218. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.ko.json +0 -0
  219. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.zh.json +0 -0
  220. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/localize.d.ts +0 -0
  221. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/main.ts +0 -0
  222. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/styles.scss +0 -0
  223. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/tsconfig.app.json +0 -0
  224. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/tsconfig.json +0 -0
  225. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/workflow_preview.py +0 -0
  226. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/workflows_click.py +0 -0
  227. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/workitem_click.py +0 -0
  228. {systemlink_cli-3.1.1 → systemlink_cli-3.2.1}/slcli/workspace_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: systemlink-cli
3
- Version: 3.1.1
3
+ Version: 3.2.1
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.1.1"
3
+ version = "3.2.1"
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" }]
@@ -114,6 +114,7 @@ filterwarnings = [
114
114
  markers = [
115
115
  "e2e: marks tests as end-to-end tests (not run by default)",
116
116
  "e2e_migration: marks migration end-to-end tests",
117
+ "e2e_migration_manual: marks opt-in migration E2E tests that must be run against a throw-away destination",
117
118
  "full_os_client_matrix: marks tests requiring full supported-OS client coverage",
118
119
  "slow: marks tests as slow running",
119
120
  "notebook: marks tests as notebook-related",
@@ -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.1.1"
4
+ __version__ = "3.2.1"
@@ -97,7 +97,7 @@ def register_migrate_command(cli: click.Group) -> None:
97
97
  "Comma-delimited SOURCE or SOURCE:DESTINATION workspace mappings. "
98
98
  "Escape ',' or ':' in a workspace name with a backslash, for example Lab\\:A:Dest. "
99
99
  "Only the listed source workspaces are migrated; all when omitted. "
100
- "Destination workspaces must already exist."
100
+ "Missing destination workspaces are created unless the destination profile is readonly."
101
101
  ),
102
102
  )
103
103
  @click.option("--migration-id", help="Resume an existing migration.")
@@ -85,15 +85,11 @@ def _echo_connections(source: MigrationConnection, destination: MigrationConnect
85
85
  )
86
86
 
87
87
 
88
- def _mapping_error(
89
- exc: WorkspaceMappingError, workspace_mappings: Optional[Dict[str, str]]
90
- ) -> click.ClickException:
91
- # TODO(AB#4088608): Synchronize workspaces will create missing destination workspaces.
88
+ def _mapping_error(exc: WorkspaceMappingError) -> click.ClickException:
92
89
  hint = (
93
- "Destination workspaces are not created by migration."
94
- if workspace_mappings is not None
95
- else "Create the destination workspaces or select workspaces with "
96
- "--workspace-mappings. Destination workspaces are not created by migration."
90
+ "Check that the requested source workspaces exist."
91
+ if exc.missing_source
92
+ else "Check destination workspace access and retry."
97
93
  )
98
94
  return click.ClickException(f"{exc}. {hint}")
99
95
 
@@ -147,7 +143,7 @@ def _migrate(
147
143
  outcome = run_migration(run, metadata, api_url)
148
144
  except WorkspaceMappingError as exc:
149
145
  _log_failure(exc, log_path)
150
- raise _mapping_error(exc, workspace_mappings) from exc
146
+ raise _mapping_error(exc) from exc
151
147
  except requests.RequestException as exc:
152
148
  _log_failure(exc, log_path)
153
149
  handle_api_error(exc)
@@ -3,7 +3,7 @@
3
3
  import logging
4
4
  from dataclasses import dataclass, field
5
5
  from types import TracebackType
6
- from typing import Any, Dict, Optional, Union
6
+ from typing import Any, Dict, Iterable, Optional, Union
7
7
 
8
8
  import click
9
9
  import requests
@@ -54,15 +54,16 @@ class LoggingRetry(Retry):
54
54
  return retry
55
55
 
56
56
 
57
- # Policy for read-only queries, including POST query endpoints, which are safe to replay.
58
- _QUERY_RETRY = LoggingRetry(
57
+ _DEFAULT_RETRY = LoggingRetry(
59
58
  total=5,
60
59
  backoff_factor=0.5,
61
60
  status_forcelist=(429, 500, 502, 503, 504),
62
- allowed_methods=frozenset({"GET", "POST"}),
61
+ allowed_methods=frozenset({"GET"}),
63
62
  respect_retry_after_header=True,
64
63
  raise_on_status=False,
65
64
  )
65
+ # Policy for read-only queries, including POST query endpoints, which are safe to replay.
66
+ _QUERY_RETRY = _DEFAULT_RETRY.new(allowed_methods=frozenset({"GET", "POST"}))
66
67
 
67
68
  # Policy for destination writes. Only failures where the server did not process the
68
69
  # request are retried: refused connections and explicit 429/503 back-pressure. Read
@@ -96,16 +97,30 @@ class _ProfileSession(requests.Session):
96
97
 
97
98
  @dataclass(frozen=True)
98
99
  class MigrationConnection:
99
- """Endpoint, authentication, and TLS settings from one explicitly named profile."""
100
+ """Endpoint, authentication, TLS, and read-only settings from a named profile."""
100
101
 
101
102
  profile_name: str
102
103
  base_url: str
103
104
  headers: Dict[str, str] = field(repr=False)
104
105
  ssl_verify: Union[bool, str] = True
105
-
106
- def create_session(self) -> requests.Session:
107
- """Return a query session bound to this connection's credentials and TLS."""
108
- return self._session(_QUERY_RETRY)
106
+ readonly: bool = False
107
+
108
+ def create_session(self, query_paths: Iterable[str] = ()) -> requests.Session:
109
+ """Return a session bound to this connection's credentials and TLS.
110
+
111
+ Requests are matched to a retry policy by URL prefix. URLs under any
112
+ ``query_paths`` entry use the query policy, which replays POST requests.
113
+ All other URLs use the default policy, which never replays POST requests.
114
+
115
+ Args:
116
+ query_paths: Route prefixes relative to ``base_url`` whose POST requests
117
+ are read-only queries, such as ``"nitestmonitor/v2/query-"``.
118
+ """
119
+ session = self._session(_DEFAULT_RETRY)
120
+ base = self.base_url.rstrip("/")
121
+ for path in query_paths:
122
+ session.mount(f"{base}/{path.lstrip('/')}", HTTPAdapter(max_retries=_QUERY_RETRY))
123
+ return session
109
124
 
110
125
  def create_write_session(self) -> requests.Session:
111
126
  """Return a session for non-idempotent writes that never replays ambiguous failures."""
@@ -157,4 +172,4 @@ def resolve_migration_connection(
157
172
  if auth is None:
158
173
  raise click.ClickException(f"Profile '{profile.name}' does not define an API key")
159
174
  headers = get_auth_headers(auth.value, auth.scheme)
160
- return MigrationConnection(profile.name, base_url, headers, ssl_verify)
175
+ return MigrationConnection(profile.name, base_url, headers, ssl_verify, profile.readonly)
@@ -1,6 +1,6 @@
1
1
  """Migration flow: discover, synchronize workspaces, then migrate each resource type."""
2
2
 
3
- from typing import Dict, Optional
3
+ from typing import Dict, List, Optional
4
4
 
5
5
  from prefect import flow
6
6
  from pydantic import ConfigDict
@@ -51,9 +51,14 @@ def migrate_flow(
51
51
  workspace_mappings: Source to destination workspace names; all by name when None.
52
52
  product_batch_size: Products per migration task.
53
53
  result_batch_size: Results, with their steps, per migration task.
54
+
55
+ Raises:
56
+ WorkspaceMappingError: If a source workspace does not exist.
54
57
  """
55
- workspaces = list(workspace_mappings) if workspace_mappings is not None else None
56
- discovery = discover_flow(migration_id, source_profile, workspaces)
58
+ workspace_subset_to_migrate: Optional[List[str]] = (
59
+ list(workspace_mappings) if workspace_mappings is not None else None
60
+ )
61
+ discovery = discover_flow(migration_id, source_profile, workspace_subset_to_migrate)
57
62
  mapping = synchronize_workspaces_task(
58
63
  migration_id, destination_profile, discovery.workspaces, workspace_mappings
59
64
  )
@@ -10,6 +10,9 @@ from slcli.migration.api import REQUEST_TIMEOUT_SECONDS, ApiModel
10
10
  from slcli.migration.connection import MigrationConnection
11
11
 
12
12
  PAGE_SIZE = 1000
13
+ TEST_MONITOR_BASE_PATH = "nitestmonitor/v2"
14
+ # POST query-products and query-results are read-only, so their retries are safe.
15
+ TEST_MONITOR_QUERY_PATHS = (f"{TEST_MONITOR_BASE_PATH}/query-",)
13
16
 
14
17
 
15
18
  class Product(ApiModel):
@@ -94,8 +97,8 @@ class TestMonitorClient:
94
97
  session: Optional[requests.Session] = None,
95
98
  ) -> None:
96
99
  """Initialize a Test Monitor query client."""
97
- self._base_url = f"{connection.base_url}/nitestmonitor/v2"
98
- self._session = session or connection.create_session()
100
+ self._base_url = f"{connection.base_url}/{TEST_MONITOR_BASE_PATH}"
101
+ self._session = session or connection.create_session(TEST_MONITOR_QUERY_PATHS)
99
102
 
100
103
  def query_products(self) -> Iterator[Product]:
101
104
  """Yield every product."""
@@ -89,7 +89,8 @@ def infer_product_workspace(
89
89
  def discover_test_monitor(
90
90
  client: TestMonitorSource,
91
91
  all_workspaces: Mapping[str, str],
92
- selected_workspaces: Optional[Collection[str]] = None,
92
+ selected_workspaces: Collection[str],
93
+ disabled_workspaces: Collection[str],
93
94
  ) -> TestMonitorDiscovery:
94
95
  """Discover products and terminal results owned by the selected workspaces.
95
96
 
@@ -102,10 +103,13 @@ def discover_test_monitor(
102
103
 
103
104
  Args:
104
105
  client: Test Monitor queries for the source server.
105
- all_workspaces: Every accessible source workspace, by name to ID.
106
- selected_workspaces: Workspace names to discover; all workspaces when None.
106
+ all_workspaces: Every (enabled) source workspace, by name to ID.
107
+ selected_workspaces: Names of workspaces in scope of the migration.
108
+ disabled_workspaces: Names of disabled source workspaces, which are never scanned.
109
+ Any disabled workspace may hold results, so products with no results are not
110
+ assigned to Default when this is non-empty.
107
111
  """
108
- selected = set(all_workspaces if selected_workspaces is None else selected_workspaces)
112
+ selected = set(selected_workspaces)
109
113
  unknown = selected.difference(all_workspaces)
110
114
  if unknown:
111
115
  raise ValueError(f"Unknown selected workspace: {', '.join(sorted(unknown))}")
@@ -114,7 +118,10 @@ def discover_test_monitor(
114
118
  client, {name: id_ for name, id_ in all_workspaces.items() if name in selected}
115
119
  )
116
120
  migrate_products_with_no_results = (
117
- selected == set(all_workspaces) and DEFAULT_WORKSPACE in selected and not scan.failures
121
+ selected == set(all_workspaces)
122
+ and DEFAULT_WORKSPACE in selected
123
+ and not disabled_workspaces
124
+ and not scan.failures
118
125
  )
119
126
  products: List[DiscoveredProduct] = []
120
127
  product_ids_by_part_number: Dict[str, str] = {}
@@ -32,4 +32,5 @@ def discover_test_monitor_task(
32
32
  TestMonitorClient(connection),
33
33
  {workspace.name: workspace.id for workspace in workspaces.source},
34
34
  workspaces.selected,
35
+ workspaces.disabled,
35
36
  )
@@ -3,6 +3,7 @@
3
3
  from collections.abc import Iterator
4
4
  from typing import List, Optional
5
5
 
6
+ import click
6
7
  import requests
7
8
 
8
9
  from slcli.migration.api import REQUEST_TIMEOUT_SECONDS, ApiModel
@@ -16,6 +17,7 @@ class Workspace(ApiModel):
16
17
 
17
18
  id: str
18
19
  name: str
20
+ enabled: bool = True
19
21
 
20
22
 
21
23
  class _WorkspacePage(ApiModel):
@@ -31,6 +33,7 @@ class WorkspaceClient:
31
33
  session: Optional[requests.Session] = None,
32
34
  ) -> None:
33
35
  """Initialize a workspace query client."""
36
+ self._connection = connection
34
37
  self._url = f"{connection.base_url}/niuser/v1/workspaces"
35
38
  self._session = session or connection.create_session()
36
39
 
@@ -49,3 +52,18 @@ class WorkspaceClient:
49
52
  if len(page.workspaces) < PAGE_SIZE:
50
53
  return
51
54
  skip += PAGE_SIZE
55
+
56
+ def create_workspace(self, name: str) -> Workspace:
57
+ """Create an enabled workspace and return its server-assigned identity."""
58
+ if self._connection.readonly:
59
+ raise click.ClickException(
60
+ f"Cannot create a workspace: profile '{self._connection.profile_name}' "
61
+ "is in readonly mode"
62
+ )
63
+ response = self._session.post(
64
+ self._url,
65
+ json={"name": name, "enabled": True},
66
+ timeout=REQUEST_TIMEOUT_SECONDS,
67
+ )
68
+ response.raise_for_status()
69
+ return Workspace(id=str(response.json()["id"]), name=name)
@@ -23,17 +23,21 @@ from slcli.migration.workspaces import (
23
23
  cache_policy=INPUTS,
24
24
  )
25
25
  def discover_workspaces_task(
26
- migration_id: str, source_profile: str, workspaces: Optional[List[str]]
26
+ migration_id: str, source_profile: str, explicit_workspace_selection: Optional[List[str]]
27
27
  ) -> DiscoveredWorkspaces:
28
28
  """Discover the source workspaces in scope of a migration.
29
29
 
30
30
  ``migration_id`` is unused by the body but scopes the cache key to one migration.
31
+ ``explicit_workspace_selection`` optionally contains a specific set of workspaces to find.
32
+ If not given, all workspaces are discovered and returned.
31
33
 
32
34
  Raises:
33
- WorkspaceMappingError: If a requested workspace does not exist on the source.
35
+ WorkspaceMappingError: If a requested source workspace does not exist.
34
36
  """
35
- source = WorkspaceClient(resolve_migration_connection(source_profile)).query_workspaces()
36
- return discover_workspaces(source, workspaces)
37
+ source_workspace_iterator = WorkspaceClient(
38
+ resolve_migration_connection(source_profile)
39
+ ).query_workspaces()
40
+ return discover_workspaces(source_workspace_iterator, explicit_workspace_selection)
37
41
 
38
42
 
39
43
  # Later migration tasks are cached by the mapping, so a resumed run must reuse
@@ -48,18 +52,20 @@ def discover_workspaces_task(
48
52
  def synchronize_workspaces_task(
49
53
  migration_id: str,
50
54
  destination_profile: str,
51
- discovered: DiscoveredWorkspaces,
55
+ source_workspaces: DiscoveredWorkspaces,
52
56
  workspace_mappings: Optional[Dict[str, str]],
53
57
  ) -> WorkspaceMapping:
54
- """Map discovered source workspaces to destination workspaces.
58
+ """Map source workspaces to existing destination workspaces, or create if missing.
55
59
 
56
60
  ``migration_id`` is unused by the body but scopes the cache key to one migration.
57
61
 
58
62
  Raises:
59
- WorkspaceMappingError: If a destination workspace does not exist.
63
+ WorkspaceMappingError: If a mapped destination workspace is disabled.
60
64
  """
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)
65
+ destination_client = WorkspaceClient(resolve_migration_connection(destination_profile))
66
+ return synchronize_workspaces(
67
+ source_workspaces,
68
+ destination_client.query_workspaces(),
69
+ destination_client.create_workspace,
70
+ workspace_mappings,
71
+ )
@@ -0,0 +1,163 @@
1
+ """Discover source workspaces and synchronize them to destination workspaces."""
2
+
3
+ from typing import Callable, Iterable, Mapping, Optional, Sequence, Tuple
4
+
5
+ from pydantic import BaseModel, ConfigDict
6
+
7
+ from slcli.migration.workspace_client import Workspace
8
+
9
+
10
+ class DiscoveredWorkspaces(BaseModel):
11
+ """Every accessible enabled source workspace and the names in scope of a migration."""
12
+
13
+ model_config = ConfigDict(frozen=True)
14
+
15
+ source: Tuple[Workspace, ...] = ()
16
+ selected: Tuple[str, ...] = ()
17
+ disabled: Tuple[str, ...] = ()
18
+
19
+
20
+ class MappedWorkspace(BaseModel):
21
+ """One source workspace and the existing destination workspace it migrates to."""
22
+
23
+ model_config = ConfigDict(frozen=True)
24
+
25
+ source_name: str
26
+ source_id: str
27
+ destination_name: str
28
+ destination_id: str
29
+
30
+
31
+ class WorkspaceMapping(BaseModel):
32
+ """Resolved source-to-destination workspaces, ordered by source name."""
33
+
34
+ model_config = ConfigDict(frozen=True)
35
+
36
+ workspaces: Tuple[MappedWorkspace, ...] = ()
37
+
38
+ def workspace(self, source_name: str) -> MappedWorkspace:
39
+ """Return the mapping for a source workspace name.
40
+
41
+ Raises:
42
+ KeyError: If the source workspace is not mapped.
43
+ """
44
+ for workspace in self.workspaces:
45
+ if workspace.source_name == source_name:
46
+ return workspace
47
+ raise KeyError(f"Workspace '{source_name}' is not mapped")
48
+
49
+
50
+ class WorkspaceMappingError(ValueError):
51
+ """Requested workspaces that are missing or have disabled destinations."""
52
+
53
+ def __init__(
54
+ self,
55
+ missing_source: Sequence[str] = (),
56
+ missing_destination: Sequence[str] = (),
57
+ disabled_destination: Sequence[str] = (),
58
+ ) -> None:
59
+ """Record missing source or destination workspaces and disabled destinations."""
60
+ self.missing_source = list(missing_source)
61
+ self.missing_destination = list(missing_destination)
62
+ self.disabled_destination = list(disabled_destination)
63
+ problems = []
64
+ if missing_source:
65
+ problems.append(f"unknown source workspace: {', '.join(missing_source)}")
66
+ if missing_destination:
67
+ problems.append(f"missing destination workspace: {', '.join(missing_destination)}")
68
+ if disabled_destination:
69
+ problems.append(f"disabled destination workspace: {', '.join(disabled_destination)}")
70
+ super().__init__("; ".join(problems))
71
+
72
+
73
+ def discover_workspaces(
74
+ all_source_workspaces: Iterable[Workspace],
75
+ explicit_workspace_selection: Optional[Iterable[str]],
76
+ ) -> DiscoveredWorkspaces:
77
+ """Select enabled source workspaces in scope of a migration.
78
+
79
+ Args:
80
+ all_source_workspaces: Every accessible source workspace.
81
+ explicit_workspace_selection: Source names to migrate; all enabled workspaces when None.
82
+
83
+ Raises:
84
+ WorkspaceMappingError: If a requested source workspace is missing or disabled.
85
+ """
86
+ enumerated_source_workspaces = tuple(all_source_workspaces)
87
+ enabled_workspaces = tuple(
88
+ sorted(
89
+ (workspace for workspace in enumerated_source_workspaces if workspace.enabled),
90
+ key=lambda workspace: workspace.name,
91
+ )
92
+ )
93
+ enabled_workspace_names = [workspace.name for workspace in enabled_workspaces]
94
+ disabled_workspace_names = tuple(
95
+ workspace.name for workspace in enumerated_source_workspaces if not workspace.enabled
96
+ )
97
+ names_to_include = (
98
+ sorted(explicit_workspace_selection)
99
+ if explicit_workspace_selection is not None
100
+ else enabled_workspace_names
101
+ )
102
+ missing = sorted(set(names_to_include).difference(enabled_workspace_names))
103
+ if missing:
104
+ raise WorkspaceMappingError(missing_source=missing)
105
+ return DiscoveredWorkspaces(
106
+ source=enabled_workspaces,
107
+ selected=tuple(names_to_include),
108
+ disabled=disabled_workspace_names,
109
+ )
110
+
111
+
112
+ def synchronize_workspaces(
113
+ source_workspaces: DiscoveredWorkspaces,
114
+ destination_workspaces: Iterable[Workspace],
115
+ create_destination_workspace: Callable[[str], Workspace],
116
+ provided_name_mappings: Optional[Mapping[str, str]],
117
+ ) -> WorkspaceMapping:
118
+ """Map discovered source workspaces to existing destination workspaces.
119
+
120
+ Every selected source workspace maps to the same-named destination workspace
121
+ unless ``provided_name_mappings`` renames it.
122
+
123
+ Args:
124
+ source_workspaces: Source workspaces discovered.
125
+ destination_client: Client for running workspace commands on the destination.
126
+ provided_name_mappings: Explicit source-to-destination name mappings;
127
+ when None, destination names match source.
128
+
129
+ Raises:
130
+ WorkspaceMappingError: If a mapped destination workspace is disabled.
131
+ """
132
+ destination_workspaces_by_name = {
133
+ workspace.name: workspace for workspace in destination_workspaces
134
+ }
135
+
136
+ name_mappings = {
137
+ source_name: (provided_name_mappings or {}).get(source_name, source_name)
138
+ for source_name in source_workspaces.selected
139
+ }
140
+ needed_names = set(name_mappings.values())
141
+ existing_names = set(destination_workspaces_by_name)
142
+ disabled_names = sorted(
143
+ name
144
+ for name in needed_names & existing_names
145
+ if not destination_workspaces_by_name[name].enabled
146
+ )
147
+ if disabled_names:
148
+ raise WorkspaceMappingError(disabled_destination=disabled_names)
149
+ for missing_name in sorted(needed_names - existing_names):
150
+ destination_workspaces_by_name[missing_name] = create_destination_workspace(missing_name)
151
+
152
+ source_ids = {workspace.name: workspace.id for workspace in source_workspaces.source}
153
+ return WorkspaceMapping(
154
+ workspaces=tuple(
155
+ MappedWorkspace(
156
+ source_name=source_name,
157
+ source_id=source_ids[source_name],
158
+ destination_name=name_mappings[source_name],
159
+ destination_id=destination_workspaces_by_name[name_mappings[source_name]].id,
160
+ )
161
+ for source_name in source_workspaces.selected
162
+ )
163
+ )
@@ -694,11 +694,15 @@ slcli comment delete <ID1> <ID2> <ID3> --yes
694
694
  ## workspace — Workspace management
695
695
 
696
696
  ```bash
697
- slcli workspace list [--format json]
697
+ slcli workspace list [--format json] [--take N]
698
698
  slcli workspace get --workspace WORKSPACE_ID [--format json]
699
699
  slcli workspace disable --id WORKSPACE_ID [--yes]
700
700
  ```
701
701
 
702
+ `workspace list` defaults to 100. For JSON output, `--take` limits the total
703
+ results. For table output, it sets the page size (maximum 100); interactive users
704
+ can continue through additional pages.
705
+
702
706
  ## config — Profile and credential management
703
707
 
704
708
  Manage named connection profiles (dev, test, prod). Credentials use the OS
@@ -19,7 +19,7 @@ from .utils import (
19
19
 
20
20
 
21
21
  def _fetch_workspaces_page(
22
- name_filter: Optional[str] = None, take: int = 25, skip: int = 0
22
+ name_filter: Optional[str] = None, take: int = 100, skip: int = 0
23
23
  ) -> Tuple[list, int, Optional[str]]:
24
24
  """Fetch a single page of workspaces with optional server-side filtering.
25
25
 
@@ -86,21 +86,21 @@ def register_workspace_commands(cli: Any) -> None:
86
86
  "--take",
87
87
  "-t",
88
88
  type=click.IntRange(min=1),
89
- default=25,
89
+ default=100,
90
90
  show_default=True,
91
- help="Maximum number of workspaces to return from API",
91
+ help="JSON result limit or table page size (API pages max 100)",
92
92
  )
93
93
  def list_workspaces(
94
94
  format: str = "table",
95
95
  include_disabled: bool = False,
96
96
  name_filter: Optional[str] = None,
97
- take: int = 25,
97
+ take: int = 100,
98
98
  ) -> None:
99
99
  """List workspaces with optional filtering.
100
100
 
101
101
  The --filter option performs server-side case-insensitive substring
102
- matching on workspace names. The --take option limits the number of
103
- results shown per page (max 100).
102
+ matching on workspace names. The --take option sets the JSON result limit
103
+ or table page size (API pages are capped at 100).
104
104
  """
105
105
  format_output = validate_output_format(format)
106
106