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
terraform: revamp the providers list #29097
Conversation
dirs = lib.filterAttrs (k: v: v == "directory") files; | ||
importDir = dir: _: { name = builtins.baseNameOf dir; value = importer (path + "/${dir}"); }; | ||
in | ||
lib.mapAttrs' importDir dirs; |
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.
@copumpkin what do you think of this method of importing a bunch of derivations? the importer
could also be a callPackage
My reasoning for wanting data vs. derivations wasn't about space, as much as "implied space of variation". Having a file checked into source control with a comment at the top saying "this might look like a normal source file you can change, but it isn't, so please don't modify it; instead modify the thing that generated it" is a maintenance liability. I realize we do a lot of that and this is just another straw on the camel's back, but for example I now need to be aware of that sort of thing if I apply any broad refactoring to the repo. As a really simple example, if I rename So tl;dr: I have knee-jerk reactions to all autogenerated code, especially when in a source repo, and especially when the language is capable of expressing the sort of factoring that's being autogenerated natively. So I'd have way less issues generating assembly (hah) or a language like Having said all that, I won't fight on this PR you if you think this is more maintainable, but I don't personally like it 😄 It seems like the folder-valid-interruption concern would still be addressed by putting data expressions in each folder rather than code. But I'm also not sure I get why you want it to be interruptible; I'd probably want to rerun the updater if it failed mid-run, or I'd end up with a set of half-updated plugins, right? When would I ever want to say "oh, it crashed, looks good, I guess I'll do something else"? Or am I misunderstanding? |
Thanks, that kind of comment is exactly why I asked a review from you. The premise was that it's easy to hit the github rate-limit, so I wanted a resumable way of doing things. Since I was generating separated files, that's where I came up with the importDirs method, which I think it quite nice (on a more general note) to avoid having to build and maintain indices unnecessarily. That being said, I solved the issue later on by introducing the personal github token to the fetching method so I will revert to the old ways of doing this. |
This fixes the ./update-all script to actually fetch all the available providers (thanks pagination). It was also improver to user a more compact representation of the data.
edc91c5
to
0bd7b21
Compare
thank you ❤️ |
This fixes the ./update-all script to actually fetch all the available providers (thanks pagination). It was also improver to user a more compact representation of the data. (cherry picked from commit 9f2ff1d)
Motivation for this change
The updater script wasn't downloading all the providers. It now uses the
github auth to work around API rate-limits.
Switch back to using derivations as the data-only approach wasn't saving
much space. By using folders it allows to interrupt the updater script
and still get a valid plugin set.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)