Skip to content

Reduce bazel API surface#733

Merged
castler merged 3 commits into
eclipse-score:mainfrom
castler:js_reduce_bazel_api_surface
Jul 24, 2026
Merged

Reduce bazel API surface#733
castler merged 3 commits into
eclipse-score:mainfrom
castler:js_reduce_bazel_api_surface

Conversation

@castler

@castler castler commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This will reduce the exposed targets on a big scale, to only those targets that really should make up our public API.

If this commit breaks you - you are depending on things that are not meant for public usage.

Comment thread score/mw/service/BUILD

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would prohibit usage of mw::service outside of our module.
Target service does not include the targets that you hide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - but I don't think we are ready that it can be used? can it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - but I don't think we are ready that it can be used? can it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Config management is migrating to S-CORE. They need this already.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would prohibit usage of mw::service outside of our module.
Target //score/mw/service does not include the targets that you hide.
There is no other public target in this package that would expose these symbols.

visibility = [
"//visibility:public", # platform_only
],
visibility = ["//score/mw/com:__subpackages__"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bharatGoswami8 please verify whether this target has to be publicly visible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes, it should be and as discussed in yesterday's CFT, we are going to move the public interfaces / APIs outside ofimplfolder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have created PR for same - #736

Comment thread score/mw/com/impl/rust/com-api/com-api-ffi-lola/BUILD Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-concept-macros/BUILD Outdated
"//score/mw/com/gateway:__subpackages__",
"//score/mw/com/impl:__subpackages__",
"//score/mw/com/impl/bindings/lola:__subpackages__",
"//score/mw/com:__subpackages__",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This smells. There is no usage in //score/mw/com:__subpackages__.
Also with this not being publicly visible, I'm struggling how a user should actually create the mocks he requires for his unit tests...

@bemerybmw maybe you can check this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you mean? e.g. score/mw/com/gateway/gateway_application is using it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm missed that one then. But still, how are outside users to use our mocks? I might be missing something here, but to me this currently looks like we are accidentally hiding a feature from our users.

Comment thread quality/visibility_guard/public_targets.golden
@@ -19,155 +10,23 @@
//quality/compiler_warnings:default_link_flags
//quality/compiler_warnings:treat_warnings_as_errors
//quality/coverage:enable_llvm_coverage_for_death_tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should not be publicly visible IMHO.

Comment thread quality/visibility_guard/public_targets.golden
@anmittag anmittag moved this from Backlog to In Progress in COM - Communication FT Jul 21, 2026
@castler
castler force-pushed the js_reduce_bazel_api_surface branch from b4918c3 to 201e13a Compare July 23, 2026 05:11

@castler castler left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Answering review comments

Comment thread score/mw/service/BUILD

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - but I don't think we are ready that it can be used? can it?

Comment thread score/mw/service/BUILD

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - but I don't think we are ready that it can be used? can it?

"//score/mw/com/gateway:__subpackages__",
"//score/mw/com/impl:__subpackages__",
"//score/mw/com/impl/bindings/lola:__subpackages__",
"//score/mw/com:__subpackages__",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you mean? e.g. score/mw/com/gateway/gateway_application is using it?

Comment thread quality/visibility_guard/public_targets.golden
Comment thread quality/visibility_guard/public_targets.golden
@castler
castler enabled auto-merge July 23, 2026 06:54
Comment on lines -146 to -152
//score/mw/service/backend/mw_com:provided_service_builder
//score/mw/service/backend/mw_com:provided_service_decorator
//score/mw/service/backend/mw_com:single_instantiation_strategy
//score/mw/service:factory
//score/mw/service:provided_service
//score/mw/service:provided_service_container
//score/mw/service:proxy_future

@LittleHuba LittleHuba Jul 24, 2026

Copy link
Copy Markdown
Contributor

@castler
castler force-pushed the js_reduce_bazel_api_surface branch 2 times, most recently from 4ce813e to bfd7143 Compare July 24, 2026 07:23
@castler
castler added this pull request to the merge queue Jul 24, 2026
Merged via the queue into eclipse-score:main with commit c4a22d2 Jul 24, 2026
10 checks passed
@castler
castler deleted the js_reduce_bazel_api_surface branch July 24, 2026 07:58
@github-project-automation github-project-automation Bot moved this from In Progress to Done in COM - Communication FT Jul 24, 2026
castler and others added 3 commits July 24, 2026 10:15
Reduce overly broad visibility declarations across BUILD files so targets are internal by default unless intentionally public.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Without this bazel will treat the module_integration_test as part of
this module, which can cause problems in formatting (or public API
checks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants