systemlink-cli 2.5.2__tar.gz → 2.5.4__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-2.5.2 → systemlink_cli-2.5.4}/PKG-INFO +2 -1
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/pyproject.toml +4 -2
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/_version.py +1 -1
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/config.py +3 -9
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/function_click.py +8 -1
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/main.py +3 -0
- systemlink_cli-2.5.4/slcli/migrate_click.py +135 -0
- systemlink_cli-2.5.4/slcli/migration/command.py +140 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/migration/connection.py +17 -3
- systemlink_cli-2.5.4/slcli/migration/flows/__init__.py +1 -0
- systemlink_cli-2.5.4/slcli/migration/flows/discover.py +41 -0
- systemlink_cli-2.5.4/slcli/migration/orchestration.py +62 -0
- systemlink_cli-2.5.4/slcli/migration/schema.py +18 -0
- systemlink_cli-2.5.4/slcli/migration/state.py +124 -0
- systemlink_cli-2.5.4/slcli/migration/testmonitor/__init__.py +1 -0
- systemlink_cli-2.5.4/slcli/migration/testmonitor/client.py +104 -0
- systemlink_cli-2.5.4/slcli/migration/testmonitor/discovery.py +158 -0
- systemlink_cli-2.5.4/slcli/migration/testmonitor/discovery_task.py +38 -0
- systemlink_cli-2.5.4/slcli/migration/testmonitor/models.py +47 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/migration/workspace_client.py +5 -9
- systemlink_cli-2.5.4/slcli/paths.py +31 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/profiles.py +3 -8
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/utils.py +22 -15
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/workspace_click.py +4 -3
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/LICENSE +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/dff-editor/editor.js +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/dff-editor/index.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/__init__.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/__main__.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/alarm_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/asset_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/cli_formatters.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/cli_utils.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/comment_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/completion_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/config_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/credentials.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/dataframe_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/dff_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/dff_decorators.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/example_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/example_loader.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/example_provisioner.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/_schema/schema-v1.0.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-1/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-1/config.yaml +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-2/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-2/config.yaml +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-3/config.yaml +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-3/leakage-current-results.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-3/overvoltage-results.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-3/product-xyz-compliance-report.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-3/product-xyz-specification.csv +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/demo-data-3/thermal-response-results.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/exercise-5-1-parametric-insights/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/exercise-5-1-parametric-insights/config.yaml +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/exercise-7-1-test-plans/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/exercise-7-1-test-plans/config.yaml +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/spec-compliance-notebooks/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/spec-compliance-notebooks/config.yaml +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/feed_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/file_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/function_templates.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/__init__.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/crypto.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/handlers.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/minion.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/models.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/protocol.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/rest.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/state.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client/transport.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/managed_client_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/mcp_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/mcp_reachability.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/mcp_server.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/mcp_skills.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/migration/__init__.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/migration/api.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/migration/prefect_server.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/notebook_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/pkce.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/platform.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/policy_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/policy_utils.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/profile_credentials.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/response_handlers.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/rich_output.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/routine_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skill_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/SKILL.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/COPILOT_BATCH_RUN_PROMPT.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/evals.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/evals.schema.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/files/spec-import/battery-specs.csv +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/files/webapp-package/icon.svg +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/files/webapp-package/nipkg.config.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/files/webapp-package/webapp-content/index.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/evals/trigger_evals.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/analysis-recipes.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/commands.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/datasheet-workflow.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/domain-concepts.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/example-authoring.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/filtering.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/import-specs.min.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/job-debugging/overview.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/nipkg/overview.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/notebook/interfaces.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/notebook/notebook-patterns.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/notebook/overview.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/python-test/overview.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/routine-examples.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/troubleshooting.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/angular-ui-packages.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/deployment.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/layout-patterns.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/nimble-angular.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/overview.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/systemlink-services.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/references/webapp/troubleshooting.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/benchmark_iteration.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/compare_iteration.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/eval_manifest.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/grade_eval_response.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/grade_iteration.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/prepare_eval_prompts.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/prepare_eval_workspace.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/render_eval_review.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/skills/slcli/scripts/spec_import_helper.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/spec_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/ssl_trust.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/state_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/system_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/system_query_utils.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/systemlink-logo.svg +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/table_utils.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/tag_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/templates_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/testmonitor_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/universal_handlers.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/user_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/version_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/web_editor.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_bootstrap.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/.gitignore +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/angular.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/package.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/scripts/filter-sbom.js +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/app-routing.module.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/app.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/app.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/app.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/app.module.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/state/app-view-state.service.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-context.service.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-locale.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/theme-sync.service.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/webapp-home-data.service.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/app/shared/states/view-state.model.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/assets/README.md +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/index.html +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.de.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.en.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.es.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.fr.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.ja.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.ko.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/locale/messages.zh.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/localize.d.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/main.ts +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/src/styles.scss +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/tsconfig.app.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/webapp_templates/angular/blank/tsconfig.json +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/workflow_preview.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/workflows_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/workitem_click.py +0 -0
- {systemlink_cli-2.5.2 → systemlink_cli-2.5.4}/slcli/workspace_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: systemlink-cli
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.4
|
|
4
4
|
Summary: SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates.
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: Fred Visser
|
|
@@ -24,6 +24,7 @@ Requires-Dist: keyring (>=25.6.0,<26.0.0)
|
|
|
24
24
|
Requires-Dist: mcp (>=2,<3) ; extra == "mcp"
|
|
25
25
|
Requires-Dist: msgpack (>=1.1,<2) ; extra == "managed-client"
|
|
26
26
|
Requires-Dist: packaging (>=21.0)
|
|
27
|
+
Requires-Dist: platformdirs (>=4,<5)
|
|
27
28
|
Requires-Dist: prefect (>=3.8.6,<4) ; extra == "migration"
|
|
28
29
|
Requires-Dist: psutil (>=7,<8) ; extra == "migration"
|
|
29
30
|
Requires-Dist: pydantic (>=2.9,<3) ; extra == "migration"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "systemlink-cli"
|
|
3
|
-
version = "2.5.
|
|
3
|
+
version = "2.5.4"
|
|
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" }]
|
|
@@ -40,6 +40,7 @@ rich = ">=15,<16"
|
|
|
40
40
|
rich-click = ">=1.8,<2"
|
|
41
41
|
cryptography = ">=49.0.0"
|
|
42
42
|
pygments = ">=2.20.0"
|
|
43
|
+
platformdirs = ">=4,<5"
|
|
43
44
|
prefect = { version = ">=3.8.6,<4", optional = true }
|
|
44
45
|
psutil = { version = ">=7,<8", optional = true }
|
|
45
46
|
pydantic = { version = ">=2.9,<3", optional = true }
|
|
@@ -121,7 +122,8 @@ markers = [
|
|
|
121
122
|
"sls: marks tests as SystemLink Server specific",
|
|
122
123
|
"sle: marks tests as SystemLink Enterprise specific",
|
|
123
124
|
"file: marks tests as file service related",
|
|
124
|
-
"comment: marks tests as comment management related"
|
|
125
|
+
"comment: marks tests as comment management related",
|
|
126
|
+
"testmonitor: marks tests as Test Monitor related"
|
|
125
127
|
]
|
|
126
128
|
|
|
127
129
|
[tool.black]
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
"""Configuration management for slcli."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
-
import os
|
|
5
4
|
from pathlib import Path
|
|
6
5
|
from typing import Dict, Optional
|
|
7
6
|
|
|
7
|
+
from .paths import get_config_dir
|
|
8
|
+
|
|
8
9
|
|
|
9
10
|
def get_config_file_path() -> Path:
|
|
10
11
|
"""Get the path to the slcli configuration file."""
|
|
11
|
-
|
|
12
|
-
if "XDG_CONFIG_HOME" in os.environ:
|
|
13
|
-
config_dir = Path(os.environ["XDG_CONFIG_HOME"]) / "slcli"
|
|
14
|
-
else:
|
|
15
|
-
config_dir = Path.home() / ".config" / "slcli"
|
|
16
|
-
|
|
17
|
-
config_dir.mkdir(parents=True, exist_ok=True)
|
|
18
|
-
return config_dir / "config.json"
|
|
12
|
+
return get_config_dir() / "config.json"
|
|
19
13
|
|
|
20
14
|
|
|
21
15
|
def load_config() -> Dict[str, str]:
|
|
@@ -1245,6 +1245,8 @@ def register_function_commands(cli: Any) -> None:
|
|
|
1245
1245
|
"""Execute a function synchronously and return the result.
|
|
1246
1246
|
|
|
1247
1247
|
This sends a single request and waits for completion (no async polling).
|
|
1248
|
+
The HTTP read timeout allows 60 seconds beyond the execution timeout,
|
|
1249
|
+
or waits indefinitely when the execution timeout is zero.
|
|
1248
1250
|
"""
|
|
1249
1251
|
format_output = validate_output_format(format)
|
|
1250
1252
|
url = f"{get_unified_v2_base()}/functions/{function_id}/execute"
|
|
@@ -1319,7 +1321,12 @@ def register_function_commands(cli: Any) -> None:
|
|
|
1319
1321
|
}
|
|
1320
1322
|
if client_request_id:
|
|
1321
1323
|
execute_request["clientRequestId"] = client_request_id
|
|
1322
|
-
response_data = make_api_request(
|
|
1324
|
+
response_data = make_api_request(
|
|
1325
|
+
"POST",
|
|
1326
|
+
url,
|
|
1327
|
+
execute_request,
|
|
1328
|
+
timeout=(10.0, float(timeout + 60) if timeout else None),
|
|
1329
|
+
).json()
|
|
1323
1330
|
if format_output == "json":
|
|
1324
1331
|
click.echo(json.dumps(response_data, indent=2))
|
|
1325
1332
|
return
|
|
@@ -27,6 +27,7 @@ from .file_click import register_file_commands
|
|
|
27
27
|
from .function_click import register_function_commands
|
|
28
28
|
from .managed_client_click import register_managed_client_commands
|
|
29
29
|
from .mcp_click import register_mcp_commands
|
|
30
|
+
from .migrate_click import register_migrate_command
|
|
30
31
|
from .notebook_click import register_notebook_commands
|
|
31
32
|
from .platform import get_platform_info
|
|
32
33
|
from .policy_click import register_policy_commands
|
|
@@ -80,6 +81,7 @@ def _configure_rich_click_command_groups() -> None:
|
|
|
80
81
|
"version",
|
|
81
82
|
"completion",
|
|
82
83
|
"example",
|
|
84
|
+
"migrate",
|
|
83
85
|
],
|
|
84
86
|
},
|
|
85
87
|
{
|
|
@@ -791,6 +793,7 @@ register_file_commands(cli)
|
|
|
791
793
|
register_function_commands(cli)
|
|
792
794
|
register_managed_client_commands(cli)
|
|
793
795
|
register_mcp_commands(cli)
|
|
796
|
+
register_migrate_command(cli)
|
|
794
797
|
register_templates_commands(cli)
|
|
795
798
|
register_notebook_commands(cli)
|
|
796
799
|
register_policy_commands(cli)
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"""CLI registration for the discovery-only ``migrate`` command.
|
|
2
|
+
|
|
3
|
+
Migration depends on the optional ``migration`` extra, so this module imports
|
|
4
|
+
``slcli.migration`` only when the command runs.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from importlib.util import find_spec
|
|
8
|
+
from typing import Dict, List, Optional
|
|
9
|
+
from urllib.parse import urlparse
|
|
10
|
+
|
|
11
|
+
import click
|
|
12
|
+
|
|
13
|
+
_MIGRATION_EXTRA_PACKAGES = frozenset({"prefect", "psutil", "pydantic"})
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def migration_extra_installed() -> bool:
|
|
17
|
+
"""Return whether the ``migration`` extra's packages are installed, without importing them."""
|
|
18
|
+
return all(find_spec(package) is not None for package in _MIGRATION_EXTRA_PACKAGES)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
_MAPPING_FORMAT_ERROR = "workspace mappings must be SOURCE or SOURCE:DESTINATION"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _split_workspace_mappings(value: str) -> List[List[str]]:
|
|
25
|
+
r"""Split mappings on unescaped commas and colons.
|
|
26
|
+
|
|
27
|
+
A backslash makes the next character literal, so \, and \: allow workspace
|
|
28
|
+
names containing a comma or colon. SystemLink workspace names cannot contain
|
|
29
|
+
backslashes or leading/trailing spaces, so escaping is unambiguous and
|
|
30
|
+
surrounding whitespace is ignored.
|
|
31
|
+
"""
|
|
32
|
+
items: List[List[str]] = [[]]
|
|
33
|
+
part: List[str] = []
|
|
34
|
+
|
|
35
|
+
def finish_part() -> None:
|
|
36
|
+
items[-1].append("".join(part).strip())
|
|
37
|
+
part.clear()
|
|
38
|
+
|
|
39
|
+
chars = iter(value)
|
|
40
|
+
for char in chars:
|
|
41
|
+
if char == "\\":
|
|
42
|
+
escaped = next(chars, None)
|
|
43
|
+
if escaped is None:
|
|
44
|
+
raise click.BadParameter("workspace mappings cannot end with an escape '\\'")
|
|
45
|
+
part.append(escaped)
|
|
46
|
+
elif char == ":":
|
|
47
|
+
finish_part()
|
|
48
|
+
elif char == ",":
|
|
49
|
+
finish_part()
|
|
50
|
+
items.append([])
|
|
51
|
+
else:
|
|
52
|
+
part.append(char)
|
|
53
|
+
finish_part()
|
|
54
|
+
return items
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _parse_workspace_mappings(
|
|
58
|
+
ctx: click.Context, param: click.Parameter, value: Optional[str]
|
|
59
|
+
) -> Optional[Dict[str, str]]:
|
|
60
|
+
"""Parse comma-delimited SOURCE or SOURCE:DESTINATION workspace mappings."""
|
|
61
|
+
if value is None:
|
|
62
|
+
return None
|
|
63
|
+
mappings: Dict[str, str] = {}
|
|
64
|
+
for parts in _split_workspace_mappings(value):
|
|
65
|
+
if len(parts) > 2 or not all(parts):
|
|
66
|
+
raise click.BadParameter(_MAPPING_FORMAT_ERROR)
|
|
67
|
+
source, destination = parts[0], parts[-1]
|
|
68
|
+
if source in mappings:
|
|
69
|
+
raise click.BadParameter(f"workspace '{source}' is mapped more than once")
|
|
70
|
+
mappings[source] = destination
|
|
71
|
+
return mappings
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _validate_prefect_api_url(
|
|
75
|
+
ctx: click.Context, param: click.Parameter, value: Optional[str]
|
|
76
|
+
) -> Optional[str]:
|
|
77
|
+
if value is not None:
|
|
78
|
+
parsed = urlparse(value)
|
|
79
|
+
if parsed.scheme not in ("http", "https") or not parsed.netloc:
|
|
80
|
+
raise click.BadParameter("must be an HTTP or HTTPS URL")
|
|
81
|
+
return value
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def register_migrate_command(cli: click.Group) -> None:
|
|
85
|
+
"""Register the discovery-only migrate command, hidden without the migration extra."""
|
|
86
|
+
|
|
87
|
+
@cli.command(name="migrate", hidden=not migration_extra_installed())
|
|
88
|
+
@click.option("--source-profile", help="Named source SystemLink profile for a new migration.")
|
|
89
|
+
@click.option(
|
|
90
|
+
"--workspace-mappings",
|
|
91
|
+
callback=_parse_workspace_mappings,
|
|
92
|
+
help=(
|
|
93
|
+
"Comma-delimited SOURCE or SOURCE:DESTINATION workspace mappings. "
|
|
94
|
+
"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."
|
|
96
|
+
),
|
|
97
|
+
)
|
|
98
|
+
@click.option("--migration-id", help="Repeat discovery for an existing migration.")
|
|
99
|
+
@click.option(
|
|
100
|
+
"--prefect-api-url",
|
|
101
|
+
callback=_validate_prefect_api_url,
|
|
102
|
+
help="Use an externally managed Prefect server instead of starting one.",
|
|
103
|
+
)
|
|
104
|
+
def migrate(
|
|
105
|
+
source_profile: Optional[str],
|
|
106
|
+
workspace_mappings: Optional[Dict[str, str]],
|
|
107
|
+
migration_id: Optional[str],
|
|
108
|
+
prefect_api_url: Optional[str],
|
|
109
|
+
) -> None:
|
|
110
|
+
"""Discover and migrate resources from a SystemLink Server."""
|
|
111
|
+
if migration_id is not None and (
|
|
112
|
+
source_profile is not None or workspace_mappings is not None
|
|
113
|
+
):
|
|
114
|
+
raise click.UsageError(
|
|
115
|
+
"--migration-id cannot be combined with --source-profile or --workspace-mappings"
|
|
116
|
+
)
|
|
117
|
+
if migration_id is None and source_profile is None:
|
|
118
|
+
raise click.UsageError(
|
|
119
|
+
"Provide --source-profile for a new migration or --migration-id for an existing one"
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
try:
|
|
123
|
+
from slcli.migration import command
|
|
124
|
+
except ModuleNotFoundError as exc:
|
|
125
|
+
if (exc.name or "").partition(".")[0] not in _MIGRATION_EXTRA_PACKAGES:
|
|
126
|
+
raise
|
|
127
|
+
raise click.ClickException(
|
|
128
|
+
"Migration dependencies are not installed. Install systemlink-cli with "
|
|
129
|
+
"the 'migration' extra, for example: pipx install 'systemlink-cli[migration]'."
|
|
130
|
+
) from exc
|
|
131
|
+
|
|
132
|
+
if migration_id is not None:
|
|
133
|
+
command.resume_migration(migration_id, prefect_api_url)
|
|
134
|
+
elif source_profile is not None:
|
|
135
|
+
command.start_migration(source_profile, workspace_mappings, prefect_api_url)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Compose a discovery-only 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
|
+
|
|
12
|
+
from slcli._version import __version__
|
|
13
|
+
from slcli.migration.connection import MigrationConnection, resolve_migration_connection
|
|
14
|
+
from slcli.migration.orchestration import prefect_server, run_discovery
|
|
15
|
+
from slcli.migration.state import MigrationRun, create_migration_run, open_migration_run
|
|
16
|
+
from slcli.migration.testmonitor.models import TestMonitorDiscovery
|
|
17
|
+
from slcli.migration.workspace_client import WorkspaceClient
|
|
18
|
+
|
|
19
|
+
_logger = logging.getLogger("slcli.migration")
|
|
20
|
+
MIGRATION_LOG = "migration.log"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def start_migration(
|
|
24
|
+
source_profile: str,
|
|
25
|
+
workspace_mappings: Optional[Dict[str, str]],
|
|
26
|
+
prefect_api_url: Optional[str],
|
|
27
|
+
) -> None:
|
|
28
|
+
"""Create a new migration run and discover its source resources."""
|
|
29
|
+
connection = resolve_migration_connection(source_profile)
|
|
30
|
+
_echo_source(connection)
|
|
31
|
+
if workspace_mappings is not None:
|
|
32
|
+
_require_source_workspaces(connection, workspace_mappings)
|
|
33
|
+
run = create_migration_run(source_profile, workspace_mappings)
|
|
34
|
+
_discover(run, connection, workspace_mappings, prefect_api_url)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def resume_migration(migration_id: str, prefect_api_url: Optional[str]) -> None:
|
|
38
|
+
"""Resume migration run with the original inputs and cached state."""
|
|
39
|
+
try:
|
|
40
|
+
run, metadata = open_migration_run(migration_id)
|
|
41
|
+
except ValueError as exc:
|
|
42
|
+
raise click.ClickException(str(exc)) from exc
|
|
43
|
+
connection = resolve_migration_connection(metadata.source_profile)
|
|
44
|
+
_echo_source(connection)
|
|
45
|
+
_discover(run, connection, metadata.workspace_mappings, prefect_api_url)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def format_summary(discovery: TestMonitorDiscovery) -> str:
|
|
49
|
+
"""Return deterministic Test Monitor discovery counts and failures."""
|
|
50
|
+
lines = [
|
|
51
|
+
"Test Monitor discovery:",
|
|
52
|
+
f" Products: {len(discovery.products)}",
|
|
53
|
+
f" Terminal results: {len(discovery.results)}",
|
|
54
|
+
f" Failed workspaces: {len(discovery.failures)}",
|
|
55
|
+
*(f" {failure.workspace}: {failure.error_type}" for failure in discovery.failures),
|
|
56
|
+
]
|
|
57
|
+
if discovery.failures:
|
|
58
|
+
lines.append(" Product workspaces were inferred without the failed workspaces.")
|
|
59
|
+
return "\n".join(lines)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _all_workspaces_failed(discovery: TestMonitorDiscovery) -> bool:
|
|
63
|
+
return bool(discovery.workspaces) and len(discovery.failures) == len(discovery.workspaces)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _echo_source(connection: MigrationConnection) -> None:
|
|
67
|
+
click.echo(f"Source: {connection.profile_name} ({connection.base_url})")
|
|
68
|
+
if urlparse(connection.base_url).scheme.lower() != "https":
|
|
69
|
+
click.echo("Warning: source connection does not use HTTPS.", err=True)
|
|
70
|
+
if connection.ssl_verify is False:
|
|
71
|
+
click.echo("Warning: source TLS certificate verification is disabled.", err=True)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _require_source_workspaces(
|
|
75
|
+
connection: MigrationConnection, workspace_mappings: Dict[str, str]
|
|
76
|
+
) -> None:
|
|
77
|
+
existing = {workspace.name for workspace in WorkspaceClient(connection).query_workspaces()}
|
|
78
|
+
unknown = sorted(set(workspace_mappings).difference(existing))
|
|
79
|
+
if unknown:
|
|
80
|
+
raise click.BadParameter(
|
|
81
|
+
f"unknown source workspace: {', '.join(unknown)}",
|
|
82
|
+
param_hint="--workspace-mappings",
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@contextmanager
|
|
87
|
+
def _run_log(log_path: Path) -> Generator[None, None, None]:
|
|
88
|
+
"""Write migration logs to the run directory for the duration of the run."""
|
|
89
|
+
handler = logging.FileHandler(log_path, encoding="utf-8")
|
|
90
|
+
handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(name)s %(message)s"))
|
|
91
|
+
previous_level = _logger.level
|
|
92
|
+
_logger.addHandler(handler)
|
|
93
|
+
_logger.setLevel(logging.INFO)
|
|
94
|
+
try:
|
|
95
|
+
yield
|
|
96
|
+
finally:
|
|
97
|
+
_logger.removeHandler(handler)
|
|
98
|
+
_logger.setLevel(previous_level)
|
|
99
|
+
handler.close()
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _discover(
|
|
103
|
+
run: MigrationRun,
|
|
104
|
+
connection: MigrationConnection,
|
|
105
|
+
workspace_mappings: Optional[Dict[str, str]],
|
|
106
|
+
prefect_api_url: Optional[str],
|
|
107
|
+
) -> None:
|
|
108
|
+
click.echo(f"Migration ID: {run.migration_id}")
|
|
109
|
+
log_path = run.directory / MIGRATION_LOG
|
|
110
|
+
workspaces = list(workspace_mappings) if workspace_mappings is not None else None
|
|
111
|
+
server_mode = "managed" if prefect_api_url is None else "external"
|
|
112
|
+
with _run_log(log_path):
|
|
113
|
+
_logger.info(
|
|
114
|
+
"Discovery started: migration=%s cli=%s profile=%s endpoint=%s workspaces=%s "
|
|
115
|
+
"prefect_server=%s",
|
|
116
|
+
run.migration_id,
|
|
117
|
+
__version__,
|
|
118
|
+
connection.profile_name,
|
|
119
|
+
connection.base_url,
|
|
120
|
+
workspaces if workspaces is not None else "all",
|
|
121
|
+
server_mode,
|
|
122
|
+
)
|
|
123
|
+
try:
|
|
124
|
+
with prefect_server(run, prefect_api_url) as api_url:
|
|
125
|
+
discovery = run_discovery(run, connection.profile_name, workspaces, api_url)
|
|
126
|
+
except BaseException as exc:
|
|
127
|
+
_logger.error("Discovery failed: %s: %s", type(exc).__name__, exc)
|
|
128
|
+
click.echo(f"Log: {log_path}", err=True)
|
|
129
|
+
raise
|
|
130
|
+
test_monitor = discovery.test_monitor
|
|
131
|
+
_logger.info(
|
|
132
|
+
"Discovery completed: products=%d results=%d failed_workspaces=%s",
|
|
133
|
+
len(test_monitor.products),
|
|
134
|
+
len(test_monitor.results),
|
|
135
|
+
[failure.workspace for failure in test_monitor.failures],
|
|
136
|
+
)
|
|
137
|
+
click.echo(format_summary(test_monitor))
|
|
138
|
+
click.echo(f"Log: {log_path}")
|
|
139
|
+
if _all_workspaces_failed(test_monitor):
|
|
140
|
+
raise click.ClickException("Discovery failed for every workspace.")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Profile-explicit SystemLink connections for migration operations."""
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
-
from typing import Dict, Optional, Union
|
|
4
|
+
from typing import Any, Dict, Optional, Union
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
7
|
import requests
|
|
@@ -9,6 +9,7 @@ from requests.adapters import HTTPAdapter
|
|
|
9
9
|
from urllib3.util.retry import Retry
|
|
10
10
|
|
|
11
11
|
from slcli.profiles import Profile, ProfileConfig
|
|
12
|
+
from slcli.ssl_trust import use_standard_ssl_context
|
|
12
13
|
from slcli.utils import get_auth_headers, profile_ssl_verify, resolve_profile_auth
|
|
13
14
|
|
|
14
15
|
# Policy for read-only queries, including POST query endpoints, which are safe to replay.
|
|
@@ -23,6 +24,20 @@ _QUERY_RETRY = Retry(
|
|
|
23
24
|
)
|
|
24
25
|
|
|
25
26
|
|
|
27
|
+
class _ProfileSession(requests.Session):
|
|
28
|
+
"""Session that evaluates an explicit CA bundle despite injected OS trust."""
|
|
29
|
+
|
|
30
|
+
def __init__(self, ssl_verify: Union[bool, str]) -> None:
|
|
31
|
+
"""Bind the session to one TLS verification setting."""
|
|
32
|
+
super().__init__()
|
|
33
|
+
self.verify = self._ssl_verify = ssl_verify
|
|
34
|
+
|
|
35
|
+
def request(self, *args: Any, **kwargs: Any) -> requests.Response: # type: ignore[override]
|
|
36
|
+
"""Send a request using the standard SSL context for CA bundle paths."""
|
|
37
|
+
with use_standard_ssl_context(self._ssl_verify):
|
|
38
|
+
return super().request(*args, **kwargs)
|
|
39
|
+
|
|
40
|
+
|
|
26
41
|
@dataclass(frozen=True)
|
|
27
42
|
class MigrationConnection:
|
|
28
43
|
"""Endpoint, authentication, and TLS settings from one explicitly named profile."""
|
|
@@ -34,9 +49,8 @@ class MigrationConnection:
|
|
|
34
49
|
|
|
35
50
|
def create_session(self) -> requests.Session:
|
|
36
51
|
"""Return a query session bound to this connection's credentials and TLS."""
|
|
37
|
-
session =
|
|
52
|
+
session = _ProfileSession(self.ssl_verify)
|
|
38
53
|
session.headers.update(self.headers)
|
|
39
|
-
session.verify = self.ssl_verify
|
|
40
54
|
adapter = HTTPAdapter(max_retries=_QUERY_RETRY)
|
|
41
55
|
session.mount("https://", adapter)
|
|
42
56
|
session.mount("http://", adapter)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Prefect flows for migration operations."""
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Discovery-only migration flow."""
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from prefect import flow
|
|
6
|
+
from pydantic import ConfigDict
|
|
7
|
+
|
|
8
|
+
from slcli.migration.schema import VersionedModel
|
|
9
|
+
from slcli.migration.testmonitor.discovery_task import discover_test_monitor_task
|
|
10
|
+
from slcli.migration.testmonitor.models import TestMonitorDiscovery
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class MigrationDiscovery(VersionedModel):
|
|
14
|
+
"""Discovery results for every supported resource type."""
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(frozen=True)
|
|
17
|
+
|
|
18
|
+
test_monitor: TestMonitorDiscovery
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@flow(
|
|
22
|
+
name="systemlink-migration-discovery",
|
|
23
|
+
flow_run_name="migration-discovery-{migration_id}",
|
|
24
|
+
persist_result=True,
|
|
25
|
+
result_serializer="json",
|
|
26
|
+
)
|
|
27
|
+
def discover_flow(
|
|
28
|
+
migration_id: str,
|
|
29
|
+
source_profile: str,
|
|
30
|
+
workspaces: Optional[List[str]],
|
|
31
|
+
) -> MigrationDiscovery:
|
|
32
|
+
"""Run one persisted discovery task per supported resource type.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
migration_id: Migration that scopes task cache keys.
|
|
36
|
+
source_profile: Name of the source profile.
|
|
37
|
+
workspaces: Source workspace names to discover; all workspaces when None.
|
|
38
|
+
"""
|
|
39
|
+
return MigrationDiscovery(
|
|
40
|
+
test_monitor=discover_test_monitor_task(migration_id, source_profile, workspaces)
|
|
41
|
+
)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Run migration flows against a Prefect server."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Generator
|
|
4
|
+
from contextlib import contextmanager
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
from prefect.events.worker import EventsWorker
|
|
8
|
+
from prefect.settings import (
|
|
9
|
+
PREFECT_API_URL,
|
|
10
|
+
PREFECT_HOME,
|
|
11
|
+
PREFECT_LOGGING_TO_API_ENABLED,
|
|
12
|
+
temporary_settings,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
from slcli.migration.flows.discover import MigrationDiscovery, discover_flow
|
|
16
|
+
from slcli.migration.prefect_server import ManagedPrefectServer
|
|
17
|
+
from slcli.migration.state import MigrationRun
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@contextmanager
|
|
21
|
+
def prefect_server(run: MigrationRun, api_url: Optional[str] = None) -> Generator[str, None, None]:
|
|
22
|
+
"""Yield a Prefect API URL for a run.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
run: Migration run whose ``server_home`` can host a managed server.
|
|
26
|
+
api_url: An externally managed server to use instead; the caller owns its
|
|
27
|
+
lifecycle and database.
|
|
28
|
+
"""
|
|
29
|
+
if api_url is not None:
|
|
30
|
+
yield api_url
|
|
31
|
+
return
|
|
32
|
+
with ManagedPrefectServer(run.server_home) as managed_api_url:
|
|
33
|
+
yield managed_api_url
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def run_discovery(
|
|
37
|
+
run: MigrationRun,
|
|
38
|
+
source_profile: str,
|
|
39
|
+
workspaces: Optional[List[str]],
|
|
40
|
+
api_url: str,
|
|
41
|
+
) -> MigrationDiscovery:
|
|
42
|
+
"""Run the discovery flow for a migration run on a Prefect server.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
run: Migration run that provides the client home and result storage.
|
|
46
|
+
source_profile: Name of the source profile.
|
|
47
|
+
workspaces: Source workspace names to discover; all workspaces when None.
|
|
48
|
+
api_url: Prefect API URL from :func:`prefect_server`.
|
|
49
|
+
"""
|
|
50
|
+
with temporary_settings(
|
|
51
|
+
updates={
|
|
52
|
+
PREFECT_HOME: run.client_home,
|
|
53
|
+
PREFECT_API_URL: api_url,
|
|
54
|
+
PREFECT_LOGGING_TO_API_ENABLED: False,
|
|
55
|
+
"results.local_storage_path": run.results_path,
|
|
56
|
+
}
|
|
57
|
+
):
|
|
58
|
+
try:
|
|
59
|
+
return discover_flow(run.migration_id, source_profile, workspaces)
|
|
60
|
+
finally:
|
|
61
|
+
# Deliver queued task-state events before the server may be stopped.
|
|
62
|
+
EventsWorker.drain_all()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Single schema version for everything migration persists."""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, field_validator
|
|
4
|
+
|
|
5
|
+
SCHEMA_VERSION = 1
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class VersionedModel(BaseModel):
|
|
9
|
+
"""A persisted model that only loads data written with the current schema."""
|
|
10
|
+
|
|
11
|
+
schema_version: int = SCHEMA_VERSION
|
|
12
|
+
|
|
13
|
+
@field_validator("schema_version")
|
|
14
|
+
@classmethod
|
|
15
|
+
def _require_current(cls, value: int) -> int:
|
|
16
|
+
if value != SCHEMA_VERSION:
|
|
17
|
+
raise ValueError(f"unsupported schema version {value}; expected {SCHEMA_VERSION}")
|
|
18
|
+
return value
|