Skip to content

add --dry-run flag to prefect deploy #18159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

add --dry-run flag to prefect deploy #18159

wants to merge 3 commits into from

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented May 23, 2025

closes #17814

problem

When deploying multiple flows with prefect deploy --all, configuration errors could leave deployments in a "half new, half old" state. Users needed a way to validate deployment configurations before making any changes.

solution

Added a --dry-run flag that validates deployment configurations without making any API calls or resource changes.

usage

# Validate single deployment
prefect deploy my_flow.py:my_function --dry-run

# Validate all deployments in project  
prefect deploy --all --dry-run

# Validate specific deployments
prefect deploy -n deployment1 -n deployment2 --dry-run

notes

It's pretty unfortunate how much branching this adds, but without fully refactoring this file, it wasn't clear to me how else to do it.

@github-actions github-actions bot added the enhancement An improvement of an existing feature label May 23, 2025
@zzstoatzz zzstoatzz added the cli Related to the Prefect CLI label May 23, 2025
@zzstoatzz zzstoatzz changed the title Dry run add --dry-run flag to prefect deploy May 23, 2025
Copy link

codspeed-hq bot commented May 23, 2025

CodSpeed Performance Report

Merging #18159 will not alter performance

Comparing dry-run (2063c38) with main (8dce080)

Summary

✅ 2 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jun 6, 2025

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.

Copy link
Contributor

This pull request was closed because it has been stale for 14 days with no activity. If this pull request is important or you have more to add feel free to re-open it.

@github-actions github-actions bot closed this Jun 20, 2025
@zzstoatzz zzstoatzz reopened this Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the Prefect CLI enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a --dry-run switch or equivalent to prefect deploy
1 participant