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

Improve resolution comment #380

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

Conversation

kmate-ct
Copy link

@kmate-ct kmate-ct commented Feb 5, 2024

See #379. This changes the current resolution comment from:

# duplicates in org.threeten:threetenbp downgraded to 1.6.8
# - com.google.cloud:google-cloud-pubsub:1.123.0 wanted version 1.6.5
# - com.google.cloud:google-cloud-storage:2.14.0 wanted version 1.6.3

to:

# duplicates in org.threeten:threetenbp promoted to 1.6.8
# - com.google.cloud:google-cloud-pubsub:1.123.0 wanted version 1.6.5
# - com.google.cloud:google-cloud-storage:2.14.0 wanted version 1.6.3
# - com.google.cloud:google-cloud-storage:2.27.0 (evicted) wanted version 1.6.8

@kmate-ct
Copy link
Author

kmate-ct commented Feb 5, 2024

It would actually even better if the resolution comment of com.google.cloud:google-cloud-storage would not be empty, but would state that 2.27.0 was present in the graph, but not chosen because of the fixed version.

Copy link
Collaborator

@johnynek johnynek left a comment

Choose a reason for hiding this comment

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

Thanks for this improvement.

Glad the edge label is finally useful! ;)

I had one suggestion if you are willing to take and I would be happy to merge.

@@ -376,7 +376,8 @@ object Writer {
s"""# duplicates in ${coord.unversioned.asString} $status\n""" +
vs.filterNot(e => replaced(e.source))
.map { e =>
s"""# - ${e.source.asString} wanted version ${e.destination.version.asString}\n"""
val evicted = if (e.label) " (evicted)" else ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

rather than using Boolean can we add to DepsModel.scala something like:

sealed abstract class EvictionState(val isEvicted: Boolean)
object EvictionState {
  case object Evicted extends EvictionState(true)
  case object Retained extends EvictionState(false)
}

so we don't have "boolean blindess" type bugs? I'd rather have Edge[MavenCoordinate, EvictionState]] and e.label.isEvicted

Copy link
Author

Choose a reason for hiding this comment

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

Yep, I thought about that as well, it'd be much better!

However, I'm still concerned that with this fix we're just fixing a side effect of a different normalizer bug, see my latest comment on #379. We could continue the conversation there and if we find that this is indeed the right fix, and not something else, then I'll do the fix you recommended and we can merge, but first it'd be great to make sure. Thanks!

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.

2 participants