Skip to content

Commit

Permalink
Add a dry-run flag to dev/check_patch_prs.py (mlflow#13110)
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <[email protected]>
  • Loading branch information
harupy authored Sep 18, 2024
1 parent a1c01b9 commit 4fef77a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev/check_patch_prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ def fetch_patch_prs(version):

@click.command()
@click.option("--version", required=True, help="The version to release")
def main(version):
@click.option(
"--dry-run/--no-dry-run",
"dry_run",
is_flag=True,
default=True,
envvar="DRY_RUN",
)
def main(version, dry_run):
release_branch = get_release_branch(version)
commits = get_commits(release_branch)
patch_prs = fetch_patch_prs(version)
Expand All @@ -114,7 +121,7 @@ def main(version):
print("3. Run the following command on the new branch:\n")
print("git cherry-pick " + " ".join(cherry_picks[::-1]))
print(f"\n4. File a PR against {release_branch}.")
sys.exit(1)
sys.exit(0 if dry_run else 1)


if __name__ == "__main__":
Expand Down

0 comments on commit 4fef77a

Please sign in to comment.