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

Git-ignore all files from the '.idea' folder, except gradle.xml #10599

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

felladrin
Copy link
Contributor

@felladrin felladrin commented Jun 10, 2022

Description

When opening Gitpod repository on different JetBrains IDEs cause the changes on files inside .idea folder. Currently we simply ignore those files by hand at the moment we're going to commit code changes.

But we actually don't need most of the files inside .idea folder. So this PR git-ignores all files from the '.idea' folder, except gradle.xml as it's required to initialize the Gradle projects from "backend-plugin" and "gateway-plugin" folders, allowing autocomplete to the Kotlin files and other integrations with the IDE.

Related Issue(s)

NONE.

How to test

Release Notes

NONE

Documentation

  • /werft --no-preview=true

@akosyakov
Copy link
Member

We committed .idea folder to import gradle modules on opening of IntelliJ. If we remove modules then we can rather delete entire .idea folder completely?

@felladrin
Copy link
Contributor Author

felladrin commented Jun 13, 2022

We committed .idea folder to import gradle modules on opening of IntelliJ. If we remove modules then we can rather delete entire .idea folder completely?

I tried removing and git-ignoring the whole folder [1][2], but then we'd receive a lot of notifications when opening new workspaces. Also, the gateway-plugin and backend-plugin won't be detected as Gradle projects:
image

@akosyakov
Copy link
Member

Should we close it then?

@felladrin felladrin force-pushed the felladrin/git-ignore-idea-everchanging-files branch from d4b7289 to b44139e Compare June 16, 2022 11:38
@roboquat roboquat added size/L and removed size/M labels Jun 16, 2022
@felladrin
Copy link
Contributor Author

felladrin commented Jun 16, 2022

I've updated the code with a different approach: Removed everything except the gradle.xml (which holds the gradle config for the backend-plugin and gateway-plugin folders). It provided the IntelliSense for those two folders, and all the other files from .idea folder were generated with the content they were before.

image

image

What do you think?

I've also updated the Title and Description of the PR to reflect these changes.

@felladrin felladrin changed the title Git-ignore files 'compiler.xml' and 'modules.xml' from the '.idea' folder as they change too frequently Git-ignore all files from the '.idea' folder, except gradle.xml Jun 16, 2022
@gitpod-io gitpod-io deleted a comment from werft-gitpod-dev-com bot Jun 16, 2022
@gitpod-io gitpod-io deleted a comment from werft-gitpod-dev-com bot Jun 16, 2022
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

let's try if it does not cause any perf drawbacks

/hold

@felladrin
Copy link
Contributor Author

/cc @easyCZ as he has made changes to .idea folder previously and has been working with GoLand.

@akosyakov
Copy link
Member

akosyakov commented Jun 16, 2022

@felladrin I don't think it is so relevant for GoLand.

I was thinking can we put parent gradle project in root instead? and completely remove .idea? See https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:creating_multi_project_builds

Maybe IntelliJ will pick it up automatically then?

@felladrin
Copy link
Contributor Author

I was thinking can we put parent gradle project in root instead? and completely remove .idea? See https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:creating_multi_project_builds

Maybe IntelliJ will pick it up automatically then?

Let me try it!

@felladrin felladrin force-pushed the felladrin/git-ignore-idea-everchanging-files branch 2 times, most recently from 3456dbc to b44139e Compare June 17, 2022 13:11
@felladrin
Copy link
Contributor Author

felladrin commented Jun 17, 2022

@akosyakov, I tried adding settings.gradle.kts with the following content to the root, but, although it worked via command line (gradle -q projects), it didn't link the projects in IntelliJ Gradle Settings, so he plugin folders haven't IntelliSense activated:

rootProject.name = "gitpod"

include("backend-plugin")
project(":backend-plugin").projectDir = file("components/ide/jetbrains/backend-plugin")

include("gateway-plugin")
project(":gateway-plugin").projectDir = file("components/ide/jetbrains/gateway-plugin")

image

I've asked JetBrains Team if there's a specific way to do it, but meanwhile, I'd like to merge it with the current approach of leaving just ".idea/gradle.xml" file committed.

@akosyakov
Copy link
Member

@felladrin yes, go ahead with current approach

@felladrin
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit c2ce96d into main Jun 21, 2022
@roboquat roboquat deleted the felladrin/git-ignore-idea-everchanging-files branch June 21, 2022 07:51
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production editor: jetbrains release-note-none size/L team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants