Skip to content

Commit

Permalink
Fix passing string to upgrade-to-newer-dependencies (#22649)
Browse files Browse the repository at this point in the history
This change fixes passing upgrade-to-newer-dependencies
parameter as string. The previous fix (#22597) did not actually
fix handling of the parameter passed and "false" passed as string
was considered as "true" :)

This should speed UP most CI builds immensely.

GitOrigin-RevId: f41416744f0f55fba89f647e1b52c881786ecf33
  • Loading branch information
potiuk authored and Cloud Composer Team committed Sep 12, 2024
1 parent 0a3f9e1 commit 0e581fa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
8 changes: 4 additions & 4 deletions dev/breeze/src/airflow_breeze/breeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def build_ci_image(
build_cache: Optional[str],
platform: Optional[str],
debian_version: Optional[str],
upgrade_to_newer_dependencies: Optional[str],
upgrade_to_newer_dependencies: str = "false",
):
"""Builds docker CI image without entering the container."""

Expand Down Expand Up @@ -331,7 +331,7 @@ def build_ci_image(
docker_cache=build_cache,
platform=platform,
debian_version=debian_version,
upgrade_newer_dependencies=upgrade_to_newer_dependencies,
upgrade_to_newer_dependencies=upgrade_to_newer_dependencies,
)


Expand Down Expand Up @@ -409,7 +409,7 @@ def build_prod_image(
github_repository: Optional[str],
platform: Optional[str],
debian_version: Optional[str],
upgrade_to_newer_dependencies: bool,
upgrade_to_newer_dependencies: str,
prepare_buildx_cache: bool,
skip_installing_airflow_providers_from_sources: bool,
disable_pypi_when_building: bool,
Expand Down Expand Up @@ -454,7 +454,7 @@ def build_prod_image(
github_repository=github_repository,
platform=platform,
debian_version=debian_version,
upgrade_newer_dependencies=upgrade_to_newer_dependencies,
upgrade_to_newer_dependencies=upgrade_to_newer_dependencies,
prepare_buildx_cache=prepare_buildx_cache,
skip_installing_airflow_providers_from_sources=skip_installing_airflow_providers_from_sources,
disable_pypi_when_building=disable_pypi_when_building,
Expand Down
9 changes: 1 addition & 8 deletions dev/breeze/src/airflow_breeze/ci/build_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@dataclass
class BuildParams:
# To construct ci_image_name
upgrade_newer_dependencies: bool = False
upgrade_to_newer_dependencies: str = "false"
python_version: str = "3.7"
airflow_branch: str = AIRFLOW_BRANCH
build_id: int = 0
Expand Down Expand Up @@ -121,10 +121,3 @@ def docker_cache_ci_directive(self) -> List:
@property
def airflow_version(self):
return get_airflow_version()

@property
def upgrade_to_newer_dependencies(self) -> str:
upgrade_to_newer_dependencies = 'false'
if self.upgrade_newer_dependencies:
upgrade_to_newer_dependencies = 'true'
return upgrade_to_newer_dependencies
9 changes: 1 addition & 8 deletions dev/breeze/src/airflow_breeze/prod/prod_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ProdParams:
install_docker_context_files: bool
disable_pypi_when_building: bool
disable_pip_cache: bool
upgrade_newer_dependencies: bool
upgrade_to_newer_dependencies: str
skip_installing_airflow_providers_from_sources: bool
cleanup_docker_context_files: bool
prepare_buildx_cache: bool
Expand Down Expand Up @@ -364,13 +364,6 @@ def install_from_docker_context_files(self) -> str:
install_from_docker_context_files = 'true'
return install_from_docker_context_files

@property
def upgrade_to_newer_dependencies(self) -> str:
upgrade_to_newer_dependencies = 'false'
if self.upgrade_newer_dependencies:
upgrade_to_newer_dependencies = 'true'
return upgrade_to_newer_dependencies

@property
def airflow_extras(self):
return get_airflow_extras()
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/tests/test_prod_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'install_docker_context_files': False,
'disable_pypi_when_building': False,
'disable_pip_cache': False,
'upgrade_newer_dependencies': False,
'upgrade_to_newer_dependencies': False,
'skip_installing_airflow_providers_from_sources': False,
'cleanup_docker_context_files': False,
'prepare_buildx_cache': False,
Expand Down

0 comments on commit 0e581fa

Please sign in to comment.