Skip to content
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

Add better feedback to Breeze users about expected action timing #23827

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,26 +380,30 @@ def should_we_run_the_build(build_ci_params: BuildCiParams, verbose: bool) -> bo
return False
try:
answer = user_confirm(
message="Do you want to build the image?", timeout=STANDARD_TIMEOUT, default_answer=Answer.NO
message="Do you want to build the image (this works best when you have good connection and "
"can take usually from 20 seconds to few minutes depending how old your image is)?",
timeout=STANDARD_TIMEOUT,
default_answer=Answer.NO,
)
if answer == answer.YES:
if is_repo_rebased(build_ci_params.github_repository, build_ci_params.airflow_branch):
return True
else:
get_console().print(
"\n[warning]This might take a lot of time, we think you should rebase first.[/]\n"
"\n[warning]This might take a lot of time (more than 10 minutes) even if you have"
"a good network connection. We think you should attempt to rebase first.[/]\n"
)
answer = user_confirm(
"But if you really, really want - you can do it. Are you really sure?",
"But if you really, really want - you can attempt it. Are you really sure?",
timeout=STANDARD_TIMEOUT,
default_answer=Answer.NO,
)
if answer == Answer.YES:
return True
else:
get_console().print(
"[info]Please rebase your code before continuing.[/]\n"
"Check this link to know more "
f"[info]Please rebase your code to latest {build_ci_params.airflow_branch} "
"before continuing.[/]\nCheck this link to find out how "
"https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#id15\n"
)
get_console().print('[error]Exiting the process[/]\n')
Expand Down Expand Up @@ -535,6 +539,9 @@ def rebuild_ci_image_if_needed(
if verbose:
get_console().print(f'[info]{build_params.image_type} image already built locally.[/]')
else:
get_console().print(f'[warning]{build_params.image_type} image not built locally. Forcing build.[/]')
get_console().print(
f'[warning]{build_params.image_type} image was never built locally or deleted. '
'Forcing build.[/]'
)
ci_image_params.force_build = True
build_ci_image(verbose, dry_run=dry_run, ci_image_params=ci_image_params)
9 changes: 6 additions & 3 deletions dev/breeze/src/airflow_breeze/utils/reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def ask_to_reinstall_breeze(breeze_sources: Path, timeout: Optional[int] = STAND
otherwise it is yes
"""
answer = user_confirm(
f"Do you want to reinstall Breeze from {breeze_sources.parent.parent}?",
f"Do you want to reinstall Breeze from {breeze_sources.parent.parent} "
"(This should usually take couple of seconds)?",
default_answer=Answer.NO if timeout else Answer.YES,
timeout=timeout,
)
Expand All @@ -77,7 +78,8 @@ def warn_different_location(installation_airflow_sources: Path, current_airflow_
f"Current Airflow sources : {current_airflow_sources}\n\n"
f"[warning]This might cause various problems!![/]\n\n"
f"If you experience problems - reinstall Breeze with:\n\n"
f" {NAME} self-upgrade --force --use-current-airflow-sources\n\n"
f" {NAME} self-upgrade --force --use-current-airflow-sources\n"
f"\nThis should usually take couple of seconds.\n"
)


Expand All @@ -86,5 +88,6 @@ def warn_dependencies_changed():
f"\n[warning]Breeze dependencies changed since the installation![/]\n\n"
f"[warning]This might cause various problems!![/]\n\n"
f"If you experience problems - reinstall Breeze with:\n\n"
f" {NAME} self-upgrade --force\n\n"
f" {NAME} self-upgrade --force\n"
"\nThis should usually take couple of seconds.\n"
)