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

Add a name attribute to the fetchers #4988

Merged
merged 5 commits into from
Jul 8, 2021
Merged

Conversation

thufschmitt
Copy link
Member

Allow fetchGit, fetchTarball, fetchMercurial and fetchFromGitHub to take a name argument

Fix #3888

@edolstra
Copy link
Member

edolstra commented Jul 8, 2021

I'm not sure whether fetchTree should support name. We need it for the other builtins for backward compatibility, but fetchTree is new so we don't have that issue.

Does this allow a name attribute in flake URL? As with fetchTree, that may be undesirable since it reduces CA effectiveness.

Otherwise LGTM.

We need to support it for the “old” fetch* functions for backwards
compatibility, but we don’t need it for fetchTree (as it’s a new
function).
Given that changing the `name` messes-up the content hashing, we can
just forbid passing a custom `name` argument to it
@thufschmitt
Copy link
Member Author

I'm not sure whether fetchTree should support name. We need it for the other builtins for backward compatibility, but fetchTree is new so we don't have that issue.

Oh you’re right. I’ve explicitly forbidden it in 7e5c79a

Does this allow a name attribute in flake URL? As with fetchTree, that may be undesirable since it reduces CA effectiveness.

No, trying to add a name parameter to a flake url will fail with error: unsupported input attribute 'name'

@edolstra edolstra merged commit 8648143 into master Jul 8, 2021
@edolstra edolstra deleted the fetchgit-name-attribute branch July 8, 2021 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

builtins.fetchGit doesn't support the name attribute anymore
2 participants