Skip to content

Explain that the contributors should base changes against main #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 11, 2022

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Nov 10, 2022

This isn't a particularly common issue but every now and then somebody will waste their time by preparing a change against a maintenance branch instead of working with main from the get-go.

This change serves as a reminder to contributors to think about the main branch first.

Key changes:
Screen Shot 2022-11-10 at 17 30 43

Screen Shot 2022-11-10 at 17 30 57

This isn't a particularly common issue but every now and then somebody will
waste their time by preparing a change against a maintenance branch instead of
working with `main` from the get-go.

This change serves as a reminder to contributors to think about the `main`
branch first.
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Looks good, we could consider putting one of the early mentions of main in bold text.

* NOTE: Don't work on old branches of Python. Even if you're working on
a fix for a bug you discovered in an older version of Python, we
want to fix it in ``main`` first and then
:ref:`port your fix back <branch-merge>` later.
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding this note I would add a link to the paragraph below.

Copy link
Member

Choose a reason for hiding this comment

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

And if it is a note and is called out with an ad-hoc NOTE: plain text, we should just make it an actual ``.. note::`.

Comment on lines 190 to 195
First, make your change against the right version of Python. Even if you're
fixing a bug, your fix needs to go to the ``main`` branch first. After the
fix is merged, it will be :ref:`ported back <branch-merge>` to older
maintenance releases as well. That way we ensure all affected versions are
handled. Unless you're sure that your change does not apply to ``main``,
don't base your fixes on old versions of Python.
Copy link
Member

Choose a reason for hiding this comment

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

The tone seems to assume that they are going to do it against the wrong version. I would use a more neutral tone and state that almost all changes (including bug and security fixes) should be done against main, but in certain cases they should be done on older branches (maybe list a couple of examples (IIRC they are already mentioned somewhere)).

Providing the background for this (e.g. by explaining that we backport fixes like you did) and cases where the PR should be done on old branches, will help reassure the reader about which versions will receive the fix.

handled. Unless you're sure that your change does not apply to ``main``,
don't base your fixes on old versions of Python.

Second, make sure to follow Python's style guidelines. For Python code you
Copy link
Member

Choose a reason for hiding this comment

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

Sidenote: To avoid noisy, tedious and easy to mess up manual renumbering like this, a long list of prose-numbered paragraphs, and where there isn't an inherent order, it would be better to reformat this as an unordered (bulleted) list instead (or at least use an auto-numbered ordered list). But perhaps out of scope here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember we already deferred doing this once to a separate PR so I'll just do it here then.

@ambv
Copy link
Contributor Author

ambv commented Nov 11, 2022

Thanks for your insightful comments. Addressed in the update. Current state:
Screen Shot 2022-11-11 at 11 01 37

Screen Shot 2022-11-11 at 11 02 12

@ambv ambv merged commit 6b98942 into main Nov 11, 2022
@ambv ambv deleted the use-the-proper-branch branch November 11, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants