Skip to content

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Sep 15, 2025

Summary

  • Loader now returns DeploymentConfig models instead of dicts
  • CLI applies flags directly onto models for strong typing
  • Core deploy path resolves/normalizes on the model, then dumps to dicts only when building RunnerDeployment
  • Keeps behavior for defaults, templating, actions; fixes legacy schedule: {} promotion

Details

  • _load_deploy_configs_and_actions: returns list[DeploymentConfig] + actions dict
  • Selection helpers (_parse_name_from_pattern, _filter_matching_deploy_config, _handle_pick_deploy_*) accept models and convert to dicts for prompt/display and downstream execution
  • _apply_cli_options_to_deploy_config: takes/returns DeploymentConfig; merges params, variables and work-pool fields; accepts dict concurrency_limit and validates into ConcurrencyLimitSpec
  • _handle_deprecated_schedule_fields: typed to DeploymentConfig; only promotes schedule to schedules if non-empty when dict (avoids schedule: {} errors)
  • _run_single_deploy: dict -> model -> resolve blocks/vars/env -> apply options -> template -> dump JSON for RunnerDeployment construction

Why

  • Strengthens typing across deploy CLI, reducing key typos and easing refactors
  • Minimizes blast radius by retaining dicts at integration boundaries

Testing

  • Reproduced and fixed TestProjectDeploy::test_project_deploy locally
  • Can run full CLI deploy suite if desired

Follow-ups

  • Consider migrating remaining deploy helpers to model-first or adding mypy coverage for deploy package.

…ns DeploymentConfig models\n- CLI applies options on models\n- Core resolves model, then dumps to dict for RunnerDeployment\n- Preserve default merges and templating; fix legacy empty schedule handling
Copy link

codspeed-hq bot commented Sep 15, 2025

CodSpeed Performance Report

Merging #18951 will not alter performance

Comparing refactor/typed-deploy-models (ff5a29a) with main (f6417e7)

Summary

✅ 2 untouched

…h by applying flag from resolved config (dd)
…and re-import default merger; prevents None parameters and avoids prompting when top-level pull exists
…t to satisfy _save_deployment_to_prefect_file expectations
Copy link
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant