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.
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/PKG-INFO +1 -1
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/pyproject.toml +1 -1
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/_version.py +1 -1
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migrate_click.py +18 -9
- systemlink_cli-3.0.2/slcli/migration/command.py +189 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/flows/discover.py +10 -2
- systemlink_cli-3.0.2/slcli/migration/flows/migrate.py +53 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/orchestration.py +38 -14
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/schema.py +1 -1
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/state.py +3 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/client.py +1 -1
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/discovery.py +7 -3
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/discovery_task.py +8 -11
- systemlink_cli-3.0.2/slcli/migration/workspace_task.py +65 -0
- systemlink_cli-3.0.2/slcli/migration/workspaces.py +114 -0
- systemlink_cli-3.0.0/slcli/migration/command.py +0 -140
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/LICENSE +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/dff-editor/editor.js +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/dff-editor/index.html +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/__init__.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/__main__.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/alarm_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/asset_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/cli_formatters.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/cli_utils.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/comment_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/completion_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/config.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/config_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/credentials.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/dataframe_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/dff_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/dff_decorators.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/example_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/example_loader.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/example_provisioner.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/_schema/schema-v1.0.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-1/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-1/config.yaml +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-2/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-2/config.yaml +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/config.yaml +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/leakage-current-results.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/overvoltage-results.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/product-xyz-compliance-report.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/product-xyz-specification.csv +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/demo-data-3/thermal-response-results.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-5-1-parametric-insights/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-5-1-parametric-insights/config.yaml +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-7-1-test-plans/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/exercise-7-1-test-plans/config.yaml +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/config.yaml +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/feed_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/file_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/function_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/function_templates.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/main.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/__init__.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/crypto.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/handlers.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/minion.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/models.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/protocol.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/rest.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/state.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client/transport.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/managed_client_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_reachability.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_server.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/mcp_skills.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/__init__.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/api.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/connection.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/flows/__init__.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/prefect_server.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/__init__.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/testmonitor/models.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/migration/workspace_client.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/notebook_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/paths.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/pkce.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/platform.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/policy_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/policy_utils.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/profile_credentials.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/profiles.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/response_handlers.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/rich_output.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/routine_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skill_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/SKILL.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/COPILOT_BATCH_RUN_PROMPT.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/evals.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/evals.schema.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/spec-import/battery-specs.csv +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/webapp-package/icon.svg +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/webapp-package/nipkg.config.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/files/webapp-package/webapp-content/index.html +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/evals/trigger_evals.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/analysis-recipes.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/commands.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/datasheet-workflow.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/domain-concepts.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/example-authoring.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/filtering.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/import-specs.min.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/job-debugging/overview.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/nipkg/overview.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/notebook/interfaces.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/notebook/notebook-patterns.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/notebook/overview.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/python-test/overview.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/routine-examples.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/troubleshooting.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/angular-ui-packages.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/deployment.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/layout-patterns.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/nimble-angular.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/overview.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/systemlink-services.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/references/webapp/troubleshooting.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/benchmark_iteration.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/compare_iteration.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/eval_manifest.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/grade_eval_response.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/grade_iteration.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/prepare_eval_prompts.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/prepare_eval_workspace.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/render_eval_review.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/skills/slcli/scripts/spec_import_helper.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/spec_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/ssl_trust.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/state_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/system_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/system_query_utils.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/systemlink-logo.svg +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/table_utils.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/tag_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/templates_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/testmonitor_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/universal_handlers.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/user_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/utils.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/version_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/web_editor.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_bootstrap.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/.gitignore +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/angular.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/package.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/scripts/filter-sbom.js +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app-routing.module.ts +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.component.html +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.component.scss +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.component.ts +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/app.module.ts +0 -0
- {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
- {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
- {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
- {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
- {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
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-locale.ts +0 -0
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/assets/README.md +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/index.html +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.de.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.en.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.es.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.fr.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.ja.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.ko.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/locale/messages.zh.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/localize.d.ts +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/main.ts +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/src/styles.scss +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/tsconfig.app.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/webapp_templates/angular/blank/tsconfig.json +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workflow_preview.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workflows_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workitem_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workspace_click.py +0 -0
- {systemlink_cli-3.0.0 → systemlink_cli-3.0.2}/slcli/workspace_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "systemlink-cli"
|
|
3
|
-
version = "3.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" }]
|
|
@@ -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
|
-
|
|
112
|
-
|
|
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
|
|
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
|
|
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(
|
|
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
|
-
"""
|
|
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
|
-
|
|
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
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
+
)
|
|
@@ -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
|
)
|
|
@@ -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
|
|
117
|
-
|
|
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 =
|
|
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.
|
|
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:
|
|
23
|
+
workspaces: DiscoveredWorkspaces,
|
|
26
24
|
) -> TestMonitorDiscovery:
|
|
27
|
-
"""Discover Test Monitor resources
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
workspace.name: workspace.id
|
|
36
|
-
|
|
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)
|