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

Checked in bazel run configurations in .ijwb/.run are unstable #3259

Closed
beala-stripe opened this issue Feb 18, 2022 · 2 comments
Closed

Checked in bazel run configurations in .ijwb/.run are unstable #3259

beala-stripe opened this issue Feb 18, 2022 · 2 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: bug

Comments

@beala-stripe
Copy link

beala-stripe commented Feb 18, 2022

Some users in our repo have started creating and checking in run configurations in the .ijwb/.run directory. When a run configuration is added to this directory, it is loaded whenever the repo is opened.

The issue is that these run configurations are unstable when generated by the bazel plugin. Depending on much the plugin knows about the target kind, it will generate different run configurations. This dirties the repo and is confusing. Users never know if they're supposed to check in the changed file or not.

The source of this instability appears to be these lines:

private void updateHandler() {
BlazeCommandRunConfigurationHandlerProvider handlerProvider =
BlazeCommandRunConfigurationHandlerProvider.findHandlerProvider(
getTargetState(), getTargetKind());
updateHandlerIfDifferentProvider(handlerProvider);
}

Here, the correct handlerProvider is detected. This depends on the target state and target kind. When a run configuration is modified, and the target is not synced, the kind is set to null. This causes BlazeCommandGenericRunConfigurationHandlerProvider to be selected. If the target is synced and the plugin knows the rule kind is java_binary it will select BlazeJavaRunConfigurationHandlerProvider. When this change is synced back to the run config in .ijwb/.run it dirties the repo.

I'm currently testing out the instructions provided here on how to share run configs, but it would be nice if the bazel plugin supported checking in .ijwb/.run.

This issue was also reported here #2575 but it was closed without resolution.

@beala-stripe
Copy link
Author

I might be mistaken the .ijwb should be checked in. Providing clarification in this following ticket would be helpful: #3250

@sgowroji sgowroji added type: bug product: IntelliJ IntelliJ plugin awaiting-maintainer Awaiting review from Bazel team on issues labels Oct 21, 2022
@sgowroji sgowroji assigned liucijus and unassigned jastice Nov 17, 2022
@mai93 mai93 assigned blorente and unassigned liucijus May 4, 2023
@blorente
Copy link
Collaborator

blorente commented Jun 1, 2023

Hello @beala-stripe
The .ijwb directory is designed to be ephemeral, as it contains a lot of data relative to the user's filesystem (amongst other reasons).
Please follow this comment for advice: #3250 (comment)

To share run configurations, you may store them elsewhere in the repo, and import them via the .bazelproject file

@blorente blorente closed this as completed Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: bug
Projects
Development

No branches or pull requests

5 participants