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

[#6664]: Collapse two bazel info invocations into one #6728

Conversation

mtoader
Copy link
Contributor

@mtoader mtoader commented Sep 5, 2024

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

Discussion thread for this change

Issue number: #6664

Description of this change

In PR #6711 I added two back to back bazel info calls.
This PR collapsed those calls into one.
Also trying to remove an obsolete Service registration.

@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Sep 5, 2024
@mtoader mtoader force-pushed the mtoader/collapse-bazel-info-invocations branch from 8e28621 to 15b0eed Compare September 5, 2024 01:00
Copy link
Collaborator

@agluszak agluszak left a comment

Choose a reason for hiding this comment

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

LGTM

return blazeInfoStream.readAllBytes();
}
});
.submit(
Copy link
Collaborator

Choose a reason for hiding this comment

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

where does this formatting change come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't figure out how to set up the ide formatter to match what the project has in all details. Some things slip.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's where it was :) Let me use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rebased and reformatted

@mtoader mtoader force-pushed the mtoader/collapse-bazel-info-invocations branch from 15b0eed to ec55262 Compare September 5, 2024 07:46
  In PR bazelbuild#6711 i added two back to back bazel info calls.

  This PR collapsed  those calls into one.
@mtoader mtoader force-pushed the mtoader/collapse-bazel-info-invocations branch from ec55262 to 7df9d91 Compare September 5, 2024 07:47
@mtoader mtoader changed the title [#6664]: Collapse two bazel info invocations into one. [#6664]: Collapse two bazel info invocations into one Sep 5, 2024
@tpasternak tpasternak merged commit 9b26850 into bazelbuild:master Sep 5, 2024
6 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Sep 5, 2024
@mtoader mtoader deleted the mtoader/collapse-bazel-info-invocations branch September 5, 2024 14:27
@@ -114,7 +114,7 @@ private static String getOrThrow(ImmutableMap<String, String> map, String key) {

abstract ImmutableMap<String, String> getBlazeInfoMap();

public String get(String key) {
protected String get(String key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We were using this method in our extension to load the java-home from bazel info. Was there a reson to restrict its visibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I made accessors for individual values and restricted the set of values pulled from bazel info when i merged the two calls to it generated by the fact that i needed to pull info about startlark state (to see if bzlmod and other similar flags are set or not).

I also switched the callers of that to use the accessors. Not sure how i missed yours. What is the context of that miss ?

Copy link
Contributor Author

@mtoader mtoader Sep 27, 2024

Choose a reason for hiding this comment

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

This PR also moved to a white list of things pulled from bazel info. I'm pretty sure java-home was not there since it was not used in the plugin codebase. I can add that and make an accessor for it. Would that help you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Its a internal plugin we have on top of bazel, so no easy to see it was being used :)

I'll let you know, Right not at least its only a compile error and should not be affecting runtime. I'm seeing whether we can use the projects SDK for this usecase instead of using this from bazelInfo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Went ahead and created a PR to add java-home to the info cache: #6810
Our use case does require to use the same java that bazel uses. Thanks for the explanation, I was able to understand the changes better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants