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

estimate: show duplicated modules import path and repository path, but dimmed #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

n-peugnet
Copy link
Contributor

@n-peugnet n-peugnet commented Jan 14, 2025

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 if github.com/charmbracelet/x is not yet packaged in Debian.

Before:
2025-01-14-132038_485x287_scrot

After:
2025-01-14-132301_485x557_scrot

We can see that:

  1. /v11 is dimmed, as the repository root is in fact github.com/caarlos0/env (maybe it would be better not to dim it, I'm not sure).
  2. /conpty is dimmed as well, as the module is in a subfolder of the github.com/charmbracelet/x repository
  3. All modules of github.com/charmbracelet/x afterwards are completely dimmed, as they are part of a repository already printed

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.

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.
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.

1 participant