Skip to content

Commit

Permalink
Fix bugs introduced when moving the code of issue generation to breeze (
Browse files Browse the repository at this point in the history
#28683)

The #28352 introduced subtle bugs which failed when runnint it during
provider generation.

Also added running the command automatically in CI.

(cherry picked from commit 69ab7d8)
  • Loading branch information
potiuk authored and ephraimbuddy committed Mar 9, 2023
1 parent 52025d4 commit d993949
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -781,13 +781,15 @@ def get_prs_for_package(package_id: str) -> list[int]:
help="Only consider package ids with packages prepared in the dist folder",
)
@click.option("--excluded-pr-list", type=str, help="Coma-separated list of PRs to exclude from the issue.")
@click.option("--disable-progress", is_flag=True, help="Disable progress bar")
@argument_packages
def generate_issue_content_providers(
packages: list[str],
github_token: str,
suffix: str,
only_available_in_dist: bool,
excluded_pr_list: str,
disable_progress: bool,
):
import jinja2
import yaml
Expand All @@ -812,14 +814,14 @@ class ProviderPRInfo(NamedTuple):
all_prs: set[int] = set()
provider_prs: dict[str, list[int]] = {}
if only_available_in_dist:
files_in_dist = os.listdir(str(APACHE_AIRFLOW_GITHUB_REPOSITORY / "dist"))
files_in_dist = os.listdir(str(AIRFLOW_SOURCES_ROOT / "dist"))
prepared_package_ids = []
for package_id in packages:
if not only_available_in_dist or is_package_in_dist(files_in_dist, package_id):
get_console().print(f"Extracting PRs for provider {package_id}")
prepared_package_ids.append(package_id)
else:
get_console.print(
get_console().print(
f"Skipping extracting PRs for provider {package_id} as it is missing in dist"
)
continue
Expand All @@ -829,7 +831,7 @@ class ProviderPRInfo(NamedTuple):
g = Github(github_token)
repo = g.get_repo("apache/airflow")
pull_requests: dict[int, PullRequest.PullRequest | Issue.Issue] = {}
with Progress(console=get_console()) as progress:
with Progress(console=get_console(), disable=disable_progress) as progress:
task = progress.add_task(f"Retrieving {len(all_prs)} PRs ", total=len(all_prs))
pr_list = list(all_prs)
for i in range(len(pr_list)):
Expand Down
4 changes: 2 additions & 2 deletions images/breeze/output-commands-hash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ prod-image:verify:31bc5efada1d70a0a31990025db1a093
prod-image:a4013428dc7f71a1defc3778d2efe3dc
release-management:create-minor-branch:6a01066dce15e09fb269a8385626657c
release-management:generate-constraints:ae30d6ad49a1b2c15b61cb29080fd957
release-management:generate-issue-content-providers:6e7287bf4933341ce2dfb36f1418cda2
release-management:generate-issue-content-providers:185d92ad2b12ce8628c02e4c0cbbc416
release-management:prepare-airflow-package:3ac14ea6d2b09614959c0ec4fd564789
release-management:prepare-provider-documentation:3fe5ead9887c518d1b397d1103dc0025
release-management:prepare-provider-packages:40144cb01afc56f6a4f92d9e117e546e
release-management:release-prod-images:c9bc40938e0efad49e51ef66e83f9527
release-management:start-rc-process:6aafbaceabd7b67b9a1af4c2f59abc4c
release-management:start-release:acb384d86e02ff5fde1bf971897be17c
release-management:verify-provider-packages:8d3c6362657d76bb3cd064fed5596e84
release-management:c37c732dc8c5d454aedc6cf3bd20bdf0
release-management:339e2dd239185af1df5d73d116aebde5
setup:autocomplete:03343478bf1d0cf9c101d454cdb63b68
setup:check-all-params-in-groups:4d0f8c19cbdb56290055d863b08a3376
setup:config:3ffcd35dd24b486ddf1d08b797e3d017
Expand Down
Loading

0 comments on commit d993949

Please sign in to comment.