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

Bazel API improvements #8985

Merged
merged 5 commits into from
Aug 15, 2024
Merged

Bazel API improvements #8985

merged 5 commits into from
Aug 15, 2024

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth requested a review from a team as a code owner August 13, 2024 18:48
@sschuberth sschuberth force-pushed the bazel-api-imps branch 2 times, most recently from c5392d5 to b9bc575 Compare August 13, 2024 19:28
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.02%. Comparing base (e3087af) to head (437137d).
Report is 17 commits behind head on main.

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     
Flag Coverage Δ
funTest-docker 67.39% <ø> (ø)
funTest-non-docker 33.92% <ø> (ø)
test 37.91% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sschuberth sschuberth force-pushed the bazel-api-imps branch 2 times, most recently from 9cf85a7 to 3d162ac Compare August 14, 2024 09:27
@@ -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("/") }
Copy link
Member

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.

Copy link
Member Author

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.

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]>
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]>
@sschuberth sschuberth merged commit b1dd96a into main Aug 15, 2024
22 checks passed
@sschuberth sschuberth deleted the bazel-api-imps branch August 15, 2024 07:19
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