sanka-cli 0.2.13__tar.gz → 0.2.15__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.
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/.gitignore +2 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/PKG-INFO +2 -2
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/README.md +1 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/pyproject.toml +1 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/cli/__init__.py +10 -101
- sanka_cli-0.2.15/src/sanka/cli/_research.py +138 -0
- sanka_cli-0.2.15/src/sanka/cli/_summary.py +271 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/discovery.py +6 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/lifecycle.py +11 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/store.py +42 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/host.py +8 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/lifecycle.py +195 -10
- sanka_cli-0.2.15/src/sanka/runtime/flow/native_verification.py +521 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/planner.py +20 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/verification.py +4 -0
- sanka_cli-0.2.15/src/sanka/runtime/flow/verification_plan.py +88 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/model.py +5 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/record_mapping.py +39 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/planner.py +6 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/__init__.py +1 -1
- sanka_cli-0.2.15/src/sanka_cli/cloud_source.py +127 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/auth.py +6 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/cloud.py +4 -2
- sanka_cli-0.2.15/src/sanka_cli/commands/cloud_github.py +105 -0
- sanka_cli-0.2.15/src/sanka_cli/commands/code_cloud.py +361 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/doctor.py +71 -1
- sanka_cli-0.2.15/src/sanka_cli/commands/fix.py +255 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/migrate.py +24 -1
- sanka_cli-0.2.15/src/sanka_cli/commands/workflow_templates.py +92 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/workflows.py +43 -2
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/main.py +4 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/__init__.py +27 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/blueprint.py +74 -16
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/native.py +12 -1
- sanka_cli-0.2.15/src/sanka_extensions/flow/native_fixtures.py +371 -0
- sanka_cli-0.2.15/src/sanka_extensions/flow/native_process_recipes.py +216 -0
- sanka_cli-0.2.15/src/sanka_extensions/flow/native_profiles.py +51 -0
- sanka_cli-0.2.15/src/sanka_extensions/flow/native_recipes.py +277 -0
- sanka_cli-0.2.15/src/sanka_extensions/flow/native_task_recipes.py +273 -0
- sanka_cli-0.2.15/src/sanka_extensions/flow/native_verification.py +370 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/protocol.py +66 -5
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/flow_wheel_acceptance.py +39 -12
- sanka_cli-0.2.15/tests/test_application_summary.py +165 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_cli.py +15 -109
- sanka_cli-0.2.15/tests/test_doctor.py +204 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_extension_lifecycle.py +52 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_extension.py +5 -2
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_extension_wheel_acceptance.py +27 -7
- sanka_cli-0.2.15/tests/test_flow_native_lifecycle.py +466 -0
- sanka_cli-0.2.15/tests/test_flow_native_verification.py +523 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_hosted_cli.py +17 -8
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_mapping_record_mapping.py +62 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_mcp_retirement.py +1 -1
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_planner.py +1 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_sanka_facade.py +1 -1
- sanka_cli-0.2.15/tests/test_workflow_templates_cli.py +162 -0
- sanka_cli-0.2.13/src/sanka/cli/_research.py +0 -329
- sanka_cli-0.2.13/tests/test_doctor.py +0 -97
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/LICENSES/AGPL-3.0-only.txt +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/LICENSES/Apache-2.0.txt +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/NOTICE +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/_client.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/cli/_compact.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/cli/_output.py +0 -0
- {sanka_cli-0.2.13/src/sanka_extensions/systems → sanka_cli-0.2.15/src/sanka/cli}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/connector/__init__.py +0 -0
- {sanka_cli-0.2.13/src/sanka_extensions → sanka_cli-0.2.15/src/sanka/connector}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/__about__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/concurrency.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/connector_client.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/connector_host.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/engine.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/continuous.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/errors.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/local.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/model.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/report_codec.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/routes.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/scope.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/state.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/execution/validate.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/artifacts.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/code_lifecycle.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/code_repair.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/model.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/runner.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/extensions/stage.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/extension.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/merge.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/model.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/sqlite.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/flow/state.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/hashing.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/errors.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/mapping_candidates.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/owner_mapping.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/mapping/pending_relationships.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/private_sqlite.py +0 -0
- {sanka_cli-0.2.13/src/sanka_extensions/data → sanka_cli-0.2.15/src/sanka/runtime}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/registry.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/safe_local_io.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/spec.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka/runtime/state.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/__main__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/bundle.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/certificates.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/client.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/ai.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/cloud_fleet.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/cloud_migrate.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/code.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/functions.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/profiles.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/resources.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/commands/skill.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/config.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/output.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/runtime.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/skills/sanka-cli/SKILL.md +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_cli/state.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/__about__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/credentials.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/errors.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/protocols.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/provisioning.py +0 -0
- {sanka_cli-0.2.13/src/sanka_extension_sdk → sanka_cli-0.2.15/src/sanka_connector}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/records.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/registration.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_connector/schema.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extension_sdk/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extension_sdk/contract.py +0 -0
- {sanka_cli-0.2.13/src/sanka_connector → sanka_cli-0.2.15/src/sanka_extension_sdk}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/code/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/code/contract.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/__about__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/credentials.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/errors.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/protocols.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/provisioning.py +0 -0
- {sanka_cli-0.2.13/src/sanka/runtime → sanka_cli-0.2.15/src/sanka_extensions/data}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/records.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/registration.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/data/schema.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/_wire.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/definition.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/graph.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/identity.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/scenario.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/flow/source.py +0 -0
- {sanka_cli-0.2.13/src/sanka/connector → sanka_cli-0.2.15/src/sanka_extensions}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/__about__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/credentials.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/errors.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/protocols.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/provisioning.py +0 -0
- {sanka_cli-0.2.13/src/sanka/cli → sanka_cli-0.2.15/src/sanka_extensions/systems}/py.typed +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/records.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/registration.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/src/sanka_extensions/systems/schema.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/conftest.py +0 -0
- {sanka_cli-0.2.13/tests/fixtures/extension_drf_project/config → sanka_cli-0.2.15/tests/fixtures/extension_drf_project/api}/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_drf_project/api/serializers.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_drf_project/api/views.py +0 -0
- {sanka_cli-0.2.13/tests/fixtures/extension_drf_project/api → sanka_cli-0.2.15/tests/fixtures/extension_drf_project/config}/__init__.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_drf_project/config/settings.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_drf_project/config/urls.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_drf_project/manage.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_marketplace/drf-to-fastapi.json +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/extension_marketplace/marketplace.json +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/flow/synthetic_native_order_billing_blueprint.json +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/flow/synthetic_sales_created_estimate_blueprint.json +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/fixtures/flow/synthetic_sales_quote_blueprint.json +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_business_flow_extension_acceptance.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_cli_developer_experience.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_code_bundle.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_code_commands.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_code_lifecycle.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_code_repair.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_concurrency.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_connector_client.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_connector_host.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_credential_provider.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_engine_e2e.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_engine_execution_adoption.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_engine_pg_to_clickhouse_e2e.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_engine_postgres_e2e.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_continuous.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_exact_scope.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_local_store.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_report_codec.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_routes.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_scope.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_seam.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_execution_validate.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_extension_discovery.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_extension_runner.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_extension_stage.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_extension_store.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_extension_wheel_acceptance.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_lifecycle.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_merge.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_planner.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_sdk_codec.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_sqlite.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_flow_verification.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_hashing.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_mapping_candidates.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_mapping_owner_mapping.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_mapping_pending_relationships.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_registry.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_safe_local_io.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_skill_commands.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_spec.py +0 -0
- {sanka_cli-0.2.13 → sanka_cli-0.2.15}/tests/test_state_store.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sanka-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.15
|
|
4
4
|
Summary: Sanka command-line interface and migration runtime
|
|
5
5
|
Project-URL: Repository, https://github.com/sankaHQ/sanka
|
|
6
6
|
Project-URL: Issues, https://github.com/sankaHQ/sanka/issues
|
|
@@ -123,7 +123,7 @@ Custom functions use `sanka functions`; the old `sanka code` group keeps its ori
|
|
|
123
123
|
function operations as a compatibility alias. Sanka Code migration commands remain
|
|
124
124
|
`scan`, `plan`, `apply`, `test`, and `verify`.
|
|
125
125
|
|
|
126
|
-
`--base-url` also selects the API origin for anonymous
|
|
126
|
+
`--base-url` also selects the API origin for the anonymous assessment. A full
|
|
127
127
|
migration-service URL in `SANKA_MIGRATE_API_BASE` is retained as a fallback.
|
|
128
128
|
|
|
129
129
|
## Hosted repository runs
|
|
@@ -96,7 +96,7 @@ Custom functions use `sanka functions`; the old `sanka code` group keeps its ori
|
|
|
96
96
|
function operations as a compatibility alias. Sanka Code migration commands remain
|
|
97
97
|
`scan`, `plan`, `apply`, `test`, and `verify`.
|
|
98
98
|
|
|
99
|
-
`--base-url` also selects the API origin for anonymous
|
|
99
|
+
`--base-url` also selects the API origin for the anonymous assessment. A full
|
|
100
100
|
migration-service URL in `SANKA_MIGRATE_API_BASE` is retained as a fallback.
|
|
101
101
|
|
|
102
102
|
## Hosted repository runs
|
|
@@ -44,9 +44,9 @@ from sanka.cli._output import TerminalOutput
|
|
|
44
44
|
from sanka.cli._research import (
|
|
45
45
|
SankaMigrateApiClient,
|
|
46
46
|
SankaMigrateApiError,
|
|
47
|
-
print_research,
|
|
48
47
|
signup_url,
|
|
49
48
|
)
|
|
49
|
+
from sanka.cli._summary import application_summary
|
|
50
50
|
from sanka.runtime.__about__ import __version__
|
|
51
51
|
from sanka.runtime.engine import ExecutionError, MigrationEngine, VerifyReport
|
|
52
52
|
from sanka.runtime.execution import DEFAULT_VALIDATION_SAMPLE_SIZE
|
|
@@ -557,36 +557,6 @@ def _build_parser(*, json_errors: bool = False) -> argparse.ArgumentParser:
|
|
|
557
557
|
connect.add_argument("--json", action="store_true", help="print provider details as JSON")
|
|
558
558
|
connect.set_defaults(handler=_cmd_connect)
|
|
559
559
|
|
|
560
|
-
research = commands.add_parser(
|
|
561
|
-
"research",
|
|
562
|
-
help="query cited Sanka lifecycle, cost, and comparison research",
|
|
563
|
-
)
|
|
564
|
-
research_commands = research.add_subparsers(dest="research_command", required=True)
|
|
565
|
-
|
|
566
|
-
eol = research_commands.add_parser("eol", help="query software lifecycle events")
|
|
567
|
-
eol.add_argument("product", nargs="?")
|
|
568
|
-
eol.add_argument("--category")
|
|
569
|
-
eol.add_argument(
|
|
570
|
-
"--type",
|
|
571
|
-
choices=("shutdown", "end_of_support", "maintenance_end", "version_lifecycle"),
|
|
572
|
-
)
|
|
573
|
-
eol.add_argument("--after", help="inclusive YYYY-MM lower bound")
|
|
574
|
-
eol.add_argument("--before", help="inclusive YYYY-MM upper bound")
|
|
575
|
-
_research_output_options(eol)
|
|
576
|
-
eol.set_defaults(handler=_cmd_research_eol)
|
|
577
|
-
|
|
578
|
-
tco = research_commands.add_parser("tco", help="query published cost benchmarks")
|
|
579
|
-
tco.add_argument("product", nargs="?")
|
|
580
|
-
tco.add_argument("--category")
|
|
581
|
-
_research_output_options(tco)
|
|
582
|
-
tco.set_defaults(handler=_cmd_research_tco)
|
|
583
|
-
|
|
584
|
-
compare = research_commands.add_parser("compare", help="compare migration capabilities")
|
|
585
|
-
compare.add_argument("category")
|
|
586
|
-
compare.add_argument("--platforms", help="comma-separated platform slugs (maximum 10)")
|
|
587
|
-
_research_output_options(compare)
|
|
588
|
-
compare.set_defaults(handler=_cmd_research_compare)
|
|
589
|
-
|
|
590
560
|
assess = commands.add_parser("assess", help="submit a free migration assessment")
|
|
591
561
|
assess.add_argument("--source")
|
|
592
562
|
assess.add_argument("--destination")
|
|
@@ -667,11 +637,6 @@ def _set_json_errors(parser: argparse.ArgumentParser, enabled: bool) -> None:
|
|
|
667
637
|
_set_json_errors(child, enabled)
|
|
668
638
|
|
|
669
639
|
|
|
670
|
-
def _research_output_options(parser: argparse.ArgumentParser) -> None:
|
|
671
|
-
parser.add_argument("--lang", choices=("en", "ja"), dest="locale")
|
|
672
|
-
parser.add_argument("--json", action="store_true", help="print the API data payload as JSON")
|
|
673
|
-
|
|
674
|
-
|
|
675
640
|
def _research_client(api_base: str | None = None) -> SankaMigrateApiClient:
|
|
676
641
|
# The shared CLI option names an API origin (optionally with a path prefix).
|
|
677
642
|
# The older SANKA_MIGRATE_API_BASE setting continues to name the full service root.
|
|
@@ -947,9 +912,18 @@ def _print_application_result(
|
|
|
947
912
|
)
|
|
948
913
|
else:
|
|
949
914
|
terminal = _terminal(args)
|
|
915
|
+
quiet = bool(getattr(args, "quiet", False))
|
|
916
|
+
summary, next_hint = application_summary(command, result.data, root=args.root)
|
|
917
|
+
if not quiet:
|
|
918
|
+
for line in summary:
|
|
919
|
+
print(line)
|
|
920
|
+
if summary:
|
|
921
|
+
print()
|
|
950
922
|
terminal.success(f"{command} complete")
|
|
951
923
|
if command == "plan" and isinstance(result.data.get("plan_hash"), str):
|
|
952
924
|
print(f"plan {result.data['plan_hash']}")
|
|
925
|
+
if next_hint and not quiet:
|
|
926
|
+
print(f"next: {next_hint}")
|
|
953
927
|
return 0
|
|
954
928
|
|
|
955
929
|
|
|
@@ -1168,44 +1142,6 @@ async def _cmd_migrate(args: argparse.Namespace) -> int:
|
|
|
1168
1142
|
return 0 if report.ok else 1
|
|
1169
1143
|
|
|
1170
1144
|
|
|
1171
|
-
async def _cmd_research_eol(args: argparse.Namespace) -> int:
|
|
1172
|
-
data = await asyncio.to_thread(
|
|
1173
|
-
_research_client(getattr(args, "api_base", None)).research_eol,
|
|
1174
|
-
product=args.product,
|
|
1175
|
-
category=args.category,
|
|
1176
|
-
event_type=args.type,
|
|
1177
|
-
after=args.after,
|
|
1178
|
-
before=args.before,
|
|
1179
|
-
locale=args.locale,
|
|
1180
|
-
)
|
|
1181
|
-
return _print_research_result(data, kind="eol", locale=args.locale, as_json=args.json)
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
async def _cmd_research_tco(args: argparse.Namespace) -> int:
|
|
1185
|
-
data = await asyncio.to_thread(
|
|
1186
|
-
_research_client(getattr(args, "api_base", None)).research_tco,
|
|
1187
|
-
product=args.product,
|
|
1188
|
-
category=args.category,
|
|
1189
|
-
locale=args.locale,
|
|
1190
|
-
)
|
|
1191
|
-
return _print_research_result(data, kind="tco", locale=args.locale, as_json=args.json)
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
async def _cmd_research_compare(args: argparse.Namespace) -> int:
|
|
1195
|
-
if args.platforms and len([item for item in args.platforms.split(",") if item.strip()]) > 10:
|
|
1196
|
-
raise SankaMigrateApiError(
|
|
1197
|
-
"SANKA_MIGRATE_INPUT_INVALID",
|
|
1198
|
-
"--platforms accepts at most 10 comma-separated values.",
|
|
1199
|
-
)
|
|
1200
|
-
data = await asyncio.to_thread(
|
|
1201
|
-
_research_client(getattr(args, "api_base", None)).research_compare,
|
|
1202
|
-
category=args.category,
|
|
1203
|
-
platforms=args.platforms,
|
|
1204
|
-
locale=args.locale,
|
|
1205
|
-
)
|
|
1206
|
-
return _print_research_result(data, kind="compare", locale=args.locale, as_json=args.json)
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
1145
|
async def _cmd_assess(args: argparse.Namespace) -> int:
|
|
1210
1146
|
answers = [
|
|
1211
1147
|
args.source,
|
|
@@ -1259,33 +1195,6 @@ async def _cmd_assess(args: argparse.Namespace) -> int:
|
|
|
1259
1195
|
return 0
|
|
1260
1196
|
|
|
1261
1197
|
|
|
1262
|
-
def _print_research_result(
|
|
1263
|
-
data: dict[str, Any],
|
|
1264
|
-
*,
|
|
1265
|
-
kind: str,
|
|
1266
|
-
locale: str | None,
|
|
1267
|
-
as_json: bool,
|
|
1268
|
-
) -> int:
|
|
1269
|
-
if as_json:
|
|
1270
|
-
print(json.dumps(data, ensure_ascii=False, indent=2))
|
|
1271
|
-
return 0 if _research_has_results(data, kind=kind) else 2
|
|
1272
|
-
return print_research(data, kind=kind, locale=locale)
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
def _research_has_results(data: dict[str, Any], *, kind: str) -> bool:
|
|
1276
|
-
if kind == "eol":
|
|
1277
|
-
if isinstance(data.get("events"), list):
|
|
1278
|
-
return bool(data["events"])
|
|
1279
|
-
product = data.get("product")
|
|
1280
|
-
return isinstance(product, dict) and bool(product.get("events"))
|
|
1281
|
-
if kind == "tco":
|
|
1282
|
-
if isinstance(data.get("benchmarks"), list):
|
|
1283
|
-
return bool(data["benchmarks"])
|
|
1284
|
-
product = data.get("product")
|
|
1285
|
-
return isinstance(product, dict) and bool(product.get("plans"))
|
|
1286
|
-
return bool(data.get("platforms"))
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
1198
|
def _infer_endpoint(value: str, *, role: str) -> EndpointSpec:
|
|
1290
1199
|
"""Map a CLI shorthand to an endpoint: paths → file connectors, URL
|
|
1291
1200
|
schemes → the connector named by the scheme."""
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
"""HTTP helpers for the credential-free Sanka assessment endpoint."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
from collections.abc import Callable, Mapping
|
|
9
|
+
from typing import Any, Protocol, cast
|
|
10
|
+
from urllib.error import HTTPError, URLError
|
|
11
|
+
from urllib.parse import urlencode
|
|
12
|
+
from urllib.request import Request, urlopen
|
|
13
|
+
|
|
14
|
+
from sanka_cli import __version__
|
|
15
|
+
|
|
16
|
+
DEFAULT_API_BASE = "https://api.sanka.com/v2/migrate"
|
|
17
|
+
DEFAULT_SIGNUP_BASE = "https://app.sanka.com"
|
|
18
|
+
DEFAULT_TIMEOUT_SECONDS = 10.0
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class _HttpResponse(Protocol):
|
|
22
|
+
headers: Mapping[str, str]
|
|
23
|
+
|
|
24
|
+
def read(self) -> bytes: ...
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_Opener = Callable[..., Any]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SankaMigrateApiError(Exception):
|
|
31
|
+
"""A transport or standard-envelope error returned by the public API."""
|
|
32
|
+
|
|
33
|
+
def __init__(self, code: str, message: str, *, retry_after: str | None = None) -> None:
|
|
34
|
+
super().__init__(message)
|
|
35
|
+
self.code = code
|
|
36
|
+
self.message = message
|
|
37
|
+
self.retry_after = retry_after
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class SankaMigrateApiClient:
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
43
|
+
*,
|
|
44
|
+
base_url: str | None = None,
|
|
45
|
+
timeout: float = DEFAULT_TIMEOUT_SECONDS,
|
|
46
|
+
opener: _Opener = urlopen,
|
|
47
|
+
) -> None:
|
|
48
|
+
configured_base = base_url or os.environ.get("SANKA_MIGRATE_API_BASE") or DEFAULT_API_BASE
|
|
49
|
+
self._base_url = configured_base.rstrip("/")
|
|
50
|
+
self._timeout = timeout
|
|
51
|
+
self._opener = opener
|
|
52
|
+
|
|
53
|
+
def assess(self, payload: dict[str, Any]) -> dict[str, Any]:
|
|
54
|
+
return self._request("POST", "/assessments", payload=payload)
|
|
55
|
+
|
|
56
|
+
def _request(
|
|
57
|
+
self,
|
|
58
|
+
method: str,
|
|
59
|
+
path: str,
|
|
60
|
+
*,
|
|
61
|
+
query: Mapping[str, str | None] | None = None,
|
|
62
|
+
payload: dict[str, Any] | None = None,
|
|
63
|
+
) -> dict[str, Any]:
|
|
64
|
+
params = {key: value for key, value in (query or {}).items() if value not in (None, "")}
|
|
65
|
+
suffix = f"?{urlencode(params)}" if params else ""
|
|
66
|
+
body = json.dumps(payload).encode("utf-8") if payload is not None else None
|
|
67
|
+
headers = {"Accept": "application/json", "User-Agent": f"sanka-cli/{__version__}"}
|
|
68
|
+
if body is not None:
|
|
69
|
+
headers["Content-Type"] = "application/json"
|
|
70
|
+
request = Request(
|
|
71
|
+
f"{self._base_url}{path}{suffix}",
|
|
72
|
+
data=body,
|
|
73
|
+
headers=headers,
|
|
74
|
+
method=method,
|
|
75
|
+
)
|
|
76
|
+
try:
|
|
77
|
+
with self._opener(request, timeout=self._timeout) as response:
|
|
78
|
+
envelope = _decode_json(response.read())
|
|
79
|
+
except HTTPError as error:
|
|
80
|
+
envelope = _decode_json(error.read(), fallback={})
|
|
81
|
+
details = _error_details(envelope)
|
|
82
|
+
retry_after = error.headers.get("Retry-After") if error.headers else None
|
|
83
|
+
raise SankaMigrateApiError(
|
|
84
|
+
details["code"],
|
|
85
|
+
details["message"],
|
|
86
|
+
retry_after=retry_after,
|
|
87
|
+
) from error
|
|
88
|
+
except (URLError, TimeoutError, OSError) as error:
|
|
89
|
+
raise SankaMigrateApiError(
|
|
90
|
+
"SANKA_MIGRATE_API_UNAVAILABLE",
|
|
91
|
+
f"Sanka API request failed: {error}",
|
|
92
|
+
) from error
|
|
93
|
+
if not isinstance(envelope, dict) or envelope.get("success") is not True:
|
|
94
|
+
details = _error_details(envelope)
|
|
95
|
+
raise SankaMigrateApiError(details["code"], details["message"])
|
|
96
|
+
data = envelope.get("data")
|
|
97
|
+
if not isinstance(data, dict):
|
|
98
|
+
raise SankaMigrateApiError(
|
|
99
|
+
"SANKA_MIGRATE_API_INVALID_RESPONSE",
|
|
100
|
+
"Sanka API returned an invalid response.",
|
|
101
|
+
)
|
|
102
|
+
return cast(dict[str, Any], data)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def signup_url(assessment_id: str, *, lang: str) -> str:
|
|
106
|
+
base = (os.environ.get("SANKA_MIGRATE_SIGNUP_BASE") or DEFAULT_SIGNUP_BASE).rstrip("/")
|
|
107
|
+
signup_path = "/ja/signup" if lang == "ja" else "/register"
|
|
108
|
+
handoff = urlencode({"lang": lang, "assessment_id": assessment_id})
|
|
109
|
+
return f"{base}{signup_path}?{urlencode({'next': f'/migrate-onboarding?{handoff}'})}"
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _decode_json(raw: bytes, *, fallback: Any = None) -> Any:
|
|
113
|
+
try:
|
|
114
|
+
return json.loads(raw.decode("utf-8"))
|
|
115
|
+
except (UnicodeDecodeError, json.JSONDecodeError):
|
|
116
|
+
return fallback
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def _error_details(envelope: Any) -> dict[str, str]:
|
|
120
|
+
error = envelope.get("error") if isinstance(envelope, dict) else None
|
|
121
|
+
if not isinstance(error, dict):
|
|
122
|
+
return {
|
|
123
|
+
"code": "SANKA_MIGRATE_API_ERROR",
|
|
124
|
+
"message": "Sanka API request failed.",
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
"code": str(error.get("code") or "SANKA_MIGRATE_API_ERROR"),
|
|
128
|
+
"message": str(error.get("message") or "Sanka API request failed."),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
__all__ = [
|
|
133
|
+
"DEFAULT_API_BASE",
|
|
134
|
+
"DEFAULT_SIGNUP_BASE",
|
|
135
|
+
"SankaMigrateApiClient",
|
|
136
|
+
"SankaMigrateApiError",
|
|
137
|
+
"signup_url",
|
|
138
|
+
]
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
"""Human-readable summaries for local lifecycle results.
|
|
3
|
+
|
|
4
|
+
The JSON document (``--json``) is the contract; these lines only restate the
|
|
5
|
+
fields a person needs after each step. Every accessor tolerates missing keys so
|
|
6
|
+
an older or newer extension response never breaks the text output.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from collections.abc import Mapping
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
_FRAMEWORK_LABELS = {
|
|
16
|
+
"django-rest-framework": "DRF",
|
|
17
|
+
"drf": "DRF",
|
|
18
|
+
"fastapi": "FastAPI",
|
|
19
|
+
"flask": "Flask",
|
|
20
|
+
}
|
|
21
|
+
_ENGINE_LABELS = {
|
|
22
|
+
"tortoise": "Tortoise ORM",
|
|
23
|
+
"sqlalchemy": "SQLAlchemy",
|
|
24
|
+
"psycopg": "psycopg",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _count(value: Any) -> int | None:
|
|
29
|
+
if isinstance(value, bool):
|
|
30
|
+
return None
|
|
31
|
+
if isinstance(value, int):
|
|
32
|
+
return value
|
|
33
|
+
if isinstance(value, (list, tuple, dict)):
|
|
34
|
+
return len(value)
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _plural(count: int, singular: str, plural: str | None = None) -> str:
|
|
39
|
+
word = singular if count == 1 else (plural or f"{singular}s")
|
|
40
|
+
return f"{count} {word}"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _label(value: Any, table: Mapping[str, str]) -> str:
|
|
44
|
+
text = str(value) if value is not None else ""
|
|
45
|
+
return table.get(text.lower(), text)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _relative(path: Any, root: str | Path) -> str:
|
|
49
|
+
text = str(path) if path is not None else ""
|
|
50
|
+
try:
|
|
51
|
+
return str(Path(text).resolve().relative_to(Path(root).resolve()))
|
|
52
|
+
except (ValueError, OSError):
|
|
53
|
+
return text
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _scan_lines(data: Mapping[str, Any]) -> list[str]:
|
|
57
|
+
lines: list[str] = []
|
|
58
|
+
detected: list[tuple[str, str]] = []
|
|
59
|
+
for key, name in (
|
|
60
|
+
("python_version", "Python"),
|
|
61
|
+
("django_version", "Django"),
|
|
62
|
+
("drf_version", "DRF"),
|
|
63
|
+
):
|
|
64
|
+
value = data.get(key)
|
|
65
|
+
if isinstance(value, str) and value:
|
|
66
|
+
detected.append((name, value))
|
|
67
|
+
database = data.get("database")
|
|
68
|
+
if isinstance(database, Mapping):
|
|
69
|
+
vendor = database.get("vendor")
|
|
70
|
+
db_name = database.get("name")
|
|
71
|
+
if vendor:
|
|
72
|
+
detected.append(("Database", f"{vendor} ({db_name})" if db_name else str(vendor)))
|
|
73
|
+
if detected:
|
|
74
|
+
lines.append("Detected")
|
|
75
|
+
lines.extend(f" {name:<10} {value}" for name, value in detected)
|
|
76
|
+
counts = [
|
|
77
|
+
(_count(data.get("routes")), "route", "routes"),
|
|
78
|
+
(_count(data.get("serializers")), "serializer", "serializers"),
|
|
79
|
+
(_count(data.get("models")), "model", "models"),
|
|
80
|
+
(_count(data.get("permissions")), "permission class", "permission classes"),
|
|
81
|
+
(_count(data.get("test_files")), "test file", "test files"),
|
|
82
|
+
]
|
|
83
|
+
present = [(n, s, p) for n, s, p in counts if n is not None]
|
|
84
|
+
if present:
|
|
85
|
+
if lines:
|
|
86
|
+
lines.append("")
|
|
87
|
+
lines.append("Application")
|
|
88
|
+
lines.extend(f" {_plural(n, s, p)}" for n, s, p in present)
|
|
89
|
+
skipped = _count(data.get("skipped_routes"))
|
|
90
|
+
if skipped:
|
|
91
|
+
lines.append(f" {_plural(skipped, 'skipped route')}")
|
|
92
|
+
scan_hash = data.get("scan_hash")
|
|
93
|
+
if isinstance(scan_hash, str) and scan_hash:
|
|
94
|
+
if lines:
|
|
95
|
+
lines.append("")
|
|
96
|
+
lines.append(f"scan hash: {scan_hash}")
|
|
97
|
+
return lines
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _target_from_extension_id(extension_id: Any) -> str | None:
|
|
101
|
+
"""``sanka/drf-to-fastapi`` names its target after ``-to-``; other ids give nothing."""
|
|
102
|
+
if not isinstance(extension_id, str):
|
|
103
|
+
return None
|
|
104
|
+
name = extension_id.rsplit("/", 1)[-1]
|
|
105
|
+
if "-to-" not in name:
|
|
106
|
+
return None
|
|
107
|
+
target = name.rsplit("-to-", 1)[-1].strip()
|
|
108
|
+
return target or None
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _scan_targets(data: Mapping[str, Any]) -> list[str]:
|
|
112
|
+
targets: list[str] = []
|
|
113
|
+
|
|
114
|
+
def add(candidate: Any) -> None:
|
|
115
|
+
if isinstance(candidate, str) and candidate and candidate not in targets:
|
|
116
|
+
targets.append(candidate)
|
|
117
|
+
|
|
118
|
+
extensions = data.get("extensions")
|
|
119
|
+
if isinstance(extensions, list):
|
|
120
|
+
for entry in extensions:
|
|
121
|
+
if not isinstance(entry, Mapping):
|
|
122
|
+
continue
|
|
123
|
+
explicit = entry.get("targets")
|
|
124
|
+
record = entry.get("extension")
|
|
125
|
+
if not explicit and isinstance(record, Mapping):
|
|
126
|
+
explicit = record.get("targets")
|
|
127
|
+
for candidate in explicit or ():
|
|
128
|
+
add(candidate)
|
|
129
|
+
if not explicit:
|
|
130
|
+
identifier = entry.get("id")
|
|
131
|
+
if identifier is None and isinstance(record, Mapping):
|
|
132
|
+
identifier = record.get("id")
|
|
133
|
+
add(_target_from_extension_id(identifier))
|
|
134
|
+
return targets
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _plan_lines(data: Mapping[str, Any], root: str | Path) -> list[str]:
|
|
138
|
+
lines: list[str] = []
|
|
139
|
+
source = _label(data.get("source_framework"), _FRAMEWORK_LABELS)
|
|
140
|
+
target = _label(data.get("target_framework"), _FRAMEWORK_LABELS)
|
|
141
|
+
title = f"{source} → {target} plan" if source and target else "Migration plan"
|
|
142
|
+
lines.append(title)
|
|
143
|
+
strategy: list[str] = []
|
|
144
|
+
if data.get("mode"):
|
|
145
|
+
strategy.append(str(data["mode"]))
|
|
146
|
+
if data.get("sql_engine"):
|
|
147
|
+
strategy.append(_label(data["sql_engine"], _ENGINE_LABELS))
|
|
148
|
+
if data.get("generation_mode"):
|
|
149
|
+
strategy.append(f"{data['generation_mode']} generation")
|
|
150
|
+
if data.get("package_manager"):
|
|
151
|
+
strategy.append(str(data["package_manager"]))
|
|
152
|
+
if strategy:
|
|
153
|
+
lines.append(f" {'Strategy':<10} {' · '.join(strategy)}")
|
|
154
|
+
output = data.get("default_output") or data.get("output")
|
|
155
|
+
if output:
|
|
156
|
+
lines.append(f" {'Output':<10} {_relative(output, root)}")
|
|
157
|
+
native = _count(data.get("native_routes"))
|
|
158
|
+
dropped = _count(data.get("dropped_alias_routes"))
|
|
159
|
+
manual = _count(data.get("needs_adaptation_routes"))
|
|
160
|
+
total = _count(data.get("routes"))
|
|
161
|
+
if total is None and None not in (native, dropped, manual):
|
|
162
|
+
total = (native or 0) + (dropped or 0) + (manual or 0)
|
|
163
|
+
if any(value is not None for value in (native, dropped, manual)):
|
|
164
|
+
lines.append("")
|
|
165
|
+
lines.append(f"Routes ({total})" if total is not None else "Routes")
|
|
166
|
+
if native is not None:
|
|
167
|
+
lines.append(f" {native} generated natively")
|
|
168
|
+
if dropped is not None:
|
|
169
|
+
lines.append(f" {dropped} format-suffix aliases dropped (disclosed)")
|
|
170
|
+
if manual is not None:
|
|
171
|
+
lines.append(f" {manual} need manual adaptation")
|
|
172
|
+
eligible = _count(data.get("native_eligible_routes"))
|
|
173
|
+
readiness = data.get("readiness")
|
|
174
|
+
if isinstance(readiness, (int, float)) and not isinstance(readiness, bool):
|
|
175
|
+
percent = round(float(readiness) * 100) if readiness <= 1 else round(float(readiness))
|
|
176
|
+
detail = (
|
|
177
|
+
f" ({native}/{eligible} non-alias routes)" if None not in (native, eligible) else ""
|
|
178
|
+
)
|
|
179
|
+
lines.append(f" readiness {percent}%{detail}")
|
|
180
|
+
return lines
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _apply_lines(data: Mapping[str, Any], root: str | Path) -> list[str]:
|
|
184
|
+
lines: list[str] = ["Generated"]
|
|
185
|
+
generated = _count(data.get("routes_generated"))
|
|
186
|
+
target = _label(data.get("target_framework"), _FRAMEWORK_LABELS)
|
|
187
|
+
if generated is not None:
|
|
188
|
+
noun = f"native {target} route" if target else "native route"
|
|
189
|
+
lines.append(f" {_plural(generated, noun)}")
|
|
190
|
+
output = data.get("output")
|
|
191
|
+
if output:
|
|
192
|
+
lines.append(f" {'Output':<10} {_relative(output, root)}")
|
|
193
|
+
if data.get("sql_engine"):
|
|
194
|
+
lines.append(f" {'Engine':<10} {_label(data['sql_engine'], _ENGINE_LABELS)}")
|
|
195
|
+
return lines if len(lines) > 1 else []
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _test_lines(data: Mapping[str, Any], root: str | Path) -> list[str]:
|
|
199
|
+
lines: list[str] = ["Generated app tests"]
|
|
200
|
+
ran = _count(data.get("tests"))
|
|
201
|
+
if ran is None:
|
|
202
|
+
log = data.get("log")
|
|
203
|
+
if isinstance(log, str):
|
|
204
|
+
import re
|
|
205
|
+
|
|
206
|
+
match = re.search(r"Ran (\d+) tests?", log)
|
|
207
|
+
if match:
|
|
208
|
+
ran = int(match.group(1))
|
|
209
|
+
if ran is not None:
|
|
210
|
+
lines.append(f" Ran {_plural(ran, 'test')}")
|
|
211
|
+
environment = data.get("environment")
|
|
212
|
+
if environment:
|
|
213
|
+
lines.append(f" {'Env':<10} {_relative(environment, root)}")
|
|
214
|
+
return lines if len(lines) > 1 else []
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def _verify_lines(data: Mapping[str, Any]) -> list[str]:
|
|
218
|
+
lines: list[str] = []
|
|
219
|
+
mode = data.get("mode")
|
|
220
|
+
lines.append(f"Verified ({mode})" if mode else "Verified")
|
|
221
|
+
routes = data.get("routes")
|
|
222
|
+
if isinstance(routes, Mapping):
|
|
223
|
+
parts: list[str] = []
|
|
224
|
+
generated = _count(routes.get("generated"))
|
|
225
|
+
if generated is not None:
|
|
226
|
+
parts.append(f"{generated} generated")
|
|
227
|
+
for key, text in (
|
|
228
|
+
("dropped", "aliases dropped"),
|
|
229
|
+
("needs_adaptation", "need adaptation"),
|
|
230
|
+
("missing", "missing"),
|
|
231
|
+
("extra", "extra"),
|
|
232
|
+
):
|
|
233
|
+
count = _count(routes.get(key))
|
|
234
|
+
if count is not None:
|
|
235
|
+
parts.append(f"{count} {text}")
|
|
236
|
+
if parts:
|
|
237
|
+
lines.append(f" {'routes':<8} " + " · ".join(parts))
|
|
238
|
+
http = data.get("http")
|
|
239
|
+
if isinstance(http, Mapping) and http.get("enabled", True):
|
|
240
|
+
passed = _count(http.get("passed"))
|
|
241
|
+
probed = _count(http.get("probed"))
|
|
242
|
+
if passed is not None and probed is not None:
|
|
243
|
+
lines.append(f" {'http':<8} {passed}/{probed} probes passed")
|
|
244
|
+
return lines if len(lines) > 1 else []
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def application_summary(
|
|
248
|
+
command: str, data: Mapping[str, Any], *, root: str | Path = "."
|
|
249
|
+
) -> tuple[list[str], str | None]:
|
|
250
|
+
"""Return (summary lines, next-command hint) for a successful lifecycle step."""
|
|
251
|
+
if not isinstance(data, Mapping):
|
|
252
|
+
return [], None
|
|
253
|
+
if command == "scan":
|
|
254
|
+
targets = _scan_targets(data)
|
|
255
|
+
target = targets[0] if len(targets) == 1 else "<target>"
|
|
256
|
+
return _scan_lines(data), f"sanka plan . --to {target}"
|
|
257
|
+
if command == "plan":
|
|
258
|
+
plan_hash = data.get("plan_hash")
|
|
259
|
+
hint = (
|
|
260
|
+
f"sanka apply --root . --plan-hash {plan_hash}"
|
|
261
|
+
if isinstance(plan_hash, str) and plan_hash
|
|
262
|
+
else "sanka apply --root . --plan-hash <hash printed above>"
|
|
263
|
+
)
|
|
264
|
+
return _plan_lines(data, root), hint
|
|
265
|
+
if command == "apply":
|
|
266
|
+
return _apply_lines(data, root), "sanka test ."
|
|
267
|
+
if command == "test":
|
|
268
|
+
return _test_lines(data, root), "sanka verify ."
|
|
269
|
+
if command == "verify":
|
|
270
|
+
return _verify_lines(data), None
|
|
271
|
+
return [], None
|
|
@@ -456,7 +456,12 @@ def _flow_capabilities(value: Any, code: str, path: Path) -> tuple[FlowCapabilit
|
|
|
456
456
|
)
|
|
457
457
|
is None
|
|
458
458
|
or item["output_schema"]
|
|
459
|
-
not in (
|
|
459
|
+
not in (
|
|
460
|
+
"sanka-flow-blueprint/v1",
|
|
461
|
+
"sanka-flow-blueprint/v2",
|
|
462
|
+
"sanka-flow-blueprint/v3",
|
|
463
|
+
"sanka-flow-blueprint/v4",
|
|
464
|
+
)
|
|
460
465
|
or not isinstance(item["references"], list)
|
|
461
466
|
or not isinstance(item["values"], list)
|
|
462
467
|
):
|
|
@@ -524,6 +524,17 @@ class ApplicationLifecycle:
|
|
|
524
524
|
target=selected_target,
|
|
525
525
|
extensions=[item.id for item in selected],
|
|
526
526
|
)
|
|
527
|
+
configured_target = normalized.get("target")
|
|
528
|
+
if configured_target is not None and configured_target != selected_target:
|
|
529
|
+
_error(
|
|
530
|
+
"SANKA_EXTENSION_TARGET_MISMATCH",
|
|
531
|
+
"The selected target differs from configuration.target",
|
|
532
|
+
target=selected_target,
|
|
533
|
+
configured=configured_target,
|
|
534
|
+
)
|
|
535
|
+
# An extension that advertises several targets learns the selection here. The
|
|
536
|
+
# reviewed core plan records it, so apply, test and verify receive the same value.
|
|
537
|
+
normalized = {**normalized, "target": selected_target}
|
|
527
538
|
lock = self.store.resolve_locked(selected[0].id)
|
|
528
539
|
self._verify_selection(lock, selected[0])
|
|
529
540
|
request = self._request(lock, "plan", fingerprint, normalized)
|