Skip to content

Standardize git remote naming on upstream/origin across docs and tooling#65629

Open
potiuk wants to merge 4 commits intoapache:mainfrom
potiuk:standardize-git-remote-conventions
Open

Standardize git remote naming on upstream/origin across docs and tooling#65629
potiuk wants to merge 4 commits intoapache:mainfrom
potiuk:standardize-git-remote-conventions

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 21, 2026

Airflow's contributing docs, release runbooks, and agent instructions used
a mix of apache, origin, and placeholder names for the git remote that
tracks apache/airflow. This PR standardizes on upstreamapache/airflow
and origin → the contributor's fork throughout — the two names already
assumed by dev/sync_fork.sh and by most beginner-facing docs — so that
contributors, release managers, and agents follow a single convention.

What changed

  • Contributing docs: new "Git remote naming conventions" section in
    contributing-docs/10_working_with_git.rst with migration commands for
    common legacy layouts (apache remote, origin-as-upstream, missing
    upstream/fork). 10_working_with_git.rst and 18_contribution_workflow.rst
    now use upstream in all fetch/rebase/reset examples.
  • Release runbooks: dev/README_RELEASE_AIRFLOW.md,
    README_RELEASE_AIRFLOWCTL.md, README_RELEASE_HELM_CHART.md,
    README_RELEASE_PROVIDERS.md, README_RELEASE_PYTHON_CLIENT.md, and
    MANUALLY_GENERATING_IMAGE_CACHE_AND_CONSTRAINTS.md switched from
    apache / origin-as-upstream to upstream, with a pointer to the new
    conventions section.
  • Agent instructions (AGENTS.md / CLAUDE.md): added a conventions
    section and instructed agents to surface remote-name mismatches to the
    user and propose concrete git remote rename commands rather than
    silently going along with whatever names the checkout uses.
  • Breeze CLI defaults & messages: --remote-name now defaults to
    upstream in release-management start-rc-process,
    release-management update-constraints, and
    sbom update-sbom-information. breeze ci find-backport-prs warns
    about a missing upstream (not apache) remote. The fallback list in
    tag_providers tries upstream first and keeps apache/origin for
    back-compat so existing release-manager setups keep working.
  • CI + generated artifacts: .github/workflows/basic-tests.yml adds
    upstream (not apache); regenerated the affected breeze help images.

Test plan

  • prek run --from-ref upstream/main --stage pre-commit — all hooks pass
  • grep sweep confirms no git remote add/fetch/push/pull/rebase apache
    or apache/main / apache/v*-test references remain in contributing
    docs, release docs, AGENTS.md, or dev/breeze/doc/
  • Regenerated breeze CLI help images match the new --remote-name defaults

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7, 1M context)

Generated-by: Claude Code (Opus 4.7, 1M context) following the guidelines

Copy link
Copy Markdown
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Comment thread contributing-docs/18_contribution_workflow.rst
potiuk added 2 commits April 22, 2026 01:04
Airflow's contributing docs, release runbooks, and agent instructions used
a mix of `apache`, `origin`, and placeholder names for the git remote that
tracks `apache/airflow`. Standardize on `upstream` → `apache/airflow` and
`origin` → the contributor's fork throughout — the two names already
assumed by `dev/sync_fork.sh` and by most beginner-facing docs — so that
contributors, release managers, and agents follow a single convention.

- Add a new "Git remote naming conventions" section to
  `contributing-docs/10_working_with_git.rst` with migration commands for
  the common legacy layouts (`apache` remote, origin-as-upstream, missing
  upstream/fork).
- Update `contributing-docs/10_working_with_git.rst`,
  `contributing-docs/18_contribution_workflow.rst`, and all
  `dev/README_RELEASE_*.md` runbooks to use `upstream` in examples and
  link to the conventions section.
- Update `AGENTS.md` (= `CLAUDE.md`) to document the convention and
  instruct agents to surface remote-name mismatches to the user and
  propose concrete `git remote rename` commands instead of silently
  using whatever names they find.
