Prepare or carry out authorized publication of Apache Airflow changes, including remote checks, pre-push verification, PR creation, and tracking deferred work.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-airflow-publish-changes-090ce4e024bc ,按照其中的说明把「airflow-publish-changes」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
For a plan, describe the steps without executing publication. For authorized
publication, preserve existing approval and confirmation boundaries.
Use the sections below for remote setup, existing PR checks, publication and
issue tracking. Follow root AGENTS.md for the applicable
test conventions and generated check commands; for contribution text, use
Draft Airflow contribution text.
Airflow standardises on two git remote names, and the rest of this file, the contributing docs, and the release docs all assume them:
upstream — the canonical apache/airflow repository (fetch from here).origin — the contributor's fork of apache/airflow (push PR branches here).Always push branches to origin. Never push directly to upstream (and never
push directly to main on either remote).
Before running any remote-based command, run git remote -v and verify the
names match this convention. If they do not — for example, the upstream remote
is called apache, or origin points at apache/airflow with the fork under a
different name like fork — do not silently go along with the existing
names. Surface the mismatch to the user and propose the exact rename commands
to bring the checkout in line with the convention, then ask the user to confirm
before running them. Examples:
Upstream is named apache, fork is origin (common legacy layout):
git remote rename apache upstream
origin points at apache/airflow and the fork is named fork (release-manager
/ "cloned upstream directly" layout):
git remote rename origin upstream
git remote rename fork origin
Upstream is missing entirely:
git remote add upstream https://github.com/apache/airflow.git
# or, for SSH:
git remote add upstream git@github.com:apache/airflow.git
Fork is missing entirely:
gh repo fork apache/airflow --remote --remote-name origin
After any rename/add, re-run git remote -v to confirm the new state before
continuing with commands that assume upstream / origin.
If a doc, script, or command you're about to run uses the old apache name (or
any other variant), translate it to the upstream convention in what you
propose to the user, rather than perpetuating the old name. Flag the stale
documentation so it can be fixed in a follow-up.
Before working on an issue, check for open PRs already addressing it
(gh pr list --search "<issue number or keywords>", and look for closes:
/ fixes: references). Airflow allows parallel work — "better PR wins"
(see contributing-docs/04_how_to_contribute.rst) — but it is not the
default: prefer reviewing and building on an existing PR. Open a separate
one only if your approach is genuinely different. Do not blindly open
another near-identical PR for an issue that already has one (or several) —
that just adds reviewer noise.
Always push to the user's fork (origin), not to upstream (apache/airflow).
Never push directly to main.
Before pushing, confirm the remote setup matches the conventions above
(upstream → apache/airflow, origin → your fork). Run git remote -v and,
if the names don't match, propose renames as described in "Git remote naming
conventions" — ask the user to confirm before running them.
If the fork remote does not exist at all, create one:
gh repo fork apache/airflow --remote --remote-name origin
Before pushing, perform a self-review of your changes following the Gen-AI review guidelines
in contributing-docs/05_pull_requests.rst and the
code review checklist in .github/instructions/code-review.instructions.md:
git diff main...HEAD) and verify every change is intentional and
related to the task — remove any unrelated changes..github/instructions/code-review.instructions.md and check your diff against every
rule — architecture boundaries, database correctness, code quality, testing requirements,
API correctness, and AI-generated code signals. Fix any violations before pushing.AGENTS.md.prek run --from-ref <target_branch> --stage pre-commit)
and fix any failures. This includes mypy checks for non-provider projects (airflow-core, task-sdk, airflow-ctl, dev, scripts, devel-common).prek run --from-ref <target_branch> --stage manual --skip compile-ui-assets-dev --skip view-skill-eval --skip run-skill-eval-codex)
and fix any failures. The skipped hooks start long-running local servers or provision the
opt-in Codex environment rather than run checks that complete.Before pushing, always rebase your branch onto the latest target branch (usually main)
to avoid merge conflicts and ensure CI runs against up-to-date code:
git fetch upstream <target_branch>
git rebase upstream/<target_branch>
If there are conflicts, resolve them and continue the rebase. If the rebase is too complex, ask the user for guidance.
Then push the branch to your fork (origin) and open the PR creation page in the browser
with the body pre-filled (including the generative AI disclosure already checked):
git push -u origin <branch-name>
gh pr create --web --title "Short title (under 70 chars)" --body "$(cat <<'EOF'
Brief description of the changes.
closes: #ISSUE (if applicable)
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — <Agent Name and Version>
Generated-by: <Agent Name and Version> following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
EOF
)"
The --web flag opens the browser so the user can review and submit. The --body flag
pre-fills the PR template with the generative AI disclosure already completed.
Remind the user to:
fix:, feat:, chore:, …).closes: #ISSUE or related: #ISSUE).If you already know how to fix the problem and you (or the user) are going to open the PR shortly, do not file a GitHub issue first. Go straight to the PR.
The one exception is the case covered by the next section: the PR ships a workaround, mitigation, or partial fix and the real follow-up work is genuinely deferred to a later PR. There, the issue captures work that will outlive the PR, so the issue is load-bearing rather than duplicate.
When a PR applies a workaround, version cap, mitigation, or partial fix rather than solving the underlying problem (for example: upper-binding a dependency to avoid a breaking upstream release, disabling a feature behind a flag, reverting a change that needs a better replacement, or papering over a bug so a release can ship), the deferred work must be captured in a GitHub tracking issue and the tracking issue URL must appear as a comment at the workaround site in the code.
Open the tracking issue first, before finalising the PR body.
Reference it in the PR body by number — e.g. "full migration is tracked in #65609" — so anyone reviewing the PR can see what was deferred and why.
Add a link to the tracking issue as a comment at the workaround
itself, so the reference survives after the PR merges and anyone
reading the source later can click straight through to the follow-up
work. Use the full issue URL, not bare #NNNNN — bare references
do not auto-link outside GitHub's web UI (e.g. when grepping in an
editor, browsing a checkout, or reading the file in a terminal).
For example:
# pyproject.toml
# Remove the <1.0 cap after migrating to httpx 1.x;
# tracked at https://github.com/apache/airflow/issues/65609
"httpx>=0.27.0,<1.0",
# some_module.py
# Delete this fallback once the new client is on all workers;
# tracked at https://github.com/apache/airflow/issues/65609
if old_client:
...
Do not write vague forward-looking phrases like "will open a tracking issue" or "to be filed later" in the PR body or in code comments. Open the issue, link it in both places, then submit the PR.
The tracking issue should describe: what the workaround is, why it was chosen, the concrete follow-up work needed, and any acceptance criteria for removing the workaround.
If a PR you already opened has such forward-looking language, open the tracking issue, add a PR comment referencing the issue URL, and push a follow-up commit that adds the tracking-issue URL as a comment at the workaround site in the code.