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

trusted project: respect intellij settings controlling project trustness #6521

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

ujohnny
Copy link
Collaborator

@ujohnny ujohnny commented Jun 26, 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.

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.

Discussion thread for this change

Issue number: <please reference the issue number or url here>

Description of this change

Do not show dialogs to trust if trust checks are disabled in the intellij platform. Project creation code is handled in a custom way in bazel plugin because any project is trusted by default in intellij. However, bazel plugin always creates a fake project in .cl/ij/aswb folder, so the plugin should handle trust checks by itself.

Do not show dialogs to trust if trust checks are disabled in the
intellij platform. Project creation code is handled in a custom way
in bazel plugin because any project is trusted by default in
intellij. However, bazel plugin always creates a fake project in
.cl/ij/aswb folder, so the plugin should handle trust checks by itself.
@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 Jun 26, 2024
@mai93
Copy link
Collaborator

mai93 commented Jun 26, 2024

is this related to #6490?

@tpasternak
Copy link
Collaborator

is this related to #6490?

yes it is

Copy link
Contributor

@dkashyn-sfdc dkashyn-sfdc left a comment

Choose a reason for hiding this comment

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

Thanks!

@brian-mcnamara
Copy link
Contributor

Thanks! It may be worth checking @tpasternak if TrustedProjects should come out of Internal status, most of this function could be replaced by other methods in that class

@tpasternak
Copy link
Collaborator

Thanks! It may be worth checking @tpasternak if TrustedProjects should come out of Internal status, most of this function could be replaced by other methods in that class

Sorry I don't understand

@brian-mcnamara
Copy link
Contributor

Thanks! It may be worth checking @tpasternak if TrustedProjects should come out of Internal status, most of this function could be replaced by other methods in that class

Sorry I don't understand

Right now https://github.com/JetBrains/intellij-community/blob/master/platform/platform-impl/src/com/intellij/ide/trustedProjects/TrustedProjects.kt#L14
is marked internal, however the logic in this repo could also use getProjectTrustedState as well. I'm just unsure if this project prefers not to use internal apis

@mai93
Copy link
Collaborator

mai93 commented Jun 27, 2024

@brian-mcnamara
Copy link
Contributor

do we need to add a similar check to BazelGuard https://github.com/bazelbuild/intellij/blob/master/base/src/com/google/idea/blaze/base/execution/BazelGuard.java#L31?

We do not have any extensions for that EP so we do not need a check there to fix this issue.

@ujohnny
Copy link
Collaborator Author

ujohnny commented Jun 28, 2024

do we need to add a similar check to BazelGuard

no because it does not ask for trust.

is marked internal, however the logic in this repo could also use getProjectTrustedState as well. I'm just unsure if this project prefers not to use internal apis

We can't use getProjectTrustedState because we don't have a project yet. It's all because plugin creates a "fake" project in ijwb/clwb and all created projects are trusted by default. So because of this custom behavior in bazel plugin we have to ask explicitly in TrustAwareProjectCreator.

@ujohnny
Copy link
Collaborator Author

ujohnny commented Jun 28, 2024

I checked this with gateway and I do not observe trust dialogs, so I'm moving forward to merge

@ujohnny ujohnny merged commit 5cd93dc into bazelbuild:master Jun 28, 2024
8 checks passed
@ujohnny ujohnny deleted the enovozhilov/trusted-platform branch June 28, 2024 09:57
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Jun 28, 2024
@tpasternak
Copy link
Collaborator

@mai93 @ujohnny can we cut a hotfix release with this change?

mai93 pushed a commit that referenced this pull request Jul 2, 2024
…ess (#6521)

Do not show dialogs to trust if trust checks are disabled in the
intellij platform. Project creation code is handled in a custom way
in bazel plugin because any project is trusted by default in
intellij. However, bazel plugin always creates a fake project in
.cl/ij/aswb folder, so the plugin should handle trust checks by itself.

fixes #6490

(cherry picked from commit 5cd93dc)
mai93 pushed a commit that referenced this pull request Jul 2, 2024
…ess (#6521)

Do not show dialogs to trust if trust checks are disabled in the
intellij platform. Project creation code is handled in a custom way
in bazel plugin because any project is trusted by default in
intellij. However, bazel plugin always creates a fake project in
.cl/ij/aswb folder, so the plugin should handle trust checks by itself.

fixes #6490

(cherry picked from commit 5cd93dc)
@mai93
Copy link
Collaborator

mai93 commented Jul 2, 2024

released in version 2024.06.04.0.3

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.

TrustAwareProjectCreator should not show when REMOTE_DEV_TRUST_PROJECTS is set
6 participants