-
Notifications
You must be signed in to change notification settings - Fork 298
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 handling of groups #227
Add handling of groups #227
Conversation
Signed-off-by: Andreas Schmidt <[email protected]>
Signed-off-by: Andreas Schmidt <[email protected]>
This is the first try to implement groups handling. Currently the documentation is missing. |
Some high-level thoughts: When using groups, it seems redundant to specify The overloading of |
Was there a particular reason you had it at the top level? |
Should we add a new CLI flag for selecting groups? (e.g. --groups group [...]) Or is it better to keep the CLI flag set simpler? |
Do you think both only and except for group are necessary? For the plugins I think it's nice to sometimes use except (e.g. to disable the shell plugin, which can sometimes call slow scripts). I'm not sure exactly how people will end up using groups. Would just |
Do you think both only and except for group are necessary? I use Arch-Linux as distribution. Arch-Linux has floating release and the maintainer release every month a new version of installation image. Me and my friend using a installation script arch-install that installs, configs and setup the Arch-Linux corresponding my configuration file. One step of this script is download, setup and installs the dotfiles using dotbot. Nearly all my dotfiles are public accessible on my dotfile-repo. Except the key-files and credentials-files, they are in a separate git-repo. This private-files-repo is only reachable on my LAN at home, or on the work LAN for the key-files for work-environment. While real installation all necessary repos and thus files are available and reachable. To determine if something has been changed in Arch-Linux that breaks the installation or setup of the environment, we run the installation script for each configuration file on a VM once a month and check the result. This VM has no access to my private repos, neither on the home network nor on the network at work. My solution, to avoid false positive while test is to divide the dotfiles in two groups That is my use-case for Or did you mean that is enough to have only |
Also, another thing to consider is whether this needs to be part of the core language, or if the current approach (https://github.com/anishathalye/dotbot/wiki/Tips-and-Tricks#how-can-i-have-different-groups-of-tasks-for-different-hosts-with-different-configurations) is good enough |
Yes, that's right, that could also covers my use case. I didn't know it, thanks for the hint! Hmm, then I'm just asking if the groups are still necessary at all. Because the profile files contain nothing but groups. The implementation of the groups would only take it in core, which is nice but not necessary. |
Maybe you could vote on it? Or you decide that this feature is not essentially necessary. I think it would be an acceptable decision because there is a solution to Issue #81 in terms of groups. |
Signed-off-by: Andreas Schmidt <[email protected]>
Sorry, to close the discussion was not my intention. |
Signed-off-by: Andreas Schmidt <[email protected]>
I implemented In addition, I tested both variants for my use case. In my view, both solutions are equivalent. |
Thank you for taking the time to iterate on this. It's a difficult decision, but for now, I think it's better to stick with the I thought of another complexity related to this being implemented in Dotbot: once the top-level becomes a dictionary rather than an array, ordering is no longer guaranteed. Dotbot could end up executing the groups of commands "out of order" with respect to how they appear in the file, which could confuse users. We could work around this with a slightly hacky approach of having PyYAML read into an OrderedDict, but that doesn't seem ideal; we'd need an analogous hack for JSON, and having a nonstandard interpretation of YAML/JSON (with dictionaries being ordered) seems non-ideal. Seems like it's a limitation of implementing a DSL in YAML, that as it gets more complicated, things can get messy/confusing... As I mentioned over in another issue (#233 (comment)), I'm going to try to spend some time thinking over all the Dotbot issues, see how people use Dotbot in the wild, and see if we can come up with some clean solutions to these problems without having to worry about backwards compatibility. I'll make sure to think about groups of tasks while doing that; and this iteration and discussion has definitely been helpful to my understanding of the issue, so thank you for that :) |
Thank you for your time, it also helped me a lot to understand dotbot better and to use it more effectively. |
This is the implementation of groups handler, that is discussed in #81.