Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Apache Airflow Cherry Pick Automation

From Leeroopedia


Knowledge Sources
Domains Release_Engineering, Automation
Last Updated 2026-02-08 00:00 GMT

Overview

Concrete tool for automating cherry-pick tracking and milestone assignment provided by assign_cherry_picked_prs_with_milestone.py.

Description

The assign_cherry_picked_prs_with_milestone.py script uses the GitHub API (via PyGithub) to compare git log between releases, extract PR numbers from commit messages, categorize changes, and assign PRs to the target milestone. The .cherry_picker.toml configures the cherry-picker tool for automated backporting.

Usage

Run after cherry-picking commits to the release branch to update milestone assignments.

Code Reference

Source Location

  • Repository: Apache Airflow
  • File: dev/assign_cherry_picked_prs_with_milestone.py
  • Lines: L1-392

Signature

@cli.command()
def assign_prs(
    github_token: str,
    previous_release: str,
    current_release: str,
    verbose: bool,
    limit_pr_count: int | None,
    dry_run: bool,
    milestone_number: int,
    skip_assigned: bool,
    print_summary: bool,
    assume_yes: bool,
    output_folder: str,
) -> None:
    """Assign cherry-picked PRs to a milestone."""
    ...

def get_changes(
    verbose: bool,
    previous_release: str,
    current_release: str,
) -> list[Change]:
    """Get list of changes between two releases."""
    ...

def update_milestone(r: Repository, pr: PullRequest, m: Milestone) -> None:
    """Update PR milestone assignment."""
    ...

Import

# Assign PRs to milestone
python dev/assign_cherry_picked_prs_with_milestone.py assign-prs \
  --github-token $GITHUB_TOKEN \
  --previous-release 3.0.0 \
  --current-release 3.1.0 \
  --milestone-number 42

I/O Contract

Inputs

Name Type Required Description
github_token str Yes GitHub Personal Access Token
previous_release str Yes Previous release tag
current_release str Yes Current release tag
milestone_number int Yes Target GitHub milestone ID

Outputs

Name Type Description
Milestone assignments GitHub API PRs assigned to target milestone
Change categorization Files CHANGELOG_CHANGES, DOC_ONLY_CHANGES, EXCLUDED_CHANGES
Summary report Console PR counts and categories

Usage Examples

Assign Cherry-Picks to Milestone

python dev/assign_cherry_picked_prs_with_milestone.py assign-prs \
  --github-token "$GITHUB_TOKEN" \
  --previous-release 3.0.0 \
  --current-release 3.1.0 \
  --milestone-number 42 \
  --print-summary

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment