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

Fallback on non-MavenRepository repos #722

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

kubukoz
Copy link
Member

@kubukoz kubukoz commented Jul 23, 2024

Currently, if you publish to the new Sonatype Central repository (#721), during publishing you'll encounter the following issue:

[error] scala.MatchError: URLRepository(https://settingkey/(This / This / This / sonatypeCredentialHost), Patterns(ivyPatterns=Vector(), artifactPatterns=Vector(), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false), false) (of class sbt.librarymanagement.URLRepository)

It happens in the code that computes a step summary. Originally, I tried to write a rendering function for the entire URLRepository, but serializing Patterns is a bit tedious and the step summary isn't all that useful, so I figured we can start with an empty string for now.

@aartigao
Copy link

serializing Patterns is a bit tedious and the step summary isn't all that useful

While this is true, I think returning at least URLRepository.name will be better in this case. And I'll keep the empty string for global fallback.

@kubukoz
Copy link
Member Author

kubukoz commented Jul 25, 2024

yo @armanbilge can we get this merged&released please? 🥺

@armanbilge
Copy link
Member

I think returning at least URLRepository.name will be better in this case.

I agree.

the step summary isn't all that useful

I find it very useful :) I copy-paste from there to get the resolver config whenever I need to depend on a snapshot.

The goal is to print something there that will help the user.

@armanbilge
Copy link
Member

Btw, thanks so much for investigating this, very appreciated 🙏

@kubukoz
Copy link
Member Author

kubukoz commented Jul 25, 2024

Fair enough, added more verbosity! (in non-URLRepository just doing a full toString as well)

@kubukoz
Copy link
Member Author

kubukoz commented Jul 25, 2024

TBH I don't think that'll fix it.

URLRepository(https://SettingKey(This / This / This / sonatypeCredentialHost)

this would imply that there was a toString on a SettingKey used instead of a .value (or equivalent) :/

@aartigao
Copy link

TBH I don't think that'll fix it.

WDYM? At least the MatchError will be fixed, right? You mean that after fixing that it's still failing?

@kubukoz
Copy link
Member Author

kubukoz commented Jul 26, 2024

TBH I don't think that'll fix it.

WDYM? At least the MatchError will be fixed, right? You mean that after fixing that it's still failing?

I haven't tried out the change yet, just thinking that if the URLRepository is constructed this way, and we use that to publish, then it's likely wrong.

But maybe it's not actually used for publishing and only used to print the result, in which case it'd be ok 😅

Copy link
Member

@armanbilge armanbilge 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 chasing this down!

@armanbilge armanbilge merged commit ce3d86e into typelevel:main Jul 26, 2024
14 checks passed
@kubukoz kubukoz deleted the support-url-repo branch July 27, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants