-
Notifications
You must be signed in to change notification settings - Fork 23
Clarify upstream merge and Renovate actions on PRs #771
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,18 @@ It can be helpful to think of this exercise in terms of two dimensions: | |
| - Introducing changes to one component or page independently others. | ||
| - Introducing changes on a client-by-client basis. | ||
|
|
||
| ### Keeping your branch up to date | ||
|
|
||
| It is usually unnecessary to merge the base branch (e.g. `main`) into a short-lived PR branch. | ||
| Frequent merges from the upstream add noise to the commit history without meaningful benefit; CI | ||
| will surface any conflicts or incompatibilities when the PR is ready to merge. If a rebase is | ||
| needed, prefer rebasing over merging so the branch history stays clean. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "If a rebase is needed, prefer rebasing over merging" - what is this trying to express? If a rebase is needed then a rebase is needed. That said, generally our advice among devs is to avoid rebasing, because reviewers lose their history of what commits they've already reviewed. Github has gotten a little better at showing this but merging (rather than rebasing) still avoids the issue altogether. Also, a tidy branch history is nice to have during review, but we squash commit everything to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also trying to make this more of the norm because the review experience already handles that and having a commit -- therefore notifications, more builds, and so on -- isn't representative of what actually happens when the PR is closed (the squash). Squashing is an operational (GitHub repo) setting and while generally expected does have to be enabled. I'm not fixated on this and can drop the language here but I feel merge commits create noise.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rebasing creates the same noise, because you get notifications/CI on the rebased commits, and (imo) merge commits are easy enough to navigate. But perhaps rebasing/force-pushing better represents the semantics of what you're doing (resetting the state of the branch) rather than merges. Thinking about it more, I'm used to one way of doing it, but realistically we could do either. I would've argued against it before the Github review experience handled it, but I believe it can diff before & after a force push now, so if this is the desired direction then we can work towards it. For wording, maybe
|
||
|
|
||
| Reserve merging `main` into a branch for situations where you genuinely need changes from the | ||
| upstream to continue your work, such as depending on a newly merged API or resolving a non-trivial | ||
| conflict. In most cases, the branch will be merged shortly and keeping it in sync is wasted effort, | ||
| especially on our build and test workflows. | ||
|
|
||
| ### Additional considerations for long-lived feature branches | ||
|
|
||
| :::note | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI will only surface conflicts or incompatibilities with
mainif you mergemaininto your feature branch so that tests (etc) can run. Is the advice here to update frommainonly immediately before merging, and not before? (I would be OK with that, but it's unclear here and I might be misunderstanding.)Otherwise it is possible to merge to
mainand then have failures inmain. e.g. because your database migrations have been overtaken.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am speaking about CI on
main; the advice is to not do it at all and to work in isolation. There are long-term issues here where the individual causing a failure doesn't actually respond to it, but assuming that becomes a true requirement I would want failures there to create backpressure on working differently so that it's avoided altogether. We're currently skipping past why there's failures at all.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is - you want to push developers to keep PRs small and merge into main frequently, rather than having larger PRs that become out of date?
In terms of the wording - would this be more accurate?
("when the PR is ready to merge" implies the PR hasn't been merged to main yet.)