-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Warn on malformed URI query parameter #11349
Warn on malformed URI query parameter #11349
Conversation
2caba30
to
e7eb55b
Compare
e7eb55b
to
9decb14
Compare
Outputs looks like this: $ ./outputs/out/bin/nix --extra-experimental-features 'nix-command flakes' flake metadata 'github:nixos/nixpkgs?refnixpkgs-unstable&bla'
warning: invalid URI query 'refnixpkgs-unstable', did you forget an equals sign `=`?
warning: invalid URI query 'bla', did you forget an equals sign `=`? |
Signed-off-by: Bryan Honof <bryanhonof@gmail.com>
9decb14
to
c9f4567
Compare
This will restrict all URIs from using non-key/value query parameters. So even http endpoints will not accept them. If we warn or error, it would be specific to the kind of URL it is, flake or store or fetch url, etc. |
@tomberek So, you'd rather do the check on the individual store level? Since this checks if the string contains a Lines 82 to 85 in 96a2dda
So, if there's already existing behavior depending on queries that don't have an |
Fair point. In that case this is strictly improving the warnings. I'm not sure there are too many usages of the non-"=" query string. |
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.
LGTM
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-08-26-nix-team-meeting-minutes-172/51300/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-08-28-nix-team-meeting-minutes-173/51302/1 |
I am getting warnings now for simple cases like this:
basically any flake attribute. |
Revert in #11439 |
Might need an initial check to see if the query string is empty. |
Some of these are a bit after the specified time period, but I also believe some of these items are difficult to gauge how much "impact" they had. Helped organize, host, and run, the Summer of Nix Lecture Series 2022 - https://www.youtube.com/playlist?list=PLt4-_lkyRrOMWyp5G-m_d1wtTcbBaOxZk - NixOS/infra#213 Helped organize, and host infra for, the Summer of Nix Lecture Series 2023 - https://www.youtube.com/playlist?list=PLt4-_lkyRrOPcBuz_tjm6ZQb-6rJjU3cf - NixOS/infra#240 Helped organize, host, and was responsible for livestreaming infra during, NixCon Paris 2022 - https://www.youtube.com/playlist?list=PLgknCdxP89ReD6gxl755B6G_CI65z4J2e Maintenance of some nixpkgs packages - NixOS/nixpkgs#340223 (contribution after 2024-05-01) - NixOS/nixpkgs#290084 - NixOS/nixpkgs#170089 Organized, and assembled a team for the FOSDEM 2023 Nix/NixOS Devroom - https://discourse.nixos.org/t/fosdem-2023-nix-and-nixos-devroom/23133 Organizer & sole maintainer of the Config Management Camp Nix track - https://discourse.nixos.org/t/config-management-camp-2023-ghent/23455 - https://discourse.nixos.org/t/config-management-camp-2024-ghent/33852 - https://discourse.nixos.org/t/cfgmgmtcamp-2025-is-looking-for-nix-presentations/51658 (contribution after 2024-05-01) Public speaking & spreading awareness of Nix/NixOS - https://youtu.be/gUjvnZ9ZwMs?si=nDiZTCpQj53wwq8P - https://www.youtube.com/watch?v=hNcYPH5Q_pA&t=862s The occasional dabble into the Nix C++ code base - NixOS/nix#11494 (contribution after 2024-05-01) - NixOS/nix#11490 (contribution after 2024-05-01) - NixOS/nix#11489 (contribution after 2024-05-01) - NixOS/nix#11349 (contribution after 2024-05-01) - NixOS/nix#11241 (contribution after 2024-05-01) - NixOS/nix#9557 - NixOS/nix#8788 - NixOS/nix#8212 - NixOS/nix#5147 General evangelism Pretty much every event I attend, I'm talking about Nix, showing off Nix/NixOS, and just trying to get people to see how awesome this tool is.
Motivation
#10370 explains how
github:nixos/nixpkgs?refnixpkgs-unstable
is currently just accepted as is.It never really checks if the query part of the URI is a tuple of 2 strings, separated by an equal sign.
Context
Fixes #10370
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.