Skip to content

fetchFromGit{Hub,Lab}: add meta.changelog#144141

Draft
Synthetica9 wants to merge 3 commits intoNixOS:masterfrom
Synthetica9:fetchfromgithub-changelog
Draft

fetchFromGit{Hub,Lab}: add meta.changelog#144141
Synthetica9 wants to merge 3 commits intoNixOS:masterfrom
Synthetica9:fetchfromgithub-changelog

Conversation

@Synthetica9
Copy link
Member

@Synthetica9 Synthetica9 commented Nov 1, 2021

Motivation for this change
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.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.

@github-actions github-actions bot added the 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) label Nov 1, 2021
@Synthetica9 Synthetica9 changed the title fetchFromGitHub: add meta.changelog fetchFromGit{Hub,Lab}: add meta.changelog Nov 1, 2021
@ofborg ofborg 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 Nov 1, 2021
@github-actions github-actions bot added 6.topic: agda A dependently typed programming language / interactive theorem prover 6.topic: ocaml OCaml is a general-purpose, high-level, multi-paradigm programming language. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation labels Nov 1, 2021
@Synthetica9 Synthetica9 force-pushed the fetchfromgithub-changelog branch from ff9da16 to 58bd1e4 Compare November 1, 2021 17:31
Script used:

ag -l --nix \
  | xargs grep --files-with-match "inherit (src.meta) homepage" \
  | xargs grep --files-with-match --perl-regexp 'version = "[0-9\.]+"' \
  | xargs grep --files-with-match --perl-regexp "fetchFromGit(Hub|Lab)" \
  | xargs grep --files-without-match changelog \
  | xargs sed -i "s/inherit (src.meta) homepage;/inherit (src.meta) homepage changelog;
@Synthetica9 Synthetica9 force-pushed the fetchfromgithub-changelog branch from 58bd1e4 to b5bc1fa Compare November 1, 2021 17:32
@rnhmjoj
Copy link
Contributor

rnhmjoj commented Nov 3, 2021

Please, consider documenting the meta output in the "fetches" chapter. I had no idea this was even a thing.

@mweinelt
Copy link
Member

mweinelt commented Nov 3, 2021

I usually rely on the plain URL being around in meta to quickly navigate to the project home or its changelog when editing or reviewing a package. While inheriting these values from the fetchers is a neat trick it does not improve the developer experience in my opinion.

@06kellyjac
Copy link
Member

06kellyjac commented Nov 3, 2021

I usually rely on the plain URL being around in meta to quickly navigate to the project home or its changelog when editing or reviewing a package. While inheriting these values from the fetchers is a neat trick it does not improve the developer experience in my opinion.

I second this. I used to like the quick and convenience of inherit (src) homepage; as a package-er but as a reviewer it is very nice to just click (or whatever) the link rather than go to search.nixos.org find the package and click the homepage there, or type out the address by hand based on the fetchFromGithub values

@roberth
Copy link
Member

roberth commented Nov 3, 2021

It's ok for the fetcher to add this to its meta, but packages should provide their own changelog, because often enough, the github releases page is not the best changelog. For instance nix should have https://nixos.org/manual/nix/stable/release-notes/release-notes.html (which is an empty "header" page that should be fixed but that's beside the point)

@SuperSandro2000
Copy link
Member

Please, consider documenting the meta output in the "fetches" chapter. I had no idea this was even a thing.

That would encourage people to add more occurrences of this which I am against. As hexa- already wrote using inherit is pretty bad for the review experience and copying URLs together is just annoying. If I have a direct link to the source I usually do more research myself to give better review comments. If there is no such link I put the extra work on the contributor.

@Synthetica9
Copy link
Member Author

It's ok for the fetcher to add this to its meta, but packages should provide their own changelog, because often enough, the github releases page is not the best changelog.

This adds a changelog to packages that previously didn't have one, so while I guess that some packages do indeed have a better changelog somewhere, this isn't listed in meta.

I usually rely on the plain URL being around in meta to quickly navigate to the project home or its changelog when editing or reviewing a package. While inheriting these values from the fetchers is a neat trick it does not improve the developer experience in my opinion.

Changelog are usually version-specific, and thus not clickable even when they do specify a "full" url in the derivation due to interpolation with ${version}

$ grep  -r  'changelog = "https://' pkgs  | wc -l
596
$ grep  -r  'changelog = "https://' pkgs  | grep '${version}' | wc -l
448

75%+ of "changelog =" entries are not clickable currently.

I agree that it would be nice to have a cleaner way to open (derived) urls in a package.

@mweinelt
Copy link
Member

mweinelt commented Nov 3, 2021

Fair enough regarding the changelog. I agree this solution is elegant when changelogs are provided through GitHub releases. I just think we need to roll this back for the homepage, and maybe clarify homepage vs source repository.

@06kellyjac
Copy link
Member

75%+ of "changelog =" entries are not clickable currently.

it's way easier to click and then fix the link or just go to releases than inherit (src) changelog;

@roberth
Copy link
Member

roberth commented Nov 3, 2021

Changelog URLs computed from a version are also a problem because a PR may need multiple such pages to be reviewed and it's easy to forget about those other pages.

meta = with lib; {
description = "Lightweight GTK Clipboard Manager";
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

we should just be fetching from the tag here


meta = with lib; {
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

passthru.updateScript = import ./update.nix {
inherit lib;
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

Not sure the update script needs the changelog.

passthru.updateScript = import ./update.nix {
inherit lib;
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this update script needs the changelog either.

Copy link
Member Author

@Synthetica9 Synthetica9 Nov 3, 2021

Choose a reason for hiding this comment

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

Ah no, it doesn't 😅

Both GLX and EGL are supported, in any combination with OpenGL and OpenGL ES.
'';
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

documentation for filesystem encryption before using fscryptctl.
'';
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

nix-repl> pkgs.fscryptctl.meta.changelog  
"https://github.com/google/fscryptctl/releases/tag/v{version}"

Copy link
Member Author

Choose a reason for hiding this comment

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

wait no, wtf is happening here

Copy link
Member Author

Choose a reason for hiding this comment

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

Also this package should be dropped accoding to the comment?

Copy link
Member

Choose a reason for hiding this comment

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

Oops, right, that package (fscryptctl-experimental) should be dropped (I forgot to include my GH handle in the TODO which I use to find them) and it seems like I forgot the $ in the fscryptctl package. I've opened #144885 if that helps. You can also include it in this PR if you want.

license = licenses.gpl2;
platforms = platforms.linux;
inherit (src.meta) homepage;
inherit (src.meta) homepage changelog;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah the version here should be changed to -unstable

@06kellyjac
Copy link
Member

#144141 (comment)

Yeah, we can't rely on all tags having releases

https://gitlab.freedesktop.org/glvnd/libglvnd/-/releases/v1.3.2 is the latest tag with a release

Also I guess adding this as default to all sources means even if we manually set the changelog in the package meta, maybe to a CHANGELOG.md or w/e the src's changelog value will be completely wrong

Maybe it should be called release or releasePage? but then it'd be changelog = src.meta.release which I guess isn't too bad

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank marked this pull request as draft March 21, 2024 14:01
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: agda A dependently typed programming language / interactive theorem prover 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: ocaml OCaml is a general-purpose, high-level, multi-paradigm programming language. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants