explorer reuse between types #148
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#148
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: antifob
I made PR #557 to not rely solely on getent(1) to get passwd entries (among others) and
just noticed there is overlap with other types' explorers (e.g. __ssh_dot_ssh). As such, I am
wondering whether it would not be more appropriate to allow types to share explorers rather
than having to duplicate code on all changes..
Placing them in __global/explorer would make them run automatically, which is obviously not
desired.
I am unclear on the solution here. Would a small refactoring with symlinks be sufficient or
would a type/share/explorer -style solution be more appropriate? Assuming explorers' interface
are well-defined, I am of the opinion that having a repository of explorers usable by types would
be much more interesting.
closed
Created by: antifob
@darko-poljak No offense, but no thanks, I am getting a heavy (many, many seconds) response time trying to hit the page, plus I won't receive a confirmation.
Anyways, #512 is about clean code while the issue I raised is about maintenance. Although I understand and agree with the fundamentals of #512 , transparent execution of "lib/default" vs "lib/$os" could lead, from where I stand, to debugging problems. Already, some explorers and gencode-remote scripts make way too much assumptions about the target host without proper checks. As an example:
which tries to call systemctl if systemd is not the init (Debian 8 [no 9?, also sid has update-rc.d still]).
So having to check per-os, per-cases just leads to duplicated code once, in my opinion... unless most of the code falls into "default", where you would have the same "spaghetti code" again.
I much prefer having a single operation implemented in a single place with proper formatting than having the check where and why a particular block of code was executed.
In any case, I am open to the discussion.
Created by: darko-poljak
@asteven @uqam-fob @telmich Perhaps this can be connected with this idea: https://github.com/ungleich/cdist/issues/512
Created by: darko-poljak
@uqam-fob Please join ungleich's cdist chat channel: https://brandnewchat.ungleich.ch/ungleich/channels/cdist, a place for main cdist discussion.
Created by: antifob
Wonderful!
I implemented a small proof of concept in:
d5c1a7cd77
Created by: telmich
That is an interesting question! We so far have not had that much and thus not the need for a solution, however we implemented __files lately (maybe a year ago) and maybe we could either use that or some other location to provide for "reusable explorers".
We might though want to even go one step further and @asteven will be very awake when he reads this and maybe create something like a "shell library".
The discussion is open, I would say! :-)