systemlink-cli 3.1.0__tar.gz → 3.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/PKG-INFO +2 -1
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/pyproject.toml +3 -1
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/_version.py +1 -1
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migrate_click.py +28 -6
- systemlink_cli-3.2.1/slcli/migration/annotations.py +10 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/command.py +35 -41
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/connection.py +88 -10
- systemlink_cli-3.2.1/slcli/migration/flows/batching.py +82 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/flows/migrate.py +31 -8
- systemlink_cli-3.2.1/slcli/migration/flows/service.py +66 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/orchestration.py +8 -2
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/state.py +9 -0
- systemlink_cli-3.2.1/slcli/migration/summary.py +72 -0
- systemlink_cli-3.2.1/slcli/migration/testmonitor/client.py +159 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/discovery.py +15 -26
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/discovery_task.py +1 -0
- systemlink_cli-3.2.1/slcli/migration/testmonitor/migration.py +345 -0
- systemlink_cli-3.2.1/slcli/migration/testmonitor/migration_task.py +136 -0
- systemlink_cli-3.2.1/slcli/migration/testmonitor/models.py +96 -0
- systemlink_cli-3.2.1/slcli/migration/testmonitor/records.py +87 -0
- systemlink_cli-3.2.1/slcli/migration/testmonitor/writer.py +101 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/workspace_client.py +18 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/workspace_task.py +18 -12
- systemlink_cli-3.2.1/slcli/migration/workspaces.py +163 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/commands.md +5 -1
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/workspace_click.py +6 -6
- systemlink_cli-3.1.0/slcli/migration/testmonitor/client.py +0 -104
- systemlink_cli-3.1.0/slcli/migration/testmonitor/models.py +0 -47
- systemlink_cli-3.1.0/slcli/migration/workspaces.py +0 -114
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/LICENSE +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/dff-editor/editor.js +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/dff-editor/index.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/__init__.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/__main__.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/alarm_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/asset_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/cli_formatters.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/cli_utils.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/comment_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/completion_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/config.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/config_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/credentials.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/dataframe_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/dff_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/dff_decorators.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/example_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/example_loader.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/example_provisioner.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/_schema/schema-v1.0.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-1/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-1/config.yaml +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-2/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-2/config.yaml +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/config.yaml +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/leakage-current-results.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/overvoltage-results.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/product-xyz-compliance-report.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/product-xyz-specification.csv +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/demo-data-3/thermal-response-results.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/exercise-5-1-parametric-insights/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/exercise-5-1-parametric-insights/config.yaml +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/exercise-7-1-test-plans/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/exercise-7-1-test-plans/config.yaml +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/config.yaml +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/feed_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/file_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/function_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/function_templates.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/main.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/__init__.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/crypto.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/handlers.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/minion.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/models.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/protocol.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/rest.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/state.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client/transport.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/managed_client_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/mcp_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/mcp_reachability.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/mcp_server.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/mcp_skills.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/__init__.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/api.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/flows/__init__.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/flows/discover.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/prefect_server.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/schema.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/migration/testmonitor/__init__.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/notebook_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/paths.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/pkce.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/platform.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/policy_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/policy_utils.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/profile_credentials.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/profiles.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/response_handlers.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/rich_output.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/routine_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skill_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/SKILL.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/COPILOT_BATCH_RUN_PROMPT.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/evals.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/evals.schema.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/spec-import/battery-specs.csv +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/webapp-package/icon.svg +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/webapp-package/nipkg.config.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/files/webapp-package/webapp-content/index.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/evals/trigger_evals.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/analysis-recipes.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/datasheet-workflow.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/domain-concepts.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/example-authoring.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/filtering.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/import-specs.min.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/job-debugging/overview.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/nipkg/overview.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/notebook/interfaces.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/notebook/notebook-patterns.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/notebook/overview.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/python-test/overview.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/routine-examples.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/troubleshooting.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/angular-ui-packages.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/deployment.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/layout-patterns.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/nimble-angular.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/overview.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/systemlink-services.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/references/webapp/troubleshooting.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/benchmark_iteration.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/compare_iteration.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/eval_manifest.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/grade_eval_response.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/grade_iteration.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/prepare_eval_prompts.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/prepare_eval_workspace.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/render_eval_review.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/skills/slcli/scripts/spec_import_helper.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/spec_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/ssl_trust.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/state_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/system_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/system_query_utils.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/systemlink-logo.svg +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/table_utils.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/tag_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/templates_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/testmonitor_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/universal_handlers.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/user_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/utils.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/version_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/web_editor.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_bootstrap.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/.gitignore +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/angular.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/package.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/scripts/filter-sbom.js +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app-routing.module.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/app.module.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/layout/app-shell.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/state/app-view-state.service.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-context.service.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/systemlink-locale.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/theme-sync.service.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/core/systemlink/webapp-home-data.service.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/assets/assets-page.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/datasets/datasets-page.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/home/home-page.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/master-detail/master-detail-page.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/operations/operations-page.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/features/settings/settings-page.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/empty-state.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/error-banner.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/components/loading-state.component.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/app/shared/states/view-state.model.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/assets/README.md +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/index.html +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.de.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.en.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.es.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.fr.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.ja.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.ko.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/locale/messages.zh.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/localize.d.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/main.ts +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/src/styles.scss +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/tsconfig.app.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/webapp_templates/angular/blank/tsconfig.json +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/workflow_preview.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/workflows_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/workitem_click.py +0 -0
- {systemlink_cli-3.1.0 → systemlink_cli-3.2.1}/slcli/workspace_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: systemlink-cli
|
|
3
|
-
Version: 3.1
|
|
3
|
+
Version: 3.2.1
|
|
4
4
|
Summary: SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates.
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: Fred Visser
|
|
@@ -37,4 +37,5 @@ Requires-Dist: rich (>=15,<16)
|
|
|
37
37
|
Requires-Dist: rich-click (>=1.8,<2)
|
|
38
38
|
Requires-Dist: tabulate (>=0.10.0,<0.11.0)
|
|
39
39
|
Requires-Dist: truststore (>=0.9,<0.11)
|
|
40
|
+
Requires-Dist: urllib3 (>=2,<3)
|
|
40
41
|
Requires-Dist: watchdog (>=6.0.0,<7.0.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "systemlink-cli"
|
|
3
|
-
version = "3.1
|
|
3
|
+
version = "3.2.1"
|
|
4
4
|
description = "SystemLink Integrator CLI - cross-platform CLI for SystemLink workflows and templates."
|
|
5
5
|
authors = ["Fred Visser <fred.visser@emerson.com>"]
|
|
6
6
|
packages = [{ include = "slcli" }]
|
|
@@ -29,6 +29,7 @@ click = ">=7.1.2"
|
|
|
29
29
|
filelock = ">=4,<5"
|
|
30
30
|
keyring = "^25.6.0"
|
|
31
31
|
requests = "^2.32.4"
|
|
32
|
+
urllib3 = ">=2,<3"
|
|
32
33
|
idna = ">=3.10,<4"
|
|
33
34
|
tabulate = "^0.10.0"
|
|
34
35
|
truststore = ">=0.9,<0.11"
|
|
@@ -113,6 +114,7 @@ filterwarnings = [
|
|
|
113
114
|
markers = [
|
|
114
115
|
"e2e: marks tests as end-to-end tests (not run by default)",
|
|
115
116
|
"e2e_migration: marks migration end-to-end tests",
|
|
117
|
+
"e2e_migration_manual: marks opt-in migration E2E tests that must be run against a throw-away destination",
|
|
116
118
|
"full_os_client_matrix: marks tests requiring full supported-OS client coverage",
|
|
117
119
|
"slow: marks tests as slow running",
|
|
118
120
|
"notebook: marks tests as notebook-related",
|
|
@@ -82,7 +82,7 @@ def _validate_prefect_api_url(
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
def register_migrate_command(cli: click.Group) -> None:
|
|
85
|
-
"""Register the
|
|
85
|
+
"""Register the migrate command, hidden without the migration extra."""
|
|
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.")
|
|
@@ -97,10 +97,12 @@ def register_migrate_command(cli: click.Group) -> None:
|
|
|
97
97
|
"Comma-delimited SOURCE or SOURCE:DESTINATION workspace mappings. "
|
|
98
98
|
"Escape ',' or ':' in a workspace name with a backslash, for example Lab\\:A:Dest. "
|
|
99
99
|
"Only the listed source workspaces are migrated; all when omitted. "
|
|
100
|
-
"
|
|
100
|
+
"Missing destination workspaces are created unless the destination profile is readonly."
|
|
101
101
|
),
|
|
102
102
|
)
|
|
103
|
-
@click.option("--migration-id", help="
|
|
103
|
+
@click.option("--migration-id", help="Resume an existing migration.")
|
|
104
|
+
@click.option("--product-batch-size", type=click.IntRange(min=1), default=None, hidden=True)
|
|
105
|
+
@click.option("--result-batch-size", type=click.IntRange(min=1), default=None, hidden=True)
|
|
104
106
|
@click.option(
|
|
105
107
|
"--prefect-api-url",
|
|
106
108
|
callback=_validate_prefect_api_url,
|
|
@@ -111,14 +113,22 @@ def register_migrate_command(cli: click.Group) -> None:
|
|
|
111
113
|
destination_profile: Optional[str],
|
|
112
114
|
workspace_mappings: Optional[Dict[str, str]],
|
|
113
115
|
migration_id: Optional[str],
|
|
116
|
+
product_batch_size: Optional[int],
|
|
117
|
+
result_batch_size: Optional[int],
|
|
114
118
|
prefect_api_url: Optional[str],
|
|
115
119
|
) -> None:
|
|
116
120
|
"""Discover and migrate resources from a SystemLink Server."""
|
|
117
|
-
new_run_options = (
|
|
121
|
+
new_run_options = (
|
|
122
|
+
source_profile,
|
|
123
|
+
destination_profile,
|
|
124
|
+
workspace_mappings,
|
|
125
|
+
product_batch_size,
|
|
126
|
+
result_batch_size,
|
|
127
|
+
)
|
|
118
128
|
if migration_id is not None and any(value is not None for value in new_run_options):
|
|
119
129
|
raise click.UsageError(
|
|
120
130
|
"--migration-id cannot be combined with --source-profile, "
|
|
121
|
-
"--destination-profile,
|
|
131
|
+
"--destination-profile, --workspace-mappings, or batch sizes"
|
|
122
132
|
)
|
|
123
133
|
if migration_id is None and (source_profile is None or destination_profile is None):
|
|
124
134
|
raise click.UsageError(
|
|
@@ -139,6 +149,18 @@ def register_migrate_command(cli: click.Group) -> None:
|
|
|
139
149
|
if migration_id is not None:
|
|
140
150
|
command.resume_migration(migration_id, prefect_api_url)
|
|
141
151
|
elif source_profile is not None and destination_profile is not None:
|
|
152
|
+
batch_sizes = {
|
|
153
|
+
key: value
|
|
154
|
+
for key, value in (
|
|
155
|
+
("product_batch_size", product_batch_size),
|
|
156
|
+
("result_batch_size", result_batch_size),
|
|
157
|
+
)
|
|
158
|
+
if value is not None
|
|
159
|
+
}
|
|
142
160
|
command.start_migration(
|
|
143
|
-
source_profile,
|
|
161
|
+
source_profile,
|
|
162
|
+
destination_profile,
|
|
163
|
+
workspace_mappings,
|
|
164
|
+
prefect_api_url,
|
|
165
|
+
**batch_sizes,
|
|
144
166
|
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Property annotations that mark migrated destination resources."""
|
|
2
|
+
|
|
3
|
+
SOURCE_ID = "Migration.SourceId"
|
|
4
|
+
SOURCE_HOSTNAME = "Migration.SourceHostname"
|
|
5
|
+
MIGRATION_ID = "Migration.Id"
|
|
6
|
+
STATUS = "Migration.Status"
|
|
7
|
+
STARTED_AT = "Migration.StartedAt"
|
|
8
|
+
COMPLETED_AT = "Migration.CompletedAt"
|
|
9
|
+
INCOMPLETE = "INCOMPLETE"
|
|
10
|
+
COMPLETE = "COMPLETE"
|
|
@@ -14,13 +14,21 @@ from slcli._version import __version__
|
|
|
14
14
|
from slcli.migration.connection import MigrationConnection, resolve_migration_connection
|
|
15
15
|
from slcli.migration.orchestration import prefect_server, run_migration
|
|
16
16
|
from slcli.migration.state import (
|
|
17
|
+
DEFAULT_PRODUCT_BATCH_SIZE,
|
|
18
|
+
DEFAULT_RESULT_BATCH_SIZE,
|
|
17
19
|
MigrationRun,
|
|
18
20
|
RunMetadata,
|
|
19
21
|
create_migration_run,
|
|
20
22
|
open_migration_run,
|
|
21
23
|
)
|
|
24
|
+
from slcli.migration.summary import (
|
|
25
|
+
failed_items,
|
|
26
|
+
format_migration_summary,
|
|
27
|
+
format_summary,
|
|
28
|
+
format_workspace_mapping,
|
|
29
|
+
)
|
|
22
30
|
from slcli.migration.testmonitor.models import TestMonitorDiscovery
|
|
23
|
-
from slcli.migration.workspaces import
|
|
31
|
+
from slcli.migration.workspaces import WorkspaceMappingError
|
|
24
32
|
from slcli.utils import handle_api_error
|
|
25
33
|
|
|
26
34
|
_logger = logging.getLogger("slcli.migration")
|
|
@@ -32,12 +40,20 @@ def start_migration(
|
|
|
32
40
|
destination_profile: str,
|
|
33
41
|
workspace_mappings: Optional[Dict[str, str]],
|
|
34
42
|
prefect_api_url: Optional[str],
|
|
43
|
+
product_batch_size: int = DEFAULT_PRODUCT_BATCH_SIZE,
|
|
44
|
+
result_batch_size: int = DEFAULT_RESULT_BATCH_SIZE,
|
|
35
45
|
) -> None:
|
|
36
|
-
"""Create a new migration run, then
|
|
46
|
+
"""Create a new migration run, then migrate resources."""
|
|
37
47
|
source = resolve_migration_connection(source_profile)
|
|
38
48
|
destination = resolve_migration_connection(destination_profile)
|
|
39
49
|
_echo_connections(source, destination)
|
|
40
|
-
run = create_migration_run(
|
|
50
|
+
run = create_migration_run(
|
|
51
|
+
source_profile,
|
|
52
|
+
destination_profile,
|
|
53
|
+
workspace_mappings,
|
|
54
|
+
product_batch_size=product_batch_size,
|
|
55
|
+
result_batch_size=result_batch_size,
|
|
56
|
+
)
|
|
41
57
|
_, metadata = open_migration_run(run.migration_id, run.directory.parent)
|
|
42
58
|
_migrate(run, metadata, source, destination, prefect_api_url)
|
|
43
59
|
|
|
@@ -54,37 +70,10 @@ def resume_migration(migration_id: str, prefect_api_url: Optional[str]) -> None:
|
|
|
54
70
|
_migrate(run, metadata, source, destination, prefect_api_url)
|
|
55
71
|
|
|
56
72
|
|
|
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
73
|
def _all_workspaces_failed(discovery: TestMonitorDiscovery) -> bool:
|
|
72
74
|
return bool(discovery.workspaces) and len(discovery.failures) == len(discovery.workspaces)
|
|
73
75
|
|
|
74
76
|
|
|
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
77
|
def _echo_connections(source: MigrationConnection, destination: MigrationConnection) -> None:
|
|
89
78
|
for role, connection in (("Source", source), ("Destination", destination)):
|
|
90
79
|
click.echo(f"{role}: {connection.profile_name} ({connection.base_url})")
|
|
@@ -96,15 +85,11 @@ def _echo_connections(source: MigrationConnection, destination: MigrationConnect
|
|
|
96
85
|
)
|
|
97
86
|
|
|
98
87
|
|
|
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.
|
|
88
|
+
def _mapping_error(exc: WorkspaceMappingError) -> click.ClickException:
|
|
103
89
|
hint = (
|
|
104
|
-
"
|
|
105
|
-
if
|
|
106
|
-
else "
|
|
107
|
-
"--workspace-mappings. Destination workspaces are not created by migration."
|
|
90
|
+
"Check that the requested source workspaces exist."
|
|
91
|
+
if exc.missing_source
|
|
92
|
+
else "Check destination workspace access and retry."
|
|
108
93
|
)
|
|
109
94
|
return click.ClickException(f"{exc}. {hint}")
|
|
110
95
|
|
|
@@ -140,7 +125,8 @@ def _migrate(
|
|
|
140
125
|
with _run_log(log_path):
|
|
141
126
|
_logger.info(
|
|
142
127
|
"Migration started: migration=%s cli=%s profile=%s endpoint=%s workspaces=%s "
|
|
143
|
-
"destination_profile=%s destination_endpoint=%s prefect_server=%s"
|
|
128
|
+
"destination_profile=%s destination_endpoint=%s prefect_server=%s "
|
|
129
|
+
"product_batch_size=%d result_batch_size=%d",
|
|
144
130
|
run.migration_id,
|
|
145
131
|
__version__,
|
|
146
132
|
source.profile_name,
|
|
@@ -149,13 +135,15 @@ def _migrate(
|
|
|
149
135
|
destination.profile_name,
|
|
150
136
|
destination.base_url,
|
|
151
137
|
server_mode,
|
|
138
|
+
metadata.product_batch_size,
|
|
139
|
+
metadata.result_batch_size,
|
|
152
140
|
)
|
|
153
141
|
try:
|
|
154
142
|
with prefect_server(run, prefect_api_url) as api_url:
|
|
155
143
|
outcome = run_migration(run, metadata, api_url)
|
|
156
144
|
except WorkspaceMappingError as exc:
|
|
157
145
|
_log_failure(exc, log_path)
|
|
158
|
-
raise _mapping_error(exc
|
|
146
|
+
raise _mapping_error(exc) from exc
|
|
159
147
|
except requests.RequestException as exc:
|
|
160
148
|
_log_failure(exc, log_path)
|
|
161
149
|
handle_api_error(exc)
|
|
@@ -171,17 +159,23 @@ def _migrate(
|
|
|
171
159
|
],
|
|
172
160
|
)
|
|
173
161
|
test_monitor = outcome.discovery.test_monitor
|
|
162
|
+
migration = outcome.test_monitor
|
|
163
|
+
failed = len(failed_items(migration.products)) + len(failed_items(migration.results))
|
|
174
164
|
_logger.info(
|
|
175
|
-
"
|
|
165
|
+
"Migration completed: products=%d results=%d failed_workspaces=%s failed_items=%d",
|
|
176
166
|
len(test_monitor.products),
|
|
177
167
|
len(test_monitor.results),
|
|
178
168
|
[failure.workspace for failure in test_monitor.failures],
|
|
169
|
+
failed,
|
|
179
170
|
)
|
|
180
171
|
click.echo(format_workspace_mapping(outcome.mapping))
|
|
181
172
|
click.echo(format_summary(test_monitor))
|
|
173
|
+
click.echo(format_migration_summary(migration))
|
|
182
174
|
click.echo(f"Log: {log_path}")
|
|
183
175
|
if _all_workspaces_failed(test_monitor):
|
|
184
176
|
raise click.ClickException("Discovery failed for every workspace.")
|
|
177
|
+
if failed:
|
|
178
|
+
raise click.ClickException(f"{failed} items failed to migrate.")
|
|
185
179
|
|
|
186
180
|
|
|
187
181
|
def _log_failure(exc: BaseException, log_path: Path) -> None:
|
|
@@ -1,24 +1,81 @@
|
|
|
1
1
|
"""Profile-explicit SystemLink connections for migration operations."""
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
from dataclasses import dataclass, field
|
|
4
|
-
from
|
|
5
|
+
from types import TracebackType
|
|
6
|
+
from typing import Any, Dict, Iterable, Optional, Union
|
|
5
7
|
|
|
6
8
|
import click
|
|
7
9
|
import requests
|
|
8
10
|
from requests.adapters import HTTPAdapter
|
|
11
|
+
from urllib3.connectionpool import ConnectionPool
|
|
12
|
+
from urllib3.response import BaseHTTPResponse
|
|
9
13
|
from urllib3.util.retry import Retry
|
|
10
14
|
|
|
11
15
|
from slcli.profiles import Profile, ProfileConfig
|
|
12
16
|
from slcli.ssl_trust import use_standard_ssl_context
|
|
13
17
|
from slcli.utils import get_auth_headers, profile_ssl_verify, resolve_profile_auth
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
_logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class LoggingRetry(Retry):
|
|
23
|
+
"""Retry policy that logs every retry decision to the migration log."""
|
|
24
|
+
|
|
25
|
+
def increment(
|
|
26
|
+
self,
|
|
27
|
+
method: Optional[str] = None,
|
|
28
|
+
url: Optional[str] = None,
|
|
29
|
+
response: Optional[BaseHTTPResponse] = None,
|
|
30
|
+
error: Optional[Exception] = None,
|
|
31
|
+
_pool: Optional[ConnectionPool] = None,
|
|
32
|
+
_stacktrace: Optional[TracebackType] = None,
|
|
33
|
+
) -> "LoggingRetry":
|
|
34
|
+
"""Log the retry decision, then defer to :class:`Retry`."""
|
|
35
|
+
reason = f"status={response.status}" if response is not None else type(error).__name__
|
|
36
|
+
try:
|
|
37
|
+
retry = super().increment(method, url, response, error, _pool, _stacktrace)
|
|
38
|
+
except Exception:
|
|
39
|
+
_logger.warning(
|
|
40
|
+
"HTTP retry exhausted: %s %s %s",
|
|
41
|
+
method,
|
|
42
|
+
url,
|
|
43
|
+
reason,
|
|
44
|
+
)
|
|
45
|
+
raise
|
|
46
|
+
_logger.warning(
|
|
47
|
+
"HTTP retry: %s %s %s attempt=%d backoff=%.1fs",
|
|
48
|
+
method,
|
|
49
|
+
url,
|
|
50
|
+
reason,
|
|
51
|
+
len(retry.history),
|
|
52
|
+
retry.get_backoff_time(),
|
|
53
|
+
)
|
|
54
|
+
return retry
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
_DEFAULT_RETRY = LoggingRetry(
|
|
18
58
|
total=5,
|
|
19
59
|
backoff_factor=0.5,
|
|
20
60
|
status_forcelist=(429, 500, 502, 503, 504),
|
|
21
|
-
allowed_methods=frozenset({"GET"
|
|
61
|
+
allowed_methods=frozenset({"GET"}),
|
|
62
|
+
respect_retry_after_header=True,
|
|
63
|
+
raise_on_status=False,
|
|
64
|
+
)
|
|
65
|
+
# Policy for read-only queries, including POST query endpoints, which are safe to replay.
|
|
66
|
+
_QUERY_RETRY = _DEFAULT_RETRY.new(allowed_methods=frozenset({"GET", "POST"}))
|
|
67
|
+
|
|
68
|
+
# Policy for destination writes. Only failures where the server did not process the
|
|
69
|
+
# request are retried: refused connections and explicit 429/503 back-pressure. Read
|
|
70
|
+
# timeouts and other 5xx responses are ambiguous and are never replayed.
|
|
71
|
+
_WRITE_RETRY = LoggingRetry(
|
|
72
|
+
total=5,
|
|
73
|
+
connect=5,
|
|
74
|
+
read=0,
|
|
75
|
+
other=0,
|
|
76
|
+
backoff_factor=1.0,
|
|
77
|
+
status_forcelist=(429, 503),
|
|
78
|
+
allowed_methods=None,
|
|
22
79
|
respect_retry_after_header=True,
|
|
23
80
|
raise_on_status=False,
|
|
24
81
|
)
|
|
@@ -40,18 +97,39 @@ class _ProfileSession(requests.Session):
|
|
|
40
97
|
|
|
41
98
|
@dataclass(frozen=True)
|
|
42
99
|
class MigrationConnection:
|
|
43
|
-
"""Endpoint, authentication, and
|
|
100
|
+
"""Endpoint, authentication, TLS, and read-only settings from a named profile."""
|
|
44
101
|
|
|
45
102
|
profile_name: str
|
|
46
103
|
base_url: str
|
|
47
104
|
headers: Dict[str, str] = field(repr=False)
|
|
48
105
|
ssl_verify: Union[bool, str] = True
|
|
106
|
+
readonly: bool = False
|
|
107
|
+
|
|
108
|
+
def create_session(self, query_paths: Iterable[str] = ()) -> requests.Session:
|
|
109
|
+
"""Return a session bound to this connection's credentials and TLS.
|
|
110
|
+
|
|
111
|
+
Requests are matched to a retry policy by URL prefix. URLs under any
|
|
112
|
+
``query_paths`` entry use the query policy, which replays POST requests.
|
|
113
|
+
All other URLs use the default policy, which never replays POST requests.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
query_paths: Route prefixes relative to ``base_url`` whose POST requests
|
|
117
|
+
are read-only queries, such as ``"nitestmonitor/v2/query-"``.
|
|
118
|
+
"""
|
|
119
|
+
session = self._session(_DEFAULT_RETRY)
|
|
120
|
+
base = self.base_url.rstrip("/")
|
|
121
|
+
for path in query_paths:
|
|
122
|
+
session.mount(f"{base}/{path.lstrip('/')}", HTTPAdapter(max_retries=_QUERY_RETRY))
|
|
123
|
+
return session
|
|
124
|
+
|
|
125
|
+
def create_write_session(self) -> requests.Session:
|
|
126
|
+
"""Return a session for non-idempotent writes that never replays ambiguous failures."""
|
|
127
|
+
return self._session(_WRITE_RETRY)
|
|
49
128
|
|
|
50
|
-
def
|
|
51
|
-
"""Return a query session bound to this connection's credentials and TLS."""
|
|
129
|
+
def _session(self, retry: Retry) -> requests.Session:
|
|
52
130
|
session = _ProfileSession(self.ssl_verify)
|
|
53
131
|
session.headers.update(self.headers)
|
|
54
|
-
adapter = HTTPAdapter(max_retries=
|
|
132
|
+
adapter = HTTPAdapter(max_retries=retry)
|
|
55
133
|
session.mount("https://", adapter)
|
|
56
134
|
session.mount("http://", adapter)
|
|
57
135
|
return session
|
|
@@ -94,4 +172,4 @@ def resolve_migration_connection(
|
|
|
94
172
|
if auth is None:
|
|
95
173
|
raise click.ClickException(f"Profile '{profile.name}' does not define an API key")
|
|
96
174
|
headers = get_auth_headers(auth.value, auth.scheme)
|
|
97
|
-
return MigrationConnection(profile.name, base_url, headers, ssl_verify)
|
|
175
|
+
return MigrationConnection(profile.name, base_url, headers, ssl_verify, profile.readonly)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Helpers shared by every resource type that migrates in batches."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from typing import Any, Iterable, List, Protocol, Sequence, Tuple, TypeVar
|
|
5
|
+
|
|
6
|
+
from prefect import allow_failure, unmapped
|
|
7
|
+
from prefect.futures import PrefectFuture, PrefectFutureList
|
|
8
|
+
|
|
9
|
+
from slcli.migration.testmonitor.models import BatchResult, FailedItem
|
|
10
|
+
from slcli.migration.workspaces import WorkspaceMapping
|
|
11
|
+
|
|
12
|
+
_T = TypeVar("_T")
|
|
13
|
+
_logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Identified(Protocol):
|
|
17
|
+
"""An item that reports failures by its source ID."""
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def id(self) -> str:
|
|
21
|
+
"""Return the source ID."""
|
|
22
|
+
...
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def partition(items: Sequence[_T], size: int) -> List[List[_T]]:
|
|
26
|
+
"""Split items into stable, ordered batches of at most ``size``."""
|
|
27
|
+
if size < 1:
|
|
28
|
+
raise ValueError("batch size must be at least 1")
|
|
29
|
+
return [list(items[start : start + size]) for start in range(0, len(items), size)]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def gather_batches(
|
|
33
|
+
resource: str,
|
|
34
|
+
batches: Sequence[Sequence[Identified]],
|
|
35
|
+
futures: PrefectFutureList[BatchResult],
|
|
36
|
+
) -> List[BatchResult]:
|
|
37
|
+
"""Wait for every batch; a batch that raised reports all of its items as failed."""
|
|
38
|
+
outcomes: List[BatchResult] = []
|
|
39
|
+
for index, (batch, future) in enumerate(zip(batches, futures)):
|
|
40
|
+
future.wait()
|
|
41
|
+
if future.state.is_completed():
|
|
42
|
+
outcomes.append(future.result())
|
|
43
|
+
continue
|
|
44
|
+
error = future.state.result(raise_on_failure=False)
|
|
45
|
+
error_type = type(error).__name__ if isinstance(error, BaseException) else "Failed"
|
|
46
|
+
_logger.error("Batch %s[%d] failed before migrating: %s", resource, index, error_type)
|
|
47
|
+
outcomes.append(
|
|
48
|
+
BatchResult(
|
|
49
|
+
resource=resource,
|
|
50
|
+
batch=index,
|
|
51
|
+
failed=tuple(
|
|
52
|
+
FailedItem(source_id=item.id, stage="batch", error_type=error_type)
|
|
53
|
+
for item in batch
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
return outcomes
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def after_all(futures: Iterable[PrefectFuture[Any]]) -> List[Any]:
|
|
61
|
+
"""Return ``wait_for`` dependencies that are met once every future finishes.
|
|
62
|
+
|
|
63
|
+
Unlike plain futures, these are met by failed and crashed futures too.
|
|
64
|
+
"""
|
|
65
|
+
# Prefect accepts allow_failure in wait_for but does not annotate it.
|
|
66
|
+
return [allow_failure(future) for future in futures]
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def shared_task_args(
|
|
70
|
+
migration_id: str, source_profile: str, destination_profile: str, mapping: WorkspaceMapping
|
|
71
|
+
) -> Tuple[Any, ...]:
|
|
72
|
+
"""Return the leading arguments every batch task receives.
|
|
73
|
+
|
|
74
|
+
``Task.map`` iterates sequence arguments; ``unmapped`` passes these unchanged
|
|
75
|
+
to every batch instead.
|
|
76
|
+
"""
|
|
77
|
+
return (
|
|
78
|
+
unmapped(migration_id),
|
|
79
|
+
unmapped(source_profile),
|
|
80
|
+
unmapped(destination_profile),
|
|
81
|
+
unmapped(mapping),
|
|
82
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Migration flow: discover, then
|
|
1
|
+
"""Migration flow: discover, synchronize workspaces, then migrate each resource type."""
|
|
2
2
|
|
|
3
3
|
from typing import Dict, List, Optional
|
|
4
4
|
|
|
@@ -6,18 +6,22 @@ from prefect import flow
|
|
|
6
6
|
from pydantic import ConfigDict
|
|
7
7
|
|
|
8
8
|
from slcli.migration.flows.discover import MigrationDiscovery, discover_flow
|
|
9
|
+
from slcli.migration.flows.service import migration_task_runner
|
|
9
10
|
from slcli.migration.schema import VersionedModel
|
|
11
|
+
from slcli.migration.testmonitor.migration_task import migrate_test_monitor_task
|
|
12
|
+
from slcli.migration.testmonitor.models import TestMonitorMigration
|
|
10
13
|
from slcli.migration.workspace_task import synchronize_workspaces_task
|
|
11
14
|
from slcli.migration.workspaces import WorkspaceMapping
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
class MigrationOutcome(VersionedModel):
|
|
15
|
-
"""
|
|
18
|
+
"""Workspace mapping, discovery, and migration outcomes of one run."""
|
|
16
19
|
|
|
17
20
|
model_config = ConfigDict(frozen=True)
|
|
18
21
|
|
|
19
|
-
discovery: MigrationDiscovery
|
|
20
22
|
mapping: WorkspaceMapping
|
|
23
|
+
discovery: MigrationDiscovery
|
|
24
|
+
test_monitor: TestMonitorMigration
|
|
21
25
|
|
|
22
26
|
|
|
23
27
|
@flow(
|
|
@@ -25,29 +29,48 @@ class MigrationOutcome(VersionedModel):
|
|
|
25
29
|
flow_run_name="migration-{migration_id}",
|
|
26
30
|
persist_result=True,
|
|
27
31
|
result_serializer="json",
|
|
32
|
+
task_runner=migration_task_runner(),
|
|
28
33
|
)
|
|
29
34
|
def migrate_flow(
|
|
30
35
|
migration_id: str,
|
|
31
36
|
source_profile: str,
|
|
32
37
|
destination_profile: str,
|
|
33
38
|
workspace_mappings: Optional[Dict[str, str]],
|
|
39
|
+
product_batch_size: int,
|
|
40
|
+
result_batch_size: int,
|
|
34
41
|
) -> MigrationOutcome:
|
|
35
|
-
"""Discover source resources,
|
|
42
|
+
"""Discover source resources, synchronize workspaces, then migrate resources.
|
|
43
|
+
|
|
44
|
+
Each resource type is a service task (see :func:`service_task`). Submitted
|
|
45
|
+
service tasks run in parallel; pass ``wait_for`` to sequence them.
|
|
36
46
|
|
|
37
47
|
Args:
|
|
38
48
|
migration_id: Migration that scopes task cache keys.
|
|
39
49
|
source_profile: Name of the source profile.
|
|
40
50
|
destination_profile: Name of the destination profile.
|
|
41
51
|
workspace_mappings: Source to destination workspace names; all by name when None.
|
|
52
|
+
product_batch_size: Products per migration task.
|
|
53
|
+
result_batch_size: Results, with their steps, per migration task.
|
|
42
54
|
|
|
43
55
|
Raises:
|
|
44
|
-
WorkspaceMappingError: If a source
|
|
56
|
+
WorkspaceMappingError: If a source workspace does not exist.
|
|
45
57
|
"""
|
|
46
|
-
|
|
58
|
+
workspace_subset_to_migrate: Optional[List[str]] = (
|
|
47
59
|
list(workspace_mappings) if workspace_mappings is not None else None
|
|
48
60
|
)
|
|
49
|
-
discovery = discover_flow(migration_id, source_profile,
|
|
61
|
+
discovery = discover_flow(migration_id, source_profile, workspace_subset_to_migrate)
|
|
50
62
|
mapping = synchronize_workspaces_task(
|
|
51
63
|
migration_id, destination_profile, discovery.workspaces, workspace_mappings
|
|
52
64
|
)
|
|
53
|
-
|
|
65
|
+
test_monitor = migrate_test_monitor_task.submit(
|
|
66
|
+
migration_id,
|
|
67
|
+
source_profile,
|
|
68
|
+
destination_profile,
|
|
69
|
+
mapping,
|
|
70
|
+
discovery.test_monitor,
|
|
71
|
+
product_batch_size,
|
|
72
|
+
result_batch_size,
|
|
73
|
+
)
|
|
74
|
+
return MigrationOutcome(
|
|
75
|
+
mapping=mapping, discovery=discovery, test_monitor=test_monitor.result()
|
|
76
|
+
)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Service tasks: one Prefect task per resource type that runs its own batch tasks."""
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
import sys
|
|
5
|
+
from typing import Any, Callable, List, Optional, ParamSpec, TypeVar, cast
|
|
6
|
+
|
|
7
|
+
from prefect import Task, task
|
|
8
|
+
from prefect.cache_policies import NO_CACHE
|
|
9
|
+
from prefect.futures import PrefectFuture
|
|
10
|
+
from prefect.task_runners import TaskRunner, ThreadPoolTaskRunner
|
|
11
|
+
from prefect.transactions import CommitMode, transaction
|
|
12
|
+
|
|
13
|
+
_P = ParamSpec("_P")
|
|
14
|
+
_R = TypeVar("_R")
|
|
15
|
+
|
|
16
|
+
SERVICE_TASKS: List[Task] = [] # type: ignore[type-arg]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def service_task(name: str) -> Callable[[Callable[_P, _R]], Task[_P, _R]]:
|
|
20
|
+
"""Declare the task that migrates one resource type through batch tasks.
|
|
21
|
+
|
|
22
|
+
The body runs in an eager transaction. By default, nested task results are
|
|
23
|
+
staged in the parent task's transaction and discarded if the parent does not
|
|
24
|
+
finish, so a resumed run would migrate completed batches again. Eager commits
|
|
25
|
+
persist each batch result as soon as that batch finishes.
|
|
26
|
+
|
|
27
|
+
Service tasks are registered so :func:`migration_task_runner` can reserve a
|
|
28
|
+
worker for each one while it waits for its batches.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
name: Prefect task name.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def decorate(fn: Callable[_P, _R]) -> Task[_P, _R]:
|
|
35
|
+
@functools.wraps(fn)
|
|
36
|
+
def run_eagerly(*args: _P.args, **kwargs: _P.kwargs) -> _R:
|
|
37
|
+
with transaction(commit_mode=CommitMode.EAGER):
|
|
38
|
+
return fn(*args, **kwargs)
|
|
39
|
+
|
|
40
|
+
# Batch tasks are the unit of caching; the service only composes them.
|
|
41
|
+
service: Task[_P, _R] = task(name=name, cache_policy=NO_CACHE)(run_eagerly)
|
|
42
|
+
SERVICE_TASKS.append(service)
|
|
43
|
+
return service
|
|
44
|
+
|
|
45
|
+
return decorate
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def migration_task_runner(batch_workers: Optional[int] = None) -> TaskRunner[PrefectFuture[Any]]:
|
|
49
|
+
"""Return the thread pool for the migration flow.
|
|
50
|
+
|
|
51
|
+
Each running service task holds a worker while it waits for its batches, so
|
|
52
|
+
a pool no larger than the number of services deadlocks. The pool reserves a
|
|
53
|
+
worker per registered service on top of ``batch_workers``.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
batch_workers: Batch tasks that may run at once; unbounded when None,
|
|
57
|
+
regardless of Prefect's thread pool setting.
|
|
58
|
+
"""
|
|
59
|
+
if batch_workers is None:
|
|
60
|
+
max_workers = sys.maxsize
|
|
61
|
+
elif batch_workers < 1:
|
|
62
|
+
raise ValueError("batch_workers must be at least 1")
|
|
63
|
+
else:
|
|
64
|
+
max_workers = len(SERVICE_TASKS) + batch_workers
|
|
65
|
+
# The flow decorator's annotation does not accept ThreadPoolTaskRunner's future type.
|
|
66
|
+
return cast(TaskRunner[PrefectFuture[Any]], ThreadPoolTaskRunner(max_workers=max_workers))
|
|
@@ -69,12 +69,16 @@ def run_discovery(
|
|
|
69
69
|
return discover_flow(run.migration_id, source_profile, workspaces)
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
def run_migration(
|
|
72
|
+
def run_migration(
|
|
73
|
+
run: MigrationRun,
|
|
74
|
+
metadata: RunMetadata,
|
|
75
|
+
api_url: str,
|
|
76
|
+
) -> MigrationOutcome:
|
|
73
77
|
"""Run the migration flow for a run on a Prefect server.
|
|
74
78
|
|
|
75
79
|
Args:
|
|
76
80
|
run: Migration run that provides the client home and result storage.
|
|
77
|
-
metadata: Persisted run inputs, including profiles and
|
|
81
|
+
metadata: Persisted run inputs, including profiles and batch sizes.
|
|
78
82
|
api_url: Prefect API URL from :func:`prefect_server`.
|
|
79
83
|
"""
|
|
80
84
|
with _run_settings(run, api_url):
|
|
@@ -83,4 +87,6 @@ def run_migration(run: MigrationRun, metadata: RunMetadata, api_url: str) -> Mig
|
|
|
83
87
|
metadata.source_profile,
|
|
84
88
|
metadata.destination_profile,
|
|
85
89
|
metadata.workspace_mappings,
|
|
90
|
+
metadata.product_batch_size,
|
|
91
|
+
metadata.result_batch_size,
|
|
86
92
|
)
|