-
Notifications
You must be signed in to change notification settings - Fork 79
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
estimate: show duplicated modules import path and repository path, but dimmed #241
Conversation
Previously, when a dependency was seen multiple times, it was deduplicated. This helped seeing the exact number of modules that needed to be packaged, but it didn't help seeing the most modules to package in priority. Now, we show duplicate packages but in a dimmed color and with a count of occurences in parenthesis at the end. The colors allows to still quickly evaluate the effort by focusing the eyes on the deduplicated list, while the count helps detecting the most used module.
Keep printing all needed modules recursively, but instead of only dimming the duplicated modules, we also dim the rest of the import path after the repo root, and modules whose repo root has already been printed. This allows to only highlight the repository names (the actual thing that we package in Debian) and only once, so it give a better appreciation of the work packaging work required.
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! This is clearly an improvement many will for sure appreciate. I didn't review each code line in detail but overall looks good and code and commit clear and documented. Thanks for the screenshot, makes it easy to understand what this change does!
Thanks for reviewing a bunch of PRs in past days @NightTsarina. Could you approve this too, as it seems like a very useful improvement? |
Honestly, I am not sure I can review this properly. I don't really know the codebase and I am having a bit of trouble following everything.. Maybe somebody more familiar with it can review instead? |
@creekorful Should I wait for your review on this before cutting the release? |
@NightTsarina This would be appreciated, I'll do my best to tackle this during the weekend. Cheers |
@n-peugnet Looks good to me! I did a review and mess around with it a few times and this is an amazing improvement. Thank you very much for your contribution |
Description
As a follow-up of #240 I am proposing this change, that allows to see how often a module is required in the dependency graph.
Show and indicate duplicate dependencies
Previously, when a dependency was seen multiple times, it was deduplicated. This helped seeing the exact number of modules that needed to be packaged, but it didn't help seeing the most used modules to package in priority.
Now, we show duplicate packages but in a dimmed color and with a count of occurences in parenthesis at the end. The colors allows to still quickly evaluate the effort by focusing the eyes on the deduplicated list, while the count helps detecting the most used module.
Only highlight unique repositories in estimate
Keep printing all needed modules recursively, but instead of only dimming the duplicated modules, we also dim the rest of the import path after the repo root, and modules whose repo root has already been printed. This allows to only highlight the repository names (the actual thing that we package in Debian) and only once, so it give a better appreciation of the work packaging work required.
Example
Here is an example, showing the result of
dh-make-golang estimate github.com/charmbracelet/vhs
, but hacked a little to make as ifgithub.com/charmbracelet/x
is not yet packaged in Debian.Before:

After:

We can see that:
/v11
is dimmed, as the repository root is in factgithub.com/caarlos0/env
(maybe it would be better not to dim it, I'm not sure)./conpty
is dimmed as well, as the module is in a subfolder of thegithub.com/charmbracelet/x
repositorygithub.com/charmbracelet/x
afterwards are completely dimmed, as they are part of an already printed repository.This allows to easily find the corresponding repositories (by copying only the highlighted parts) and to better estimate the packaging work needed.
In fact, If I'm not mistaken, the highlighted part of this picture is the exact output of the estimate command before #240, when it was still working.
I was thinking of adding an additionnal textual indication for packages with duplicated repository path, to be able to have this information even when only the test is copy-pasted. For example, an asterisk at the end, but I am not sure yet.