Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions docs/features/django-fork.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ organisation rather than a personal account:
django = "git@github.com:django/django.git"

# Map each local (fork) branch to the upstream branch it tracks.
# Only branches whose upstream stable/<version>.x still exists are listed.
# Branches tracking a released Django version map to its stable/<version>.x
# branch; the in-development version tracks Django's main branch.
[repo.groups.django.upstream_branch]
django = {"mongodb-6.1.x" = "stable/6.1.x", "mongodb-6.0.x" = "stable/6.0.x", "mongodb-5.2.x" = "stable/5.2.x"}
django = {"mongodb-6.2.x" = "main", "mongodb-6.1.x" = "stable/6.1.x", "mongodb-6.0.x" = "stable/6.0.x", "mongodb-5.2.x" = "stable/5.2.x"}

# Branch checked out automatically right after cloning
[repo.groups.django.preferred_branch]
Expand Down Expand Up @@ -238,16 +239,24 @@ validate a rebase with no PR involved, or when no suitable PR run exists yet
Adding a new release branch
----------------------------

When Django cuts a new stable branch (for example ``stable/6.2.x``) and you
create a matching ``mongodb-6.2.x`` fork branch, add the mapping to
``upstream_branch`` so ``dbx sync`` knows where to rebase it:
A fork branch that tracks an unreleased Django version maps to Django's
``main`` branch. For example ``mongodb-6.2.x`` currently tracks ``main``
because Django 6.2 has not been released:

.. code-block:: toml

[repo.groups.django.upstream_branch]
django = {"mongodb-6.2.x" = "main", "mongodb-6.1.x" = "stable/6.1.x", ...}

Once Django cuts the matching stable branch (for example ``stable/6.2.x``),
update the mapping to point at it:

.. code-block:: toml

[repo.groups.django.upstream_branch]
django = {"mongodb-6.2.x" = "stable/6.2.x", "mongodb-6.1.x" = "stable/6.1.x", ...}

Until the mapping exists, ``dbx sync`` cannot determine the correct upstream
Until a mapping exists, ``dbx sync`` cannot determine the correct upstream
target for that branch and falls back to upstream's default-branch detection,
which is almost certainly not what you want for a release branch.

Expand Down
7 changes: 4 additions & 3 deletions src/dbx_python_cli/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ django-mongodb-extensions = "git@github.com:mongodb-labs/django-mongodb-extensio
# Required when the local branch name differs from the upstream branch (e.g. mongodb-6.0.x → stable/6.0.x).
# Only branches whose upstream target currently exists are listed here. Add a branch once
# Django cuts its stable/<version>.x branch; drop it once that upstream branch is deleted (EOL).
# Not currently mapped: mongodb-5.0.x / mongodb-5.1.x (upstream stable branches deleted, EOL) and
# mongodb-6.2.x (Django 6.2 is still on main; add stable/6.2.x here once it is branched).
# mongodb-6.2.x currently tracks Django's main branch (Django 6.2 is unreleased); switch it to
# stable/6.2.x once Django cuts that branch.
# Not currently mapped: mongodb-5.0.x / mongodb-5.1.x (upstream stable branches deleted, EOL).
[repo.groups.django.upstream_branch]
django = {"mongodb-6.1.x" = "stable/6.1.x", "mongodb-6.0.x" = "stable/6.0.x", "mongodb-5.2.x" = "stable/5.2.x"}
django = {"mongodb-6.2.x" = "main", "mongodb-6.1.x" = "stable/6.1.x", "mongodb-6.0.x" = "stable/6.0.x", "mongodb-5.2.x" = "stable/5.2.x"}

# Custom test runner configuration: specify test runner script for repos that don't use pytest
[repo.groups.django.test_runner]
Expand Down
Loading