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

Print more helpful message if no artifact matching the version pattern is found #738

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

parsharma
Copy link
Contributor

Issue: #657

Copy link
Collaborator

@spyrkob spyrkob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parsharma this has to work for any patterns not just this specific one text. It probably needs to be detected at wildfly-channel library level and reported back in the exception.

@TomasHofman
Copy link
Contributor

I was looking with @parsharma , I think if we want to improve the message to give more details, we would have to essentially list details about all involved channels, so the original message:

ERROR: Unable to resolve artifacts:
  * io.smallrye.config:smallrye-config-common:jar [missing]
  * [other artifacts...]
 Attempted repositories:
  *MRRC::https://maven.repository.redhat.com/ga/
  *indy::https://indy.psi.redhat.com/api/content/maven/hosted/pnc-builds/
  *brew::https://download.devel.redhat.com/brewroot/repos/jb-eap-8.0-maven-build/latest/maven/
  *central::https://repo1.maven.org/maven2/

would probably need to look like:

ERROR: Unable to resolve artifacts:
  * io.smallrye.config:smallrye-config-common:jar [missing]
    [here search the channel streams if they contains given artifact and show the version or version pattern, like:]
    * channel A: stream found with version pattern "blah"
    * channel B: stream found with version "1.2.3"
    * channel C: no stream found, no stream strategy: LATEST
  * ...
 Attempted repositories:
  [here show repositories defined in each channel:]
  * channel A:
    *MRRC::https://maven.repository.redhat.com/ga/
    *indy::https://indy.psi.redhat.com/api/content/maven/hosted/pnc-builds/
    *brew::https://download.devel.redhat.com/brewroot/repos/jb-eap-8.0-maven-build/latest/maven/
  * channel B:
    *central::https://repo1.maven.org/maven2/
  ...

It could get quite verbose in the end, would have to somehow display details about all channels relevant to each missing artifact.

Maybe necessarily we wouldn't need to modify the channel library to provide more info in the original exception, as we can get access to the list of channels ourselves in prospero, we know that all configured channels are used by the channel session.

The effort and verbosity in the end doesn't look awful, but still it's to be considered if we should go into these details, to me it looks helpful for end user unless it gets too verbose.

WDYT?

@TomasHofman
Copy link
Contributor

Then also would that be like giving too much information to end user? Maybe it's useful to person assembling the channels, but too much info for the person running the installation..? Maybe print that in some verbose mode? Just ideas...

@spyrkob
Copy link
Collaborator

spyrkob commented Jul 26, 2024

Thanks for the analysis @TomasHofman!

Keeping it in verbose mode might make sense. It should be a fairly small change to switch it between verbose and normal output, so we can see how it feels when it's implemented.

I was originally thinking more along the lines of a short message like * io.smallrye.config:smallrye-config-common [missing - no version matching patterns "<PATTERN,...>"] if the only channels providing this stream use a versionPattern. But maybe that's a good opportunity to review other errors and provide better logging. I'll take a closer look at this next week.

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.

3 participants