bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://github.com/bazelbuild/intellij/blob/master/docs/index.md
Apache License 2.0
764 stars 308 forks source link

`IDEA` conflicts with `GoLand` when using `import_run_configurations` feature of Project Views #4102

Open auzhva opened 2 years ago

auzhva commented 2 years ago

Description of the bug:

.bazelproject files alow to export/import run configurations, using import_run_configurations feature - https://ij.bazel.build/docs/project-views.html#import_run_configurations

This allows to share run configurations across the teams.

But when one team member uses IntelliJ IDEA Ultimate and the another one uses GoLand those two systems exports those files differently.

The difference appears to be only technical and boils down to BlazeGoRunConfigurationHandlerProvider (GoLand) vs BlazeCommandGenericRunConfigurationHandlerProvider (IDEA), but that generates a lot of noise in source control system and makes peoples' IDEs compete for that file.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. create .bazelproject file
  2. add some import_run_configurations
  3. Open it with IntelliJ IDEA, commit the file
  4. Open same with GoLand, check git diff
  5. Diff will be there (which should not be)

Which Intellij IDE are you using? Please provide the specific version.

2022.2.3

What programming languages and tools are you using? Please provide specific versions.

Go

What Bazel plugin version are you using?

2022.10.18.0.1-api-version-222

Have you found anything relevant by searching the web?

Yes

Any other information, logs, or outputs that you want to share?

Some parts that may be relevant for that:

blorente commented 1 year ago

Hello! Sorry for the late response on this. Currently we're not (as far as I'm aware) looking into this. Would importing .bazelproject files be a suitable workaround for this case? You could have a common.bazelproject file with:

directories: ...

build_flags: ...

And then have some intellij.bazelproject and goland.bazelproject files, each with their run configurations:

# example: intellij.bazelproject
import "common.bazelproject"

import_run_configurations: ...

I know this is not perfect and ideally the run configurations wouldn't conflict, but ideally it will help enough until we can get to this work.

github-actions[bot] commented 1 year ago

Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-maintainer". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

auzhva commented 1 year ago

Hi this is not stale and still relevant

blorente commented 1 year ago

@auzhva , did you have a chance to try the solution I outlined above? If so, how did you find it?

auzhva commented 1 year ago

Hi,

As far as I see that would require to have separate run configs for IDEA and GoLand. If so, this is not feasible for our team, as it's quite a big team, that partially uses Ultimate+Go plugin, and partially GoLand. It's over 100 devs, and they have their preferences, so forcing them to use "the single right tool" is quite challenging. Having separate run configs also duplicates work.

We implemented a post-processing those run configs in pre-commit hook, so we just manually hack XMLs on commit to be always as if they are from IDEA, and not to generate unnecessary noise.

blorente commented 1 year ago

Gotcha. I'm sorry but right now I don't have the bandwidth to work on this. I'd be happy to review a PR that fixes it, though.

github-actions[bot] commented 6 months ago

Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

auzhva commented 6 months ago

This is still relevant

wittekm commented 3 weeks ago

We are also encountering this!

tpasternak commented 2 weeks ago

Unfortunately we don't have capacity to work on this now, I have to assign P3

tpasternak commented 2 weeks ago

oh, it's already there :/