- Switch breeze CLI defaults and error messages to match: `--remote-name`
  now defaults to `upstream` in `release-management start-rc-process`,
  `release-management update-constraints`, and
  `sbom update-sbom-information`; `breeze ci find-backport-prs` warns
  about a missing `upstream` (not `apache`) remote; the fallback list in
  `tag_providers` now tries `upstream` first and keeps `apache`/`origin`
  for back-compat.
- Regenerate the affected breeze help images and update the
  `basic-tests.yml` CI workflow to add `upstream` rather than `apache`.
@o-nikolas pointed out that the new "never push directly to main on
either remote" phrasing in the Git remote naming conventions section
was stricter than the long-standing guidance in
18_contribution_workflow.rst, which explicitly tolerates developing
directly on your fork's main and opening a PR from there.

Align the conventions section with the more permissive stance and
cross-link to the Contribution Workflow step so both places say the
same thing. AGENTS.md keeps the stricter "no pushes to main" rule
because that advice is aimed at automated agents where branch-only
workflows are the right default.
@potiuk potiuk force-pushed the standardize-git-remote-conventions branch from f2d0d42 to 417e4ef Compare April 21, 2026 23:06
Comment thread contributing-docs/18_contribution_workflow.rst Outdated
naming convention — see
[`contributing-docs/10_working_with_git.rst`](../contributing-docs/10_working_with_git.rst#git-remote-naming-conventions)).
You can override this by passing `--remote-name` option to the command.
3. You need to run `breeze release-management update-constraints` command. The `breeze` command comes usually
Copy link
Copy Markdown
Collaborator

@Dev-iL Dev-iL Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider rewriting this bullet to avoid using "usually" twice. Suggestions by gemini:

  • ​Option 1 (Direct):
    You need to run the breeze release-management update-constraints command. Typically, breeze is run from a separate clone of the Airflow repository, specifically from the main branch.
    ​- Option 2 (Concise):
    Run the breeze release-management update-constraints command. This usually stems from another clone of the Airflow repository (often the main branch).
  • ​Option 3 (Action-oriented):
    You need to run breeze release-management update-constraints. Note that the breeze command generally comes from a different Airflow clone, specifically the one tracking the main branch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied option 1 ("Typically, breeze is run from a separate clone of the Airflow repository, on the main branch.") in 475f8ff — thanks!

Comment thread AGENTS.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes the naming convention of git remotes across Airflow docs and Breeze tooling so contributors and release managers consistently use upstream for apache/airflow and origin for forks.

Changes:

  • Updates Breeze CLI defaults/messages to prefer upstream (with some back-compat fallbacks).
  • Rewrites contributing + release documentation examples to use upstream/origin, adding a dedicated conventions section.
  • Regenerates Breeze CLI help output artifacts and updates CI workflow setup to add/fetch upstream.

Reviewed changes

Copilot reviewed 19 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dev/breeze/src/airflow_breeze/utils/github.py Switches default remote used for tag discovery to upstream and updates user guidance text.
dev/breeze/src/airflow_breeze/commands/sbom_commands.py Changes --remote-name default and help text to align with upstream convention.
dev/breeze/src/airflow_breeze/commands/release_management_commands.py Updates remote fallback order and defaults to prefer upstream while retaining legacy fallbacks.
dev/breeze/src/airflow_breeze/commands/release_candidate_command.py Changes release-candidate --remote-name default to upstream and clarifies intent in help.
dev/breeze/src/airflow_breeze/commands/ci_commands.py Updates warning message to reference the upstream convention.
dev/breeze/doc/images/output_sbom_update-sbom-information.txt Regenerated Breeze help output checksum for SBOM command.
dev/breeze/doc/images/output_sbom_update-sbom-information.svg Regenerated Breeze help image reflecting new defaults/help text.
dev/breeze/doc/images/output_release-management_update-constraints.txt Regenerated Breeze help output checksum for release-management command.
dev/breeze/doc/images/output_release-management_update-constraints.svg Regenerated Breeze help image reflecting new defaults/help text.
dev/breeze/doc/images/output_release-management_start-rc-process.txt Regenerated Breeze help output checksum for start-rc-process.
dev/breeze/doc/images/output_release-management_start-rc-process.svg Regenerated Breeze help image reflecting new defaults/help text.
dev/breeze/doc/adr/0003-bootstrapping-virtual-environment.md Updates ADR example to reference upstream/main.
dev/README_RELEASE_PYTHON_CLIENT.md Updates push/fetch/tag instructions to use upstream and links to conventions.
dev/README_RELEASE_PROVIDERS.md Updates provider release/tagging instructions to use upstream and references conventions.
dev/README_RELEASE_HELM_CHART.md Updates helm chart release workflow to use upstream.
dev/README_RELEASE_AIRFLOWCTL.md Updates airflow-ctl release workflow examples to use upstream/origin.
dev/README_RELEASE_AIRFLOW.md Updates release-manager runbook to assume upstream and explains how to migrate.
dev/MANUALLY_GENERATING_IMAGE_CACHE_AND_CONSTRAINTS.md Updates constraints/image-cache instructions to default to upstream.
contributing-docs/18_contribution_workflow.rst Updates contributor workflow to reference upstream/main and conventions section.
contributing-docs/10_working_with_git.rst Adds “Git remote naming conventions” section and updates rebase/sync examples to upstream.
AGENTS.md Adds explicit remote naming convention guidance for agents and updates push/rebase instructions.
.github/workflows/basic-tests.yml Updates canary test job to add/fetch upstream instead of apache.

Comment on lines +186 to +191
1. You first need to add the Apache project remote to your git repository. This is only necessary once,
so if it's not the first time you are following this tutorial you can skip this step. In this example,
we will be adding the remote as "apache" so you can refer to it easily
so if it's not the first time you are following this tutorial you can skip this step. Per the
`Git remote naming conventions`_ we add it as ``upstream``:

* If you use ssh: ``git remote add apache git@github.com:apache/airflow.git``
* If you use https: ``git remote add apache https://github.com/apache/airflow.git``
* If you use ssh: ``git remote add upstream git@github.com:apache/airflow.git``
* If you use https: ``git remote add upstream https://github.com/apache/airflow.git``
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the numbered rebase steps, the continuation lines and the nested bullet list under step 1 are not indented, which breaks the reStructuredText list structure (the bullets/paragraphs will render outside the "1." item). Indent the wrapped paragraph lines and the * If you use ... bullets to be part of step 1 (typically 3 spaces past the list marker) so Sphinx renders the list correctly.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indented the wrapped paragraph and both bullets under step 1 to 3 spaces so the list renders correctly in Sphinx. Fixed in 475f8ff.

Comment on lines 200 to 203
"--remote-name",
type=NotVerifiedBetterChoice(["apache", "origin"]),
default="apache",
type=NotVerifiedBetterChoice(["upstream", "origin"]),
default="upstream",
show_default=True,
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotVerifiedBetterChoice is used for shell completion and help output; removing apache from the choices means existing setups that still use an apache remote won't see it suggested/shown in --help even though the value is still accepted. Consider keeping apache in the choices list (while defaulting to upstream) to preserve discoverability/back-compat during the transition.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point — kept apache in the NotVerifiedBetterChoice list for autocomplete/--help discoverability during the transition, with a code comment noting why. Runtime acceptance of arbitrary values is unchanged. 475f8ff.

Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
- 10_working_with_git.rst: indent the wrapped paragraph and bullet list
  under step 1 so Sphinx renders them inside the "1." item instead of
  floating outside (flagged by Copilot — the existing step 2+ wraps
  already follow this indent rule).
- MANUALLY_GENERATING_IMAGE_CACHE_AND_CONSTRAINTS.md: replace the
  double "usually" with a single "Typically" (Dev-iL).
- sbom_commands.py: add ``apache`` back to NotVerifiedBetterChoice's
  autocomplete/help list so legacy clones still see it in --help during
  the upstream/origin transition. Any remote name is still accepted at
  runtime since the type is "NotVerified" (Copilot). Regenerated the
  sbom help-text SVGs.
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.

10 participants