Skip to content

Refactor breeze pr auto-triage into isolated modules#64831

Draft
potiuk wants to merge 1 commit intoapache:mainfrom
potiuk:refactor/pr-auto-triage-modules
Draft

Refactor breeze pr auto-triage into isolated modules#64831
potiuk wants to merge 1 commit intoapache:mainfrom
potiuk:refactor/pr-auto-triage-modules

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 7, 2026

Extract the monolithic pr_commands.py (12,400 lines) into 7 focused modules with clean separation of concerns:

  • pr_github.py: GitHub API layer (GraphQL/REST, auth, labels, mutations)
  • pr_actions.py: Action recommendation and execution with named thresholds
  • pr_checks.py: CI check analysis, log parsing, failure detection
  • pr_workflows.py: Workflow run management (approve, cancel, rerun)
  • pr_authors.py: Author profiling and filtering (AuthorFilter enum)
  • pr_fetching.py: GraphQL PR data fetching and assembly
  • pr_enrichment.py: PR enrichment, filtering, and categorization pipeline

The most important module is pr_actions.py which encapsulates all decision logic with named constants (AUTHOR_FLAGGED_CLOSE_THRESHOLD, MAX_CI_FAILURES_FOR_RERUN, MAX_COMMITS_BEHIND_FOR_RERUN) replacing magic numbers.

pr_commands.py uses backward-compatible import aliases so all existing code continues to work without modification.

80 new tests added across 5 test files (174 total tests passing).

https://claude.ai/code/session_01JaPYna6Pnw4HMr4t5aCMiL


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Extract the monolithic pr_commands.py (12,400 lines) into 7 focused
modules with clean separation of concerns:

- pr_github.py: GitHub API layer (GraphQL/REST, auth, labels, mutations)
- pr_actions.py: Action recommendation and execution with named thresholds
- pr_checks.py: CI check analysis, log parsing, failure detection
- pr_workflows.py: Workflow run management (approve, cancel, rerun)
- pr_authors.py: Author profiling and filtering (AuthorFilter enum)
- pr_fetching.py: GraphQL PR data fetching and assembly
- pr_enrichment.py: PR enrichment, filtering, and categorization pipeline

The most important module is pr_actions.py which encapsulates all
decision logic with named constants (AUTHOR_FLAGGED_CLOSE_THRESHOLD,
MAX_CI_FAILURES_FOR_RERUN, MAX_COMMITS_BEHIND_FOR_RERUN) replacing
magic numbers.

pr_commands.py uses backward-compatible import aliases so all existing
code continues to work without modification.

80 new tests added across 5 test files (174 total tests passing).

https://claude.ai/code/session_01JaPYna6Pnw4HMr4t5aCMiL
@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch labels Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants