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
The #28352 introduced subtle bugs which failed when runnint it during
provider generation.

Also added running the command automatically in CI.
  • Loading branch information
potiuk committed Jan 2, 2023
1 parent 322dd3f commit f132493
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 36 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,10 @@ jobs:
- name: "Verify sdist packages with twine"
run: pipx install twine && twine check dist/*.tar.gz
if: matrix.package-format == 'sdist'
- name: "Test issue generation automatically"
run: >
breeze release-management generate-issue-content --only-available-in-dist --disable-progress
if: matrix.package-format == 'wheel'
- name: "Install and test provider packages and airflow via ${{matrix.package-format}} files"
run: breeze release-management verify-provider-packages --use-packages-from-dist
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,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(
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 @@ -809,14 +811,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 @@ -826,7 +828,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 @@ -36,13 +36,13 @@ prod-image:pull:e3c89dd908fc44adf6e159c2950ebdd0
prod-image:verify:31bc5efada1d70a0a31990025db1a093
prod-image:4f98deab35e53ebddbdc9950a50555a4
release-management:generate-constraints:ae30d6ad49a1b2c15b61cb29080fd957
release-management:generate-issue-content:c144f114ddfc859f60da6b7b4987116a
release-management:generate-issue-content:92b05ebd1aa7e16763f1a9a4f4714bc9
release-management:prepare-airflow-package:3ac14ea6d2b09614959c0ec4fd564789
release-management:prepare-provider-documentation:ae873854b47240fa36019a14ccc0b705
release-management:prepare-provider-packages:45d22c47b1d5e09a08d2a7218fe7a8a6
release-management:release-prod-images:c9bc40938e0efad49e51ef66e83f9527
release-management:verify-provider-packages:88bd609aff6d09d52ab8d80d6e055e7b
release-management:5e44515494c7fd719ddbdb95e5f15514
release-management:c26f14d85c5a095bebc8aa4c74c6c5fb
setup:autocomplete:03343478bf1d0cf9c101d454cdb63b68
setup:config:3ffcd35dd24b486ddf1d08b797e3d017
setup:regenerate-command-images:ab2d83c339fa3a42b0c819b6b6cc88ae
Expand Down
Loading

0 comments on commit f132493

Please sign in to comment.