sanka-cli 0.3.8__tar.gz → 0.3.9__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.3.8 → sanka_cli-0.3.9}/PKG-INFO +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/pyproject.toml +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/__init__.py +31 -28
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/_summary.py +16 -18
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/continuous.py +5 -3
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/lifecycle.py +26 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/runner.py +12 -2
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/stage.py +2 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/store.py +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/__init__.py +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_application_summary.py +5 -4
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_cli.py +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_cli_developer_experience.py +92 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_continuous.py +0 -51
- sanka_cli-0.3.9/tests/test_execution_route_reopening.py +69 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_lifecycle.py +17 -7
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_runner.py +34 -6
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_mcp_retirement.py +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_sanka_facade.py +1 -1
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_tui.py +6 -6
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/.gitignore +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/LICENSES/AGPL-3.0-only.txt +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/LICENSES/Apache-2.0.txt +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/NOTICE +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/README.md +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/_client.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/_compact.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/_output.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/_research.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/app.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/cloud.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/history.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/launch.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/model.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/services.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/cli/tui/widgets.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/connector/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/connector/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/__about__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/concurrency.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/connector_client.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/connector_host.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/engine.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/errors.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/local.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/model.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/report_codec.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/routes.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/scope.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/state.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/execution/validate.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/artifacts.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/code_lifecycle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/code_repair.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/discovery.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/model.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/extensions/settings.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/extension.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/host.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/lifecycle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/merge.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/model.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/native_verification.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/planner.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/sqlite.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/state.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/verification.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/flow/verification_plan.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/hashing.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/errors.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/mapping_candidates.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/model.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/owner_mapping.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/pending_relationships.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/mapping/record_mapping.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/planner.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/private_sqlite.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/registry.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/safe_local_io.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/spec.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka/runtime/state.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/__main__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/bundle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/certificates.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/client.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/cloud_source.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/ai.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/auth.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/cloud.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/cloud_fleet.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/cloud_github.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/cloud_migrate.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/code.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/code_cloud.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/doctor.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/fix.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/functions.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/migrate.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/profiles.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/resources.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/skill.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/workflow_templates.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/commands/workflows.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/config.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/main.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/output.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/runtime.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/skills/sanka-cli/SKILL.md +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_cli/state.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/__about__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/credentials.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/errors.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/protocols.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/provisioning.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/records.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/registration.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_connector/schema.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extension_sdk/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extension_sdk/contract.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extension_sdk/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/__about__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/credentials.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/errors.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/protocols.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/provisioning.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/records.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/registration.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/app/schema.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/code/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/code/contract.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/_wire.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/blueprint.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/definition.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/graph.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/identity.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native_fixtures.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native_process_recipes.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native_profiles.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native_recipes.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native_task_recipes.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/native_verification.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/protocol.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/scenario.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/flow/source.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/__about__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/credentials.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/errors.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/protocols.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/provisioning.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/py.typed +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/records.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/registration.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/src/sanka_extensions/systems/schema.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/conftest.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/api/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/api/serializers.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/api/views.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/config/__init__.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/config/settings.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/config/urls.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_drf_project/manage.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_marketplace/drf-to-fastapi.json +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/extension_marketplace/marketplace.json +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/flow/synthetic_native_order_billing_blueprint.json +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/flow/synthetic_sales_created_estimate_blueprint.json +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/fixtures/flow/synthetic_sales_quote_blueprint.json +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/flow_wheel_acceptance.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_business_flow_extension_acceptance.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_code_bundle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_code_commands.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_code_lifecycle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_code_repair.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_concurrency.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_connector_client.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_connector_host.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_credential_provider.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_doctor.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_engine_e2e.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_engine_execution_adoption.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_engine_pg_to_clickhouse_e2e.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_engine_postgres_e2e.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_exact_scope.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_local_store.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_report_codec.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_routes.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_scope.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_seam.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_execution_validate.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_discovery.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_endpoint_scope.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_settings.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_stage.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_store.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_extension_wheel_acceptance.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_extension.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_extension_wheel_acceptance.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_lifecycle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_merge.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_native_lifecycle.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_native_verification.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_planner.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_sdk_codec.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_sqlite.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_flow_verification.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_hashing.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_help_shortcuts.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_hosted_cli.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_mapping_candidates.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_mapping_owner_mapping.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_mapping_pending_relationships.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_mapping_record_mapping.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_marketplace_aliases.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_plan_input_hints.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_planner.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_registry.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_safe_local_io.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_skill_commands.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_spec.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_state_store.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_tui_conditional_settings.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_tui_endpoint_selection.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_tui_extension_install.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/test_workflow_templates_cli.py +0 -0
- {sanka_cli-0.3.8 → sanka_cli-0.3.9}/tests/tui_helpers.py +0 -0
|
@@ -973,16 +973,14 @@ def _prompt_choice(
|
|
|
973
973
|
choices: tuple[tuple[str, str], ...],
|
|
974
974
|
*,
|
|
975
975
|
default: str,
|
|
976
|
+
indent: str = "",
|
|
976
977
|
) -> str:
|
|
977
|
-
print(label)
|
|
978
|
+
print(f"{indent}{label}")
|
|
978
979
|
for index, (value, description) in enumerate(choices, start=1):
|
|
979
980
|
marker = " (recommended)" if value == default else ""
|
|
980
|
-
print(f" {index}. {description}{marker}")
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
.strip()
|
|
984
|
-
.lower()
|
|
985
|
-
)
|
|
981
|
+
print(f"{indent} {index}. {description}{marker}")
|
|
982
|
+
default_index = next(i for i, item in enumerate(choices, 1) if item[0] == default)
|
|
983
|
+
raw = input(f"{indent}Select [{default_index}]: ").strip().lower()
|
|
986
984
|
if not raw:
|
|
987
985
|
return default
|
|
988
986
|
for index, (value, _description) in enumerate(choices, start=1):
|
|
@@ -1036,14 +1034,17 @@ def _extension_configuration(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
1036
1034
|
return configuration
|
|
1037
1035
|
|
|
1038
1036
|
|
|
1039
|
-
def _lifecycle_prompt(
|
|
1037
|
+
def _lifecycle_prompt(
|
|
1038
|
+
label: str, choices: tuple[str, ...] | None = None, *, indent: str = ""
|
|
1039
|
+
) -> str | None:
|
|
1040
1040
|
if choices:
|
|
1041
1041
|
return _prompt_choice(
|
|
1042
1042
|
f"{label}:",
|
|
1043
1043
|
tuple((choice, choice) for choice in choices),
|
|
1044
1044
|
default=choices[0],
|
|
1045
|
+
indent=indent,
|
|
1045
1046
|
)
|
|
1046
|
-
return input(f"{label}: ").strip() or None
|
|
1047
|
+
return input(f"{indent}{label}: ").strip() or None
|
|
1047
1048
|
|
|
1048
1049
|
|
|
1049
1050
|
def _application_lifecycle(
|
|
@@ -1056,6 +1057,19 @@ def _application_lifecycle(
|
|
|
1056
1057
|
terminal = terminal or _terminal(args)
|
|
1057
1058
|
decoder = getincrementaldecoder("utf-8")("replace")
|
|
1058
1059
|
pending = ""
|
|
1060
|
+
configuration_started = False
|
|
1061
|
+
|
|
1062
|
+
def prompt(label: str, choices: tuple[str, ...] | None = None) -> str | None:
|
|
1063
|
+
nonlocal configuration_started
|
|
1064
|
+
if args.command == "plan" and (
|
|
1065
|
+
label == "Choose a migration target" or label.startswith("Extension configuration: ")
|
|
1066
|
+
):
|
|
1067
|
+
print("" if configuration_started else "Configuration:")
|
|
1068
|
+
configuration_started = True
|
|
1069
|
+
return _lifecycle_prompt(
|
|
1070
|
+
label.removeprefix("Extension configuration: "), choices, indent=" "
|
|
1071
|
+
)
|
|
1072
|
+
return _lifecycle_prompt(label, choices)
|
|
1059
1073
|
|
|
1060
1074
|
def on_stderr(chunk: bytes) -> None:
|
|
1061
1075
|
nonlocal pending
|
|
@@ -1071,7 +1085,7 @@ def _application_lifecycle(
|
|
|
1071
1085
|
runner=ExtensionRunner(on_stderr=on_stderr),
|
|
1072
1086
|
interactive=_interactive_terminal()
|
|
1073
1087
|
and not (args.json or getattr(args, "compact_dsl", False) or getattr(args, "quiet", False)),
|
|
1074
|
-
prompt=
|
|
1088
|
+
prompt=prompt,
|
|
1075
1089
|
input_hints=plan_input_hints(getattr(args, "to", None)),
|
|
1076
1090
|
)
|
|
1077
1091
|
|
|
@@ -1122,24 +1136,13 @@ def _print_application_result(
|
|
|
1122
1136
|
path = path.relative_to(Path(args.root).resolve())
|
|
1123
1137
|
print(f"{'Plan file' if command == 'plan' else 'Report':<10} {path}")
|
|
1124
1138
|
if next_hint and not quiet:
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
"--artifact-dir",
|
|
1133
|
-
str(args.artifact_dir),
|
|
1134
|
-
"--plan-hash",
|
|
1135
|
-
str(result.data["plan_hash"]),
|
|
1136
|
-
*[
|
|
1137
|
-
part
|
|
1138
|
-
for name in args.extension_env
|
|
1139
|
-
for part in ("--extension-env", name)
|
|
1140
|
-
],
|
|
1141
|
-
]
|
|
1142
|
-
)
|
|
1139
|
+
options: list[str] = []
|
|
1140
|
+
if args.artifact_dir != ".sanka":
|
|
1141
|
+
options.extend(("--artifact-dir", str(args.artifact_dir)))
|
|
1142
|
+
for name in dict.fromkeys([*args.extension_env, *result.forwarded_env_names]):
|
|
1143
|
+
options.extend(("--extension-env", name))
|
|
1144
|
+
if options:
|
|
1145
|
+
next_hint += " " + shlex.join(options)
|
|
1143
1146
|
print(f"next: {next_hint}")
|
|
1144
1147
|
return 0
|
|
1145
1148
|
|
|
@@ -8,6 +8,7 @@ an older or newer extension response never breaks the text output.
|
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
+
import shlex
|
|
11
12
|
from collections.abc import Mapping
|
|
12
13
|
from pathlib import Path
|
|
13
14
|
from typing import Any
|
|
@@ -110,17 +111,6 @@ def _scan_lines(data: Mapping[str, Any]) -> list[str]:
|
|
|
110
111
|
return lines
|
|
111
112
|
|
|
112
113
|
|
|
113
|
-
def _target_from_extension_id(extension_id: Any) -> str | None:
|
|
114
|
-
"""``sanka/drf-to-fastapi`` names its target after ``-to-``; other ids give nothing."""
|
|
115
|
-
if not isinstance(extension_id, str):
|
|
116
|
-
return None
|
|
117
|
-
name = extension_id.rsplit("/", 1)[-1]
|
|
118
|
-
if "-to-" not in name:
|
|
119
|
-
return None
|
|
120
|
-
target = name.rsplit("-to-", 1)[-1].strip()
|
|
121
|
-
return canonical_target(extension_id, target) if target else None
|
|
122
|
-
|
|
123
|
-
|
|
124
114
|
def _scan_targets(data: Mapping[str, Any]) -> list[str]:
|
|
125
115
|
targets: list[str] = []
|
|
126
116
|
|
|
@@ -140,14 +130,21 @@ def _scan_targets(data: Mapping[str, Any]) -> list[str]:
|
|
|
140
130
|
identifier = record.get("id")
|
|
141
131
|
if not explicit and isinstance(record, Mapping):
|
|
142
132
|
explicit = record.get("targets")
|
|
133
|
+
if not explicit:
|
|
134
|
+
explicit = next(
|
|
135
|
+
(
|
|
136
|
+
item.get("targets")
|
|
137
|
+
for item in data.get("recommendations") or ()
|
|
138
|
+
if isinstance(item, Mapping) and item.get("id") == identifier
|
|
139
|
+
),
|
|
140
|
+
(),
|
|
141
|
+
)
|
|
143
142
|
for candidate in explicit or ():
|
|
144
143
|
add(
|
|
145
144
|
canonical_target(identifier, candidate)
|
|
146
145
|
if isinstance(identifier, str) and isinstance(candidate, str)
|
|
147
146
|
else candidate
|
|
148
147
|
)
|
|
149
|
-
if not explicit:
|
|
150
|
-
add(_target_from_extension_id(identifier))
|
|
151
148
|
return targets
|
|
152
149
|
|
|
153
150
|
|
|
@@ -330,22 +327,23 @@ def application_summary(
|
|
|
330
327
|
"""Return (summary lines, next-command hint) for a successful lifecycle step."""
|
|
331
328
|
if not isinstance(data, Mapping):
|
|
332
329
|
return [], None
|
|
330
|
+
quoted_root = shlex.quote(str(root))
|
|
333
331
|
if command == "scan":
|
|
334
332
|
targets = _scan_targets(data)
|
|
335
333
|
target = targets[0] if len(targets) == 1 else "<target>"
|
|
336
|
-
return _scan_lines(data), f"sanka plan
|
|
334
|
+
return _scan_lines(data), f"sanka plan {quoted_root} --to {target}"
|
|
337
335
|
if command == "plan":
|
|
338
336
|
plan_hash = data.get("plan_hash")
|
|
339
337
|
hint = (
|
|
340
|
-
f"sanka apply --root
|
|
338
|
+
f"sanka apply --root {quoted_root} --plan-hash {shlex.quote(plan_hash)}"
|
|
341
339
|
if isinstance(plan_hash, str) and plan_hash
|
|
342
|
-
else "sanka apply --root
|
|
340
|
+
else f"sanka apply --root {quoted_root} --plan-hash <hash printed above>"
|
|
343
341
|
)
|
|
344
342
|
return _plan_lines(data, root), hint
|
|
345
343
|
if command == "apply":
|
|
346
|
-
return _apply_lines(data, root), "sanka test
|
|
344
|
+
return _apply_lines(data, root), f"sanka test {quoted_root}"
|
|
347
345
|
if command == "test":
|
|
348
|
-
return _test_lines(data, root), "sanka verify
|
|
346
|
+
return _test_lines(data, root), f"sanka verify {quoted_root}"
|
|
349
347
|
if command == "verify":
|
|
350
348
|
return _verify_lines(data), None
|
|
351
349
|
return [], None
|
|
@@ -195,8 +195,8 @@ def reopen_incomplete_routes(
|
|
|
195
195
|
) -> None:
|
|
196
196
|
"""Reopen routes from their last safe keyset checkpoint.
|
|
197
197
|
|
|
198
|
-
|
|
199
|
-
or
|
|
198
|
+
Prefer the saved terminal checkpoint: the page can contain later failed rows.
|
|
199
|
+
Otherwise use its next cursor or last source record id. A route with neither has no
|
|
200
200
|
safe resume point: with ``require_checkpoint`` the reopen refuses
|
|
201
201
|
(``SANKA_MIGRATE_SOURCE_CHECKPOINT_MISSING``) before mutating anything, because
|
|
202
202
|
resuming from nowhere would re-read outside the frozen scope.
|
|
@@ -207,7 +207,9 @@ def reopen_incomplete_routes(
|
|
|
207
207
|
reopened_checkpoints: dict[str, str] = {}
|
|
208
208
|
for route_key in sorted(route_keys):
|
|
209
209
|
page = snapshot.batch_pages.get(route_key)
|
|
210
|
-
cursor = str(
|
|
210
|
+
cursor = str(snapshot.checkpoints.get(route_key) or "").strip()
|
|
211
|
+
if not cursor and page is not None:
|
|
212
|
+
cursor = str(page.next_cursor or "").strip()
|
|
211
213
|
if not cursor and page is not None and page.source_record_ids:
|
|
212
214
|
cursor = page.source_record_ids[-1]
|
|
213
215
|
if not cursor and require_checkpoint:
|
|
@@ -25,6 +25,7 @@ from sanka.runtime.extensions.runner import (
|
|
|
25
25
|
ExtensionResult,
|
|
26
26
|
ExtensionRunner,
|
|
27
27
|
_canonical_environment_names,
|
|
28
|
+
extension_environment_names,
|
|
28
29
|
)
|
|
29
30
|
from sanka.runtime.extensions.settings import setting_defaults
|
|
30
31
|
from sanka.runtime.extensions.store import DEFAULT_EXTENSION_ID, ExtensionStore, LockEntry
|
|
@@ -464,6 +465,13 @@ class ApplicationLifecycle:
|
|
|
464
465
|
"configuration": normalized,
|
|
465
466
|
"explicit_env_names": list(explicit_env_names),
|
|
466
467
|
**data,
|
|
468
|
+
"forwarded_env_names": sorted(
|
|
469
|
+
{
|
|
470
|
+
name
|
|
471
|
+
for lock in locks
|
|
472
|
+
for name in extension_environment_names(lock, explicit_env_names)
|
|
473
|
+
}
|
|
474
|
+
),
|
|
467
475
|
}
|
|
468
476
|
scan_path = _write_json(self.artifact_root / "scan.json", scan_payload)
|
|
469
477
|
return ExtensionResult(
|
|
@@ -482,6 +490,11 @@ class ApplicationLifecycle:
|
|
|
482
490
|
action for _lock, result in extension_results for action in result.next_actions
|
|
483
491
|
),
|
|
484
492
|
error=None,
|
|
493
|
+
forwarded_env_names=tuple(
|
|
494
|
+
sorted(
|
|
495
|
+
{name for _, result in extension_results for name in result.forwarded_env_names}
|
|
496
|
+
)
|
|
497
|
+
),
|
|
485
498
|
)
|
|
486
499
|
|
|
487
500
|
def _current_scan_locked(
|
|
@@ -494,6 +507,13 @@ class ApplicationLifecycle:
|
|
|
494
507
|
locks = self._scan_locks(recommendations)
|
|
495
508
|
expected_locks = [lock.to_dict() for lock in locks]
|
|
496
509
|
expected_recommendations = _serialized_recommendations(recommendations)
|
|
510
|
+
environment_names = sorted(
|
|
511
|
+
{
|
|
512
|
+
name
|
|
513
|
+
for lock in locks
|
|
514
|
+
for name in extension_environment_names(lock, explicit_env_names)
|
|
515
|
+
}
|
|
516
|
+
)
|
|
497
517
|
try:
|
|
498
518
|
scan = _read_json(self.artifact_root / "scan.json", SCAN_SCHEMA)
|
|
499
519
|
except ExtensionError:
|
|
@@ -512,9 +532,11 @@ class ApplicationLifecycle:
|
|
|
512
532
|
and saved.get("hash") == fingerprint.hash
|
|
513
533
|
and scan.get("configuration") == normalized
|
|
514
534
|
and scan.get("explicit_env_names") == list(explicit_env_names)
|
|
535
|
+
and scan.get("forwarded_env_names", scan.get("explicit_env_names"))
|
|
536
|
+
== environment_names
|
|
515
537
|
and saved_locks == expected_locks
|
|
516
538
|
and scan.get("recommendations") == expected_recommendations
|
|
517
|
-
and not
|
|
539
|
+
and not environment_names
|
|
518
540
|
):
|
|
519
541
|
return
|
|
520
542
|
self._scan_locked(
|
|
@@ -844,6 +866,7 @@ class ApplicationLifecycle:
|
|
|
844
866
|
limitations=result.limitations,
|
|
845
867
|
next_actions=result.next_actions,
|
|
846
868
|
error=None,
|
|
869
|
+
forwarded_env_names=result.forwarded_env_names,
|
|
847
870
|
)
|
|
848
871
|
|
|
849
872
|
def _load_plan(self) -> dict[str, Any]:
|
|
@@ -970,6 +993,7 @@ class ApplicationLifecycle:
|
|
|
970
993
|
limitations=result.limitations,
|
|
971
994
|
next_actions=result.next_actions,
|
|
972
995
|
error=None,
|
|
996
|
+
forwarded_env_names=result.forwarded_env_names,
|
|
973
997
|
)
|
|
974
998
|
|
|
975
999
|
def apply(
|
|
@@ -1054,6 +1078,7 @@ class ApplicationLifecycle:
|
|
|
1054
1078
|
limitations=result.limitations,
|
|
1055
1079
|
next_actions=result.next_actions,
|
|
1056
1080
|
error=None,
|
|
1081
|
+
forwarded_env_names=result.forwarded_env_names,
|
|
1057
1082
|
)
|
|
1058
1083
|
|
|
1059
1084
|
def _replay_lock(self, fingerprint: Fingerprint) -> LockEntry:
|
|
@@ -12,6 +12,7 @@ import subprocess
|
|
|
12
12
|
import time
|
|
13
13
|
from collections.abc import Callable
|
|
14
14
|
from contextlib import suppress
|
|
15
|
+
from dataclasses import replace
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
from typing import Any, NoReturn, cast
|
|
17
18
|
|
|
@@ -41,6 +42,13 @@ def _canonical_environment_names(names: tuple[str, ...]) -> tuple[str, ...]:
|
|
|
41
42
|
return tuple(sorted(names))
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
def extension_environment_names(lock: LockEntry, explicit: tuple[str, ...]) -> tuple[str, ...]:
|
|
46
|
+
names = _canonical_environment_names(explicit)
|
|
47
|
+
if lock.id == "sanka/python-to-golang" and "SANKA_GO_SOURCE_PYTHON" in os.environ:
|
|
48
|
+
return tuple(sorted({*names, "SANKA_GO_SOURCE_PYTHON"}))
|
|
49
|
+
return names
|
|
50
|
+
|
|
51
|
+
|
|
44
52
|
class ExtensionRunner:
|
|
45
53
|
"""Run one verified lock through exactly one JSON request and response."""
|
|
46
54
|
|
|
@@ -218,8 +226,9 @@ class ExtensionRunner:
|
|
|
218
226
|
enabled=lock.enabled,
|
|
219
227
|
)
|
|
220
228
|
|
|
229
|
+
names = extension_environment_names(lock, explicit_env_names)
|
|
230
|
+
|
|
221
231
|
def execute(content: bytes) -> tuple[int, bytes, bytes]:
|
|
222
|
-
names = _canonical_environment_names(explicit_env_names)
|
|
223
232
|
environment = {name: os.environ[name] for name in SAFE_ENV if name in os.environ}
|
|
224
233
|
environment["PYTHONDONTWRITEBYTECODE"] = "1"
|
|
225
234
|
environment.update({name: os.environ[name] for name in names if name in os.environ})
|
|
@@ -256,9 +265,10 @@ class ExtensionRunner:
|
|
|
256
265
|
pass_fds=pass_fds,
|
|
257
266
|
)
|
|
258
267
|
|
|
259
|
-
|
|
268
|
+
result = ExtensionStageRunner().run(
|
|
260
269
|
binding, request, allowed_roots=allowed_roots, execute=execute
|
|
261
270
|
)
|
|
271
|
+
return replace(result, forwarded_env_names=names)
|
|
262
272
|
|
|
263
273
|
|
|
264
274
|
__all__ = ["ExtensionResult", "ExtensionRunner"]
|
|
@@ -45,6 +45,8 @@ class ExtensionResult:
|
|
|
45
45
|
limitations: tuple[str, ...]
|
|
46
46
|
next_actions: tuple[str, ...]
|
|
47
47
|
error: dict[str, Any] | None
|
|
48
|
+
# Local transport metadata, outside the extension wire response and Plan hash.
|
|
49
|
+
forwarded_env_names: tuple[str, ...] = ()
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
def _error(code: str, message: str, **details: Any) -> NoReturn:
|
|
@@ -61,7 +61,7 @@ OFFICIAL_IDENTITY = "github.com/sankaHQ/extensions"
|
|
|
61
61
|
OFFICIAL_SOURCE = "https://github.com/sankaHQ/extensions.git"
|
|
62
62
|
# Advance only after verifying the catalog's published release wheels.
|
|
63
63
|
# Development entries may still refer to releases awaiting publication.
|
|
64
|
-
OFFICIAL_REVISION = "
|
|
64
|
+
OFFICIAL_REVISION = "191bdaf9a92f567e74ac0af0b253b99e99158a4c"
|
|
65
65
|
DEFAULT_EXTENSION_ID = "sanka/drf-to-fastapi"
|
|
66
66
|
MAX_WHEEL_BYTES = 128 * 1024 * 1024
|
|
67
67
|
MAX_WHEEL_UNCOMPRESSED_BYTES = 512 * 1024 * 1024
|
|
@@ -102,7 +102,7 @@ def test_plan_summary_shows_strategy_route_split_and_apply_hint(tmp_path: Path)
|
|
|
102
102
|
" 0 need manual adaptation",
|
|
103
103
|
" readiness 100% (7/7 non-alias routes)",
|
|
104
104
|
]
|
|
105
|
-
assert hint == f"sanka apply --root
|
|
105
|
+
assert hint == f"sanka apply --root {tmp_path} --plan-hash {plan_hash}"
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
def test_apply_test_and_verify_summaries(tmp_path: Path) -> None:
|
|
@@ -118,7 +118,7 @@ def test_apply_test_and_verify_summaries(tmp_path: Path) -> None:
|
|
|
118
118
|
" Output .sanka/output/fastapi",
|
|
119
119
|
" Engine Tortoise ORM",
|
|
120
120
|
]
|
|
121
|
-
assert apply_hint == "sanka test
|
|
121
|
+
assert apply_hint == f"sanka test {tmp_path}"
|
|
122
122
|
|
|
123
123
|
test_lines, test_hint = application_summary(
|
|
124
124
|
"test",
|
|
@@ -130,7 +130,7 @@ def test_apply_test_and_verify_summaries(tmp_path: Path) -> None:
|
|
|
130
130
|
" Ran 7 tests",
|
|
131
131
|
" Env .sanka/output/fastapi/.venv",
|
|
132
132
|
]
|
|
133
|
-
assert test_hint == "sanka verify
|
|
133
|
+
assert test_hint == f"sanka verify {tmp_path}"
|
|
134
134
|
|
|
135
135
|
verify_lines, verify_hint = application_summary(
|
|
136
136
|
"verify",
|
|
@@ -165,12 +165,13 @@ def test_summary_tolerates_unknown_shapes() -> None:
|
|
|
165
165
|
assert application_summary("scan", "not a mapping") == ([], None) # type: ignore[arg-type]
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
def
|
|
168
|
+
def test_scan_hint_uses_declared_recommendation_targets() -> None:
|
|
169
169
|
_lines, hint = application_summary(
|
|
170
170
|
"scan",
|
|
171
171
|
{
|
|
172
172
|
"routes": [],
|
|
173
173
|
"extensions": [{"extension": {"id": "sanka/drf-to-fastapi", "version": "0.1.0a10"}}],
|
|
174
|
+
"recommendations": [{"id": "sanka/drf-to-fastapi", "targets": ["fastapi"]}],
|
|
174
175
|
},
|
|
175
176
|
)
|
|
176
177
|
assert hint == "sanka plan . --to python-fastapi"
|
|
@@ -611,7 +611,7 @@ def test_api_client_uses_public_branded_base_and_unwraps_data() -> None:
|
|
|
611
611
|
assert request.get_method() == "POST"
|
|
612
612
|
assert isinstance(request.data, bytes)
|
|
613
613
|
assert json.loads(request.data) == {"source": "SAP ECC", "lang": "ja"}
|
|
614
|
-
assert request.get_header("User-agent") == "sanka-cli/0.3.
|
|
614
|
+
assert request.get_header("User-agent") == "sanka-cli/0.3.9"
|
|
615
615
|
assert request.get_header("Content-type") == "application/json"
|
|
616
616
|
assert timeout == 10.0
|
|
617
617
|
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
import argparse
|
|
5
5
|
import io
|
|
6
6
|
import json
|
|
7
|
+
import shlex
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
from typing import cast
|
|
9
10
|
|
|
@@ -16,6 +17,61 @@ from sanka.runtime.extensions import ExtensionError
|
|
|
16
17
|
from sanka.runtime.extensions.runner import ExtensionResult, ExtensionRunner
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
@pytest.mark.parametrize("forwarded", [(), ("SANKA_GO_SOURCE_PYTHON",)])
|
|
21
|
+
@pytest.mark.parametrize("command", ["scan", "plan", "apply", "test"])
|
|
22
|
+
@pytest.mark.parametrize(
|
|
23
|
+
"options",
|
|
24
|
+
[
|
|
25
|
+
[],
|
|
26
|
+
["--artifact-dir", "reports and plans"],
|
|
27
|
+
["--extension-env", "SOURCE_PYTHON", "--extension-env", "DATABASE_URL"],
|
|
28
|
+
["--extension-env", "SANKA_GO_SOURCE_PYTHON"],
|
|
29
|
+
],
|
|
30
|
+
)
|
|
31
|
+
def test_next_hint_keeps_the_invocation_context(
|
|
32
|
+
tmp_path: Path,
|
|
33
|
+
capsys: pytest.CaptureFixture[str],
|
|
34
|
+
command: str,
|
|
35
|
+
options: list[str],
|
|
36
|
+
forwarded: tuple[str, ...],
|
|
37
|
+
) -> None:
|
|
38
|
+
tmp_path = tmp_path / "source project"
|
|
39
|
+
parser = _build_parser()
|
|
40
|
+
invocation = (
|
|
41
|
+
[command, "--root", str(tmp_path), "--plan-hash", "sha256:previous"]
|
|
42
|
+
if command == "apply"
|
|
43
|
+
else [command, str(tmp_path)]
|
|
44
|
+
)
|
|
45
|
+
args = parser.parse_args([*invocation, *options])
|
|
46
|
+
args.root = getattr(args, "root_option", None) or args.root
|
|
47
|
+
result = ExtensionResult(
|
|
48
|
+
"success",
|
|
49
|
+
{"plan_hash": "sha256:reviewed", "extensions": [{"id": "sanka/python-to-golang"}]},
|
|
50
|
+
(),
|
|
51
|
+
(),
|
|
52
|
+
(),
|
|
53
|
+
None,
|
|
54
|
+
forwarded_env_names=forwarded,
|
|
55
|
+
)
|
|
56
|
+
cli._print_application_result(args, command, result, migration_state="planned")
|
|
57
|
+
output = capsys.readouterr().out
|
|
58
|
+
hint = next(
|
|
59
|
+
line.removeprefix("next: ") for line in output.splitlines() if line.startswith("next: ")
|
|
60
|
+
)
|
|
61
|
+
tokens = shlex.split(hint)
|
|
62
|
+
following = parser.parse_args(tokens[1:])
|
|
63
|
+
assert Path(getattr(following, "root_option", None) or following.root) == tmp_path
|
|
64
|
+
assert following.artifact_dir == args.artifact_dir
|
|
65
|
+
assert following.extension_env == list(dict.fromkeys([*args.extension_env, *forwarded]))
|
|
66
|
+
if command == "scan":
|
|
67
|
+
assert following.to == "<target>"
|
|
68
|
+
if command == "plan":
|
|
69
|
+
assert following.plan_hash == result.data["plan_hash"]
|
|
70
|
+
if not options:
|
|
71
|
+
assert "--artifact-dir" not in tokens
|
|
72
|
+
assert ("--extension-env" in tokens) == bool(forwarded)
|
|
73
|
+
|
|
74
|
+
|
|
19
75
|
def test_extension_help_exposes_only_the_management_command_tree(
|
|
20
76
|
capsys: pytest.CaptureFixture[str],
|
|
21
77
|
) -> None:
|
|
@@ -175,6 +231,42 @@ def test_real_install_prompt_declines_by_default_and_preserves_selected_choice(
|
|
|
175
231
|
assert cli._lifecycle_prompt("Choose an extension to install", choices) == choices[2]
|
|
176
232
|
|
|
177
233
|
|
|
234
|
+
@pytest.mark.parametrize("choose_target", [False, True])
|
|
235
|
+
def test_plan_configuration_groups_keep_numbered_selections(
|
|
236
|
+
tmp_path: Path,
|
|
237
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
238
|
+
capsys: pytest.CaptureFixture[str],
|
|
239
|
+
choose_target: bool,
|
|
240
|
+
) -> None:
|
|
241
|
+
monkeypatch.setattr(cli, "_interactive_terminal", lambda: True)
|
|
242
|
+
|
|
243
|
+
def answer(label: str) -> str:
|
|
244
|
+
print(label)
|
|
245
|
+
return "2"
|
|
246
|
+
|
|
247
|
+
monkeypatch.setattr("builtins.input", answer)
|
|
248
|
+
args = _build_parser().parse_args(["plan", str(tmp_path)])
|
|
249
|
+
for _ in range(2):
|
|
250
|
+
lifecycle = cli._application_lifecycle(args)
|
|
251
|
+
assert lifecycle.prompt is not None
|
|
252
|
+
if choose_target:
|
|
253
|
+
assert (
|
|
254
|
+
lifecycle.prompt("Choose a migration target", ("go-chi", "go-fiber")) == "go-fiber"
|
|
255
|
+
)
|
|
256
|
+
assert (
|
|
257
|
+
lifecycle.prompt(
|
|
258
|
+
"Extension configuration: Destination database", ("auto", "pgx", "sqlite")
|
|
259
|
+
)
|
|
260
|
+
== "pgx"
|
|
261
|
+
)
|
|
262
|
+
assert lifecycle.prompt("Extension configuration: output [generated]", None) == "2"
|
|
263
|
+
lines = capsys.readouterr().out.splitlines()
|
|
264
|
+
assert sum(bool(line) and not line.startswith(" ") for line in lines) == 1
|
|
265
|
+
assert all(line.startswith(" ") for line in lines if line.lstrip()[:1].isdigit())
|
|
266
|
+
assert lines[-1].startswith(" ")
|
|
267
|
+
assert lines.count("") == (2 if choose_target else 1)
|
|
268
|
+
|
|
269
|
+
|
|
178
270
|
def test_extension_config_requires_a_json_object(capsys: pytest.CaptureFixture[str]) -> None:
|
|
179
271
|
assert main(["scan", ".", "--extension-config", "[]", "--json"]) == 2
|
|
180
272
|
payload = json.loads(capsys.readouterr().out)
|
|
@@ -45,7 +45,6 @@ from sanka.runtime.execution import (
|
|
|
45
45
|
mark_execution_failed,
|
|
46
46
|
normalized_attempt_identity,
|
|
47
47
|
reconcile_terminal_batch_pages,
|
|
48
|
-
reopen_incomplete_routes,
|
|
49
48
|
)
|
|
50
49
|
from sanka.runtime.execution.state import ClaimOutcome, ExecutionJournal
|
|
51
50
|
from sanka.runtime.state import TERMINAL_WRITE_STATUSES
|
|
@@ -387,56 +386,6 @@ def test_known_incomplete_route_keys_falls_back_to_route_progress() -> None:
|
|
|
387
386
|
assert incomplete == {_ACCOUNT_ROUTE}
|
|
388
387
|
|
|
389
388
|
|
|
390
|
-
def test_reopen_incomplete_routes_resumes_from_page_cursor_then_last_record_id() -> None:
|
|
391
|
-
snapshot = ExecutionSnapshot(
|
|
392
|
-
completed_routes={_ACCOUNT_ROUTE, _CONTACT_ROUTE},
|
|
393
|
-
batch_pages={
|
|
394
|
-
_ACCOUNT_ROUTE: BatchPage(
|
|
395
|
-
source_record_ids=("001A", "001B"), next_cursor="cursor-b", has_more=False
|
|
396
|
-
),
|
|
397
|
-
_CONTACT_ROUTE: BatchPage(
|
|
398
|
-
source_record_ids=("003A", "003B"), next_cursor=None, has_more=False
|
|
399
|
-
),
|
|
400
|
-
},
|
|
401
|
-
)
|
|
402
|
-
|
|
403
|
-
reopen_incomplete_routes(
|
|
404
|
-
snapshot,
|
|
405
|
-
route_keys={_ACCOUNT_ROUTE, _CONTACT_ROUTE},
|
|
406
|
-
require_checkpoint=True,
|
|
407
|
-
)
|
|
408
|
-
|
|
409
|
-
assert snapshot.checkpoints == {_ACCOUNT_ROUTE: "cursor-b", _CONTACT_ROUTE: "003B"}
|
|
410
|
-
assert snapshot.completed_routes == set()
|
|
411
|
-
assert snapshot.has_more is True
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
def test_reopen_incomplete_routes_refuses_without_a_safe_checkpoint() -> None:
|
|
415
|
-
snapshot = ExecutionSnapshot(completed_routes={_ACCOUNT_ROUTE})
|
|
416
|
-
|
|
417
|
-
with pytest.raises(ExecutionFault) as fault:
|
|
418
|
-
reopen_incomplete_routes(
|
|
419
|
-
snapshot,
|
|
420
|
-
route_keys={_ACCOUNT_ROUTE},
|
|
421
|
-
require_checkpoint=True,
|
|
422
|
-
)
|
|
423
|
-
|
|
424
|
-
assert fault.value.code == "SANKA_MIGRATE_SOURCE_CHECKPOINT_MISSING"
|
|
425
|
-
# refused before mutating anything
|
|
426
|
-
assert snapshot.checkpoints == {}
|
|
427
|
-
assert snapshot.completed_routes == {_ACCOUNT_ROUTE}
|
|
428
|
-
assert snapshot.has_more is False
|
|
429
|
-
|
|
430
|
-
reopen_incomplete_routes(
|
|
431
|
-
snapshot,
|
|
432
|
-
route_keys={_ACCOUNT_ROUTE},
|
|
433
|
-
require_checkpoint=False,
|
|
434
|
-
)
|
|
435
|
-
assert snapshot.checkpoints == {}
|
|
436
|
-
assert snapshot.completed_routes == set()
|
|
437
|
-
assert snapshot.has_more is True
|
|
438
|
-
|
|
439
|
-
|
|
440
389
|
# -- durable result rebuild ---------------------------------------------------
|
|
441
390
|
|
|
442
391
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from sanka.runtime.execution import (
|
|
5
|
+
BatchPage,
|
|
6
|
+
ExecutionFault,
|
|
7
|
+
ExecutionSnapshot,
|
|
8
|
+
reopen_incomplete_routes,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
_ACCOUNT_ROUTE = "Account|companies"
|
|
12
|
+
_CONTACT_ROUTE = "Contact|contacts"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@pytest.mark.parametrize("checkpoint", [None, "001A"])
|
|
16
|
+
def test_reopen_incomplete_routes_resumes_from_page_cursor_then_last_record_id(
|
|
17
|
+
checkpoint: str | None,
|
|
18
|
+
) -> None:
|
|
19
|
+
snapshot = ExecutionSnapshot(
|
|
20
|
+
completed_routes={_ACCOUNT_ROUTE, _CONTACT_ROUTE},
|
|
21
|
+
checkpoints={_ACCOUNT_ROUTE: checkpoint} if checkpoint else {},
|
|
22
|
+
batch_pages={
|
|
23
|
+
_ACCOUNT_ROUTE: BatchPage(
|
|
24
|
+
source_record_ids=("001A", "001B"), next_cursor="cursor-b", has_more=False
|
|
25
|
+
),
|
|
26
|
+
_CONTACT_ROUTE: BatchPage(
|
|
27
|
+
source_record_ids=("003A", "003B"), next_cursor=None, has_more=False
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
reopen_incomplete_routes(
|
|
33
|
+
snapshot,
|
|
34
|
+
route_keys={_ACCOUNT_ROUTE, _CONTACT_ROUTE},
|
|
35
|
+
require_checkpoint=True,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
assert snapshot.checkpoints == {
|
|
39
|
+
_ACCOUNT_ROUTE: checkpoint or "cursor-b",
|
|
40
|
+
_CONTACT_ROUTE: "003B",
|
|
41
|
+
}
|
|
42
|
+
assert snapshot.completed_routes == set()
|
|
43
|
+
assert snapshot.has_more is True
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def test_reopen_incomplete_routes_refuses_without_a_safe_checkpoint() -> None:
|
|
47
|
+
snapshot = ExecutionSnapshot(completed_routes={_ACCOUNT_ROUTE})
|
|
48
|
+
|
|
49
|
+
with pytest.raises(ExecutionFault) as fault:
|
|
50
|
+
reopen_incomplete_routes(
|
|
51
|
+
snapshot,
|
|
52
|
+
route_keys={_ACCOUNT_ROUTE},
|
|
53
|
+
require_checkpoint=True,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
assert fault.value.code == "SANKA_MIGRATE_SOURCE_CHECKPOINT_MISSING"
|
|
57
|
+
# refused before mutating anything
|
|
58
|
+
assert snapshot.checkpoints == {}
|
|
59
|
+
assert snapshot.completed_routes == {_ACCOUNT_ROUTE}
|
|
60
|
+
assert snapshot.has_more is False
|
|
61
|
+
|
|
62
|
+
reopen_incomplete_routes(
|
|
63
|
+
snapshot,
|
|
64
|
+
route_keys={_ACCOUNT_ROUTE},
|
|
65
|
+
require_checkpoint=False,
|
|
66
|
+
)
|
|
67
|
+
assert snapshot.checkpoints == {}
|
|
68
|
+
assert snapshot.completed_routes == set()
|
|
69
|
+
assert snapshot.has_more is True
|