Skip to content

CONTRIBUTING: allow fetching unaccepted changes if the URL is stable #401863

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 1 commit into from
May 10, 2025

Conversation

marcin-serwin
Copy link
Contributor

Reword documentation to allow using fetchpatch for changes that are not yet merged upstream. Additionally, put a greater emphasis on URL stability.

fixes #400873

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: policy discussion Discuss policies to work in and around Nixpkgs label Apr 25, 2025
@nix-owners nix-owners bot requested a review from infinisil April 25, 2025 19:54
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 25, 2025
@emilazy
Copy link
Member

emilazy commented Apr 26, 2025

cc @alyssais

The common case (GitHub) does GC such commits, so this will probably nudge people in the wrong direction on average.

@marcin-serwin
Copy link
Contributor Author

The common case (GitHub) does GC such commits

Hmm, @eclairevoyant claimed otherwise in #400873 (comment). The only official statement from GH I found is this blog post where they state:

Normally, we don’t remove any unreachable data from repositories. But occasionally we do, usually to remove sensitive data, like passwords or SSH keys from your repository’s history.

So I think that GH commits could be considered safe.

@alyssais
Copy link
Member

This does not match our experience in practice.

@alyssais
Copy link
Member

Arbitrary example: can you look at previous force pushes of #123456? I can't.

@emilazy
Copy link
Member

emilazy commented Apr 26, 2025

“Nothing up my sleeve” number: #54321. PR from 2019, the first commit in the force‐push event is a 404. Also true of #123456 from 2021, and #234581 from 2023 (had to increment until I found a PR with a force push).

GitHub do routinely run garbage collection; IIRC they state somewhere that it happens every 50 pushes. If they started explicitly retaining force‐pushed PR commits at some point, it would have to have been within the past couple of years, and I haven’t seen anything suggesting it’s changed.

@marcin-serwin
Copy link
Contributor Author

I see. I still think the current wording is confusing since stable links to unmerged changes are possible. I've changed the wording around garbage collection to be stronger and namedropped GtiHub as an example.

Reword documentation to allow using `fetchpatch` for changes that are
not yet merged upstream. Additionally, put a greater emphasis on URL
stability.

fixes NixOS#400873
Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

Much better. If you want, you could include https://lore.kernel.org/ as an example of patches that do have likely-stable URLs.

@emilazy
Copy link
Member

emilazy commented Apr 26, 2025

Thanks, this looks good. I appreciate the mention that GitHub and other forges shouldn’t be relied upon to act this way.

I do think that “unmerged patches should be vendored” is generally the right heuristic, because the kinds of settings where you do have stable archiving of patches (mailing lists, mostly?) are also the kind where it’s often hard to get a usable direct URL to the patches. The kernel is certainly an exception, though.

@marcin-serwin
Copy link
Contributor Author

I do think that “unmerged patches should be vendored” is generally the right heuristic

I agree that it's a good heuristic but if we want to keep it should be framed as an advice and not as a rule.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 26, 2025
Copy link
Contributor

@eclairevoyant eclairevoyant left a comment

Choose a reason for hiding this comment

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

Hmm, @eclairevoyant claimed otherwise in #400873 (comment).

I was incorrect, I checked some recent PRs and their commits are gone.

In any case the current PR makes the guidelines clearer and more consistent.

@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Apr 27, 2025
@alyssais alyssais mentioned this pull request May 10, 2025
13 tasks
@alyssais alyssais merged commit 406ea5c into NixOS:master May 10, 2025
31 checks passed
### Vendoring patches

In the following cases, a `.patch` file _should_ be added to Nixpkgs repository, instead of retrieved:

- solves problems unique to packaging in Nixpkgs
- is already proposed upstream but not merged yet
Copy link
Member

Choose a reason for hiding this comment

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

- - is already proposed upstream but not merged yet

isn't that the case when we should vendor?

Copy link
Contributor

Choose a reason for hiding this comment

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

it can be misleading. people read it to mean "if it's not even proposed upstream don't vendor" even though that's not what it says of course

@marcin-serwin marcin-serwin deleted the push-vqxlqlwxopkq branch May 22, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: policy discussion Discuss policies to work in and around Nixpkgs 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflicting/confusing documentation regarding vendoring patches
6 participants