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

Add debug information about tags #633

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

Conversation

beta-ziliani
Copy link
Member

This PR introduces two minor changes as a palliative to #521 :

  • When using --versbose, shards lists the tags it found in the repository and those that match pattern vX.Y.
  • When failing, it suggests using --verbose.

I wasn't sure if vX.Y is descriptive enough, but the bare matching string is even less readable...

Output on a failing run:
➜  shard-test git:(main) ✗ shards          
Resolving dependencies
Fetching https://github.com/spider-gazelle/priority-queue.git
Unable to satisfy the following requirements:

- `priority-queue (0.2.0)` required by `shard.yml`
Failed to resolve dependencies
You might find useful information using the --verbose option
Output with `--verbose`:
➜  shard-test git:(main) ✗ shards --verbose
Resolving dependencies
git ls-remote --get-url origin
Fetching https://github.com/spider-gazelle/priority-queue.git
git fetch --all --quiet
git tag --list --column=never
Tags: v1.0.1, v1.1.0
Version tags (vX.Y): 1.0.1, 1.1.0
Unable to satisfy the following requirements:

- `priority-queue (0.2.0)` required by `shard.yml`
Failed to resolve dependencies

@straight-shoota
Copy link
Member

straight-shoota commented May 31, 2024

Having this additional information is certainly helpful.
However, I'm wondering if this is the best way to make it available.

The initial error message could already contain some diagnostic information to help the user directly, instead of just guiding to run again with --verbose. IMO "run again with --verbose" is a UX anti-pattern and should be avoided if possible. It requires manual interaction which is at best annoying in an interactive shell session, but can be really hard to deal with in automated environments (such as CI).
If we have the ability and knowledge to provide some helpful information directly, let's try to do that without another round trip.

We know which shard failed to install, so we could show some basic information such as available versions. Maybe filter/highlight ones that are similar to the missing version, to help against typos?

I expect the verbose tag output with --verbose could be quite polluted when you have a couple of dependencies with hundreds of tags (wether they are releases or not). And I'm not sure it would be that helpful to have this expansive information about all dependencies, when you're probably only interesting in one (the one which failed to resolve).
So perhaps a better way might be listing available versions per shard? This would fit well with a shards info command (#86).

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.

None yet

2 participants