Skip to content
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

Maintainers: please don't push directly to master/release branches #118661

Closed
domenkozar opened this issue Apr 6, 2021 · 103 comments
Closed

Maintainers: please don't push directly to master/release branches #118661

domenkozar opened this issue Apr 6, 2021 · 103 comments

Comments

@domenkozar
Copy link
Member

domenkozar commented Apr 6, 2021

It seems like the community is close to a consensus for strongly discouraging direct pushes to master and release branches.

Mainly because nixpkgs is a huge project and we've hit the critical mass where things break too often and changes benefit from a review. We can not rely on discipline any longer.

There are exceptions that are allowed for the time being:

  • automatic updates: those should transition to https://cli.github.com/manual/gh_pr_create or plain github actions
  • release managers
  • time-sensitive changes (evaluation fix, security fix, etc)
  • trivial changes (typos)

For trivial changes like typos, you can prepend [skip ci] to commit message.

Note that there was NixOS/rfcs#79 that will get a successor to formalize this.

domenkozar referenced this issue Apr 6, 2021
opened, synchronize, reopened are the defaults for `pull_request_target`,
`edited` will trigger the label action if the PRs base branch is changed.
@domenkozar domenkozar changed the title Maintainers: please don't push directly to master Maintainers: please don't push directly to master/release branches Apr 6, 2021
@7c6f434c
Copy link
Member

7c6f434c commented Apr 6, 2021 via email

@domenkozar
Copy link
Member Author

Break = channel stall? I wonder how much average channel advance frequency is actually affected by broken direct pushes as opposed to everything else.

Anything that doesn't pass the CI (excluding builds for the moment), which breaks all subsequent commits and PRs. This has happened many times in the past and PRs give a chance for everyone to review things.

Is leaving out backports a typo?

I don't understand.

@FRidh
Copy link
Member

FRidh commented Apr 6, 2021

Looking back at the old RFC, my comments regarding staging-(next) were irrelevant; as long as pushes remain possible to staging(-next), it is fine. Now, I would suggest to block pushing to master, and discourage on all other branches. That way, backports will at least keep happening. But let's discuss that further in an RFC.

@andir
Copy link
Member

andir commented Apr 6, 2021

Looking back at the old RFC, my comments regarding staging-(next) were irrelevant; as long as pushes remain possible to staging(-next), it is fine. Now, I would suggest to block pushing to master, and discourage on all other branches. That way, backports will at least keep happening. But let's discuss that further in an RFC.

I still wonder where the idea of "just pushing a backport" is different from a change to master comes from. It might as well be a breaking change even if the commit applies. IMHO maintainers should also be involved in those and especially in stable updates. Those might each have a different impact from package to package.

@FRidh
Copy link
Member

FRidh commented Apr 6, 2021

From a "does it break something" point of view, I agree, it is not different. Impact wise, however, it is different; there are far fewer PR's made against stable branches so the impact of a failing CI on other PR's is less big. On the other hand, it could block a stable channel from advancing. I guess its a matter of what odds do you accept.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 6, 2021 via email

@domenkozar
Copy link
Member Author

this sense, it is a trade-off in terms of development annoyance, not a user-facing breakage.

Yes, we're talking about users that contribute to Nixpkgs.

You start with saying «master and release branches». Recently I have been under impression that a non-release-manager committer doing a backport to a release branch via a direct push is considered acceptable, because backports are not done enough. (I don't have an understanding what is backport-worthy in the first place as I never use stable branches)

It is acceptable but strongly discouraged.

Note that we have no proof that going through PRs will mean there are fewer backports, even more so if we create automation (a shell script with a few lines calling github cli).

Note 2: Removing the power from people always triggers "oh I don't like that so I won't participate" response, but that's not a sufficient proof :)

Note 3: We could use something like https://github.com/tibdex/backport to make this even easier than it ever was.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 6, 2021 via email

@vcunat
Copy link
Member

vcunat commented Apr 6, 2021

I've been still doing direct pushes to nixpkgs master occasionally, always in cases that:

  • are unlikely to get any feedback (from previous experience), and
  • don't change anything critical, and
  • are very unlikely to break anything (or anything else, at least, e.g. trivial version+hash bumps)

I could do them through PRs, though it'd be some extra hassle that didn't seem worth it under those conditions. (They don't seem covered by the "trivial changes" bullet, as you formulate it.) Anyway, not a big deal to me if I have to PR them.

@bergkvist
Copy link
Member

bergkvist commented Apr 6, 2021

I'm not a member of the Nix organization, but some potentially useful questions to ask here are:

  • What is the probability that a push directly to master by a NixOS-member will introduce a new issue?

  • How much lower is the probability that a pull request by a NixOS-member will introduce a new issue compared to a direct push?

  • Does forcing everything through PRs motivate less atomic, and larger commits/changes?

  • Enforcing PRs will likely reduce the output of the core NixOS members. By how much?

A practical example

(with made up numbers)
Pushing directly to master: 10% chance of introducing breakage
Creating a PR: 3% chance of introducing breakage
Having to go through PRs instead of pushing directly halves the number of bugfixes that are shipped

With these made up numbers, what will lead to the fewest issues over time? Allowing direct pushes to master, or forcing everything to go through PRs?


It is not obvious that enforcing PRs for core maintainers will lead to a more "polished product". Rather, over time - it might not be able to keep up, and end up accumulating more issues.

Measuring/estimating what these numbers actually are might provide some useful insights.

@grahamc
Copy link
Member

grahamc commented Apr 6, 2021

In my opinion a major part of the issue here is more than just reducing chances of introducing problems, but adding a chance for audit and review. In this day and age the number of projects where just pushing to the main branch is acceptable is quite low. I feel it is our responsibility as a distribution to take our role quite seriously and reduce the ways weird patches can be submitted without audit.

@bergkvist
Copy link
Member

@grahamc Sure, auditing/reviewing everything sounds like a nice ideal, but this might be an issue:

As has been already pointed out, the four eyes principle is hugely impractical for Nixpkgs, when we can't even get four eyes on mostsmall PRs as it is.

NixOS/rfcs#79 (comment)

@grahamc
Copy link
Member

grahamc commented Apr 6, 2021

Yes I understand, however there is a big difference between no opportunity to review and a self-merged PR which was unreviewed.This is a step in the right direction.

@vcunat
Copy link
Member

vcunat commented Apr 6, 2021

The current accumulated count of open vs. closed PRs doesn't seem that bad (2–3 %).

@grahamc
Copy link
Member

grahamc commented Apr 6, 2021

The current accumulated count of open vs. closed PRs doesn't seem that bad (2–3 %).

This makes no requirement on review, either. It simply gives the opportunity for review.

@vcunat
Copy link
Member

vcunat commented Apr 6, 2021

If so, we might want to define how long an opportunity should be required. We have at least one PR in nixpkgs that was self-merged within a couple seconds ;-) (you might recall that from a release manager presentation on some NixCon)

@bergkvist
Copy link
Member

bergkvist commented Apr 6, 2021

Isn't it also possible to comment on individual commits? What is the difference between commenting on an already merged PR and a commit? Two things I can think of:

  • Might be harder to find/search for comments on commits in the GitHub UI
  • Test suite doesn't run

@grahamc
Copy link
Member

grahamc commented Apr 6, 2021

If so, we might want to define how long an opportunity should be required. We have at least one PR in nixpkgs that was self-merged within a couple seconds ;-) (you might recall that from a release manager presentation on some NixCon)

Right. I'm actually not too worried about this, though. Simply having people use PRs and having ofborg check the evaluation is a net win. Reducing the direct push is a significant win. Removing the ability for almost everybody to directly push is another significant win. IMO creating more policy later is okay.

@vcunat
Copy link
Member

vcunat commented Apr 6, 2021

@bergkvist: you can comment on any commits, but I expect the intention is to get the review (and the implied fixes) before merging.

@bergkvist
Copy link
Member

bergkvist commented Apr 6, 2021

Bit rot is a potential downside with using pull requests that are not immediately merged (the PR can become invalid due to another PR being merged), along with the need to manage dependencies between PRs.

Imagine if you make a pull request A, and then you make a pull request B that depends on A.

Now, while you are waiting for review/having someone review your code, pull request C is merged into master.

As a result you might need to update both pull request A and B to be compatible with C.


Considering nixpkgs gets ~500-1200 commits per week, this could quickly become a problem if the PRs remain open for several hours.

@grahamc
Copy link
Member

grahamc commented Apr 6, 2021

@bergkvist, I feel you're here (sea-lioning whiteknighting? raising unlikely issues that also do not impact you) an issue that has no effect on you. Bitrot happens to all sorts of contributors. It is true. It impacts non-merging contributors more than anyone else, and people with merge access are the least impacted. Being asked to go through PRs is not likely to significantly hinder committers.

@bergkvist
Copy link
Member

@grahamc You're right. Thanks for pointing it out. This is an issue which doesn't impact me directly - so I should also not have any impact on this issue. (Because I wouldn't personally feel the pain of having made a bad choice)

On a side-note, I really appreciate the work that you put into maintaining nixpkgs - and for making it the best package manager out there (in my opinion).

@domenkozar
Copy link
Member Author

See https://botsin.space/@complainingaboutmastercommits for some statistics (I haven't verified if those numbers are correct).

@FRidh
Copy link
Member

FRidh commented Apr 9, 2021

See https://botsin.space/@complainingaboutmastercommits for some statistics (I haven't verified if those numbers are correct).

I am pretty sure those number are incorrect for the reason mentioned in NixOS/rfcs#79 (comment). Same author.

@matthiasbeyer
Copy link
Contributor

matthiasbeyer commented Apr 9, 2021 via email

@NeQuissimus
Copy link
Member

Considering I have broken master on more than one occasion, I figured I'd chime in :)
I have finally convinced myself to use PRs for everything and from first-hand experience have multiple observations:

  • Less breakage
  • Availability of @ofborg for test evaluation is huge, I actually found myself adding tests on a regular basis
  • There have actually been more people in the community giving feedback, reducing my workload (:pray:)

I think a few questions should be answered to make this process even better (and the RFC mentions these):

  • Auto-merging for PRs that have tests
  • I have a hard time with the distinction between master, staging, staging-next and equivalent stable branches. What goes where? How often are the branches merged into each other? This may just be my lack of insight... I think we need a way for an automatic label or a bot to ensure changes are sent to the correct target branches
  • Is there a way we could ask @ofborg to take a PR and also evaluate against the stable branch(es)? Say I make a PR with kernel updates. If I could just @ofborg stable 20.09 and it duplicates all its checks with the additional set running against 20.09, that would be fantastic. Otherwise the turnaround time would likely double before updates hit stable (Unless we do it entirely in parallel but then we cannot git cherry-pick, can we?)

@matthiasbeyer
Copy link
Contributor

I think we need a way for an automatic label or a bot to ensure changes are sent to the correct target branches

Aren't the tags about how much gets rebuilt by a PR automatically added by a bot? Those could serve well for that purpose, I suppose?

github-actions bot referenced this issue Jul 28, 2023
github-actions bot referenced this issue Jul 28, 2023
psudohash: init at unstable-2023-05-15
github-actions bot referenced this issue Jul 28, 2023
github-actions bot referenced this issue Jul 28, 2023
…s.peaqevcore

python310Packages.peaqevcore: 19.0.1 -> 19.0.2
github-actions bot referenced this issue Jul 28, 2023
…s.socid-extractor

python310Packages.socid-extractor: 0.0.24 -> 0.0.25
github-actions bot referenced this issue Jul 28, 2023
…s.openshift

python310Packages.openshift: 0.13.1 -> 0.13.2
github-actions bot referenced this issue Jul 28, 2023
github-actions bot referenced this issue Jul 28, 2023
* intel-one-mono: init at 1.2.0

Update pkgs/data/fonts/intel-one-mono/default.nix

Co-authored-by: Janik <[email protected]>
(cherry picked from commit 3dffd71)

* Update pkgs/data/fonts/intel-one-mono/default.nix

(cherry picked from commit 89a924d)

---------

Co-authored-by: Simone Ruffini <[email protected]>
Co-authored-by: Sandro <[email protected]>
github-actions bot referenced this issue Jul 28, 2023
[Backport release-23.05] intel-one-mono: 1.2.0 -> 1.2.1
github-actions bot referenced this issue Jul 28, 2023
github-actions bot referenced this issue Jul 28, 2023
…sues

aria2: build with GNUTLS instead of OpenSSL
github-actions bot referenced this issue Aug 9, 2023
[23.05] element-{web,desktop}: 1.11.36 -> 1.11.38
github-actions bot referenced this issue Aug 9, 2023
kzones: 0.5 -> 0.6, use finalAttrs
github-actions bot referenced this issue Aug 10, 2023
python3Packages.polars: 0.18.0 -> 0.18.13
github-actions bot referenced this issue Aug 10, 2023
...that fails after sympy update to v1.12.0; merge to master
github-actions bot referenced this issue Aug 12, 2023
`qt.enable` option requires `qt.style` to be set.
Previously, this was set in GNOME module but it has been removed
in 6227459
@infinisil
Copy link
Member

Direct pushes are now blocked since #249117, and the bot was removed in #249151, so we can officially close this issue now! 🚀

github-actions bot referenced this issue Sep 19, 2023
[Backport release-23.05] bitcoin: add shell completions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests