Skip to content

Initial impl of defaultIde selection setting #522

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

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

bcpeinhardt
Copy link
Collaborator

No description provided.

CONTRIBUTING.md Outdated
@@ -34,7 +34,7 @@ To simulate opening a workspace from the dashboard pass the Gateway link via
`--args`. For example:

```
./gradlew clean runIDE --args="jetbrains-gateway://connect#type=coder&workspace=dev&agent=coder&folder=/home/coder&url=https://dev.coder.com&token=<redacted>&ide_product_code=IU&ide_build_number=223.8836.41&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2022.3.3.tar.gz"
./gradlew clean runIDE --args="jetbrains-gateway://connect#type=coder&workspace=bcpeinhardt&owner=benpeinhardt&agent=dev&folder=/home/coder&url=https://dev.coder.com&token=<redacted>"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll change this back when I'm done messing with it.

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Qodana Community for JVM

5 new problems were found

Inspection name Severity Problems
Incorrect string capitalization 🔶 Warning 1
Redundant nullable return type 🔶 Warning 1
String concatenation that can be converted to string template ◽️ Notice 2
Redundant lambda arrow ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

  1. Register at Qodana Cloud and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format for details)

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2023.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@bcpeinhardt
Copy link
Collaborator Author

@code-asher I'm not actually sure what the best way to test this is 🤔

@bcpeinhardt bcpeinhardt marked this pull request as ready for review January 17, 2025 19:12
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@@ -54,6 +56,7 @@ import com.jetbrains.gateway.ssh.IdeWithStatus
import com.jetbrains.gateway.ssh.IntelliJPlatformProduct
import com.jetbrains.gateway.ssh.deploy.DeployException
import com.jetbrains.gateway.ssh.util.validateRemotePath
import com.jetbrains.rd.generator.nova.PredefinedType
Copy link
Member

Choose a reason for hiding this comment

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

You probably already see the warning but appears to be unused (I think ktlint will delete unused imports if you want to try using that)

// Using contains on the displayable version of the ide means they can be as specific or as vague as they want
// CL 2023.3.6 233.15619.8 -> a specific Clion build
// CL 2023.3.6 -> a specific Clion version
// 2023.3.6 -> a specific version (some customers will on have one specific IDE in their list anyway)
Copy link
Member

Choose a reason for hiding this comment

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

Typo I think in will on have (will only have maybe)

@@ -258,9 +270,24 @@ class CoderWorkspaceProjectIDEStepView(
)
},
)

// Check the provided setting to see if there's a default IDE to set.
val defaultIde = ides.find { it ->
Copy link
Member

Choose a reason for hiding this comment

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

Qodana will complain about it -> since that is the default, although idk how much we should care about Qodana. Possibly ktlint would change this automatically.

Tangent, but I think there is an alias for find called firstOrNull. Kinda surprised there is no indexOfFirstOrNull, only indexOfFirst. indexOfFirst().takeIf { it >= 0 } would work around that I guess.

Anyway, no need to change to those, more that I nerd sniped myself. 😆

row(CoderGatewayBundle.message("gateway.connector.settings.default-ide")) {
textField().resizableColumn().align(AlignX.FILL)
.bindText(state::defaultIde)
.comment("The default IDE version to display in the IDE selection dropdown. " +
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we need to make mention that JetBrains by default only shows the latest version (latest stable and latest EAP I think, right?), so as soon as JetBrains updates their list this setting may become obsolete unless they are using just the IDE name or year.

But, maybe this option will only be used by folks that have provided their own list instead of fetching from JetBrains, so that might not be an issue.

@code-asher
Copy link
Member

code-asher commented Jan 17, 2025

I'm not actually sure what the best way to test this is 🤔

I think we have no way to test this view really, but I suppose one could extract the list model and test that part. I did a similar thing with the workspace selection list.

@bcpeinhardt bcpeinhardt merged commit d27a65e into main Jan 17, 2025
6 checks passed
@bcpeinhardt bcpeinhardt deleted the bcpeinhardt/set-default-ide-version-in-dropdown branch January 17, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants