-
Notifications
You must be signed in to change notification settings - Fork 314
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
Bazel API improvements #8985
Bazel API improvements #8985
Conversation
c5392d5
to
b9bc575
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8985 +/- ##
============================================
+ Coverage 67.97% 68.02% +0.05%
Complexity 1158 1158
============================================
Files 241 241
Lines 7690 7690
Branches 867 867
============================================
+ Hits 5227 5231 +4
+ Misses 2106 2103 -3
+ Partials 357 356 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9cf85a7
to
3d162ac
Compare
@@ -47,7 +47,9 @@ internal class CompositeBazelModuleRegistryService( | |||
* created based on the passed in [urls]; local registries use the given [projectDir] as workspace. | |||
*/ | |||
fun create(urls: Collection<String>, projectDir: File): CompositeBazelModuleRegistryService { | |||
val packageNamesForServer = urls.filter { it.endsWith("source.json") }.mapNotNull { url -> | |||
val registryUrls = urls.distinctBy { it.removeSuffix("/") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you need disambiguation here when there is the filter
underneath that accepts only URLs ending with source.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, couldn't there still be the same URL ending with "source.json" multiple times in the collection? But anyway I agree that the removeSuffix("/")
"normalization" can be omitted here.
clients/bazel-module-registry/src/main/kotlin/LocalBazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
The only place where the function is called with theoretically nullable arguments is from within a mock in a test, but the compiler seems to accept this. Signed-off-by: Sebastian Schuberth <[email protected]>
Be concrete when producing lists and lenient when accepting collections. Signed-off-by: Sebastian Schuberth <[email protected]>
Signed-off-by: Sebastian Schuberth <[email protected]>
Signed-off-by: Sebastian Schuberth <[email protected]>
This avoids output like Creating remote Bazel module registry at 'https://bcr.bazel.build/'. Creating remote Bazel module registry at 'https://bcr.bazel.build'. Signed-off-by: Sebastian Schuberth <[email protected]>
3d162ac
to
437137d
Compare
Please have a look at the individual commit messages for the details.