Skip to content

[build] add kokoro dev channel build#294

Merged
pq merged 2 commits intoflutter:mainfrom
pq:build_kokoro
Mar 31, 2026
Merged

[build] add kokoro dev channel build#294
pq merged 2 commits intoflutter:mainfrom
pq:build_kokoro

Conversation

@pq
Copy link
Copy Markdown
Collaborator

@pq pq commented Mar 25, 2026

Adds kokoro support. This is largely based on what we have in the Flutter Plugin but a bit simplified since, among other things, we don't need to deal with JXBrowser licensing or download the Flutter SDK.

See: #247


Note: The initial bits were proposed by Gemini but I modified its suggestions considerably and tackled the gradle bits (where it got very confused).


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

@pq pq requested a review from helin24 March 25, 2026 15:56
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Kokoro configurations and associated shell scripts for macOS external continuous, presubmit, and release builds of the Dart IntelliJ plugin. It implements dynamic plugin versioning in build.gradle.kts for dev builds, incorporating date and Git commit hash, and includes a deployment script to upload the plugin to the JetBrains Marketplace. Feedback highlights several critical issues: an incorrect setup.sh path in build.sh, missing -Pdev flags for Gradle builds in both build.sh and deploy.sh to enable dev versioning, and an incorrect version determination logic in deploy.sh for dev builds. Additionally, there are concerns regarding unidiomatic Kotlin null checks and the use of System.out.println in build.gradle.kts, which violates the repository's style guide.

pluginVersion = "$nextMajorVersion.0.0-dev.$datestamp"

val commitHash = System.getenv("KOKORO_GIT_COMMIT")
if (commitHash is String) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[CONCERN] Using is String to check if an environment variable exists is unidiomatic. System.getenv() returns a nullable String?. A clearer way to perform a null check in Kotlin is using != null or a scope function like .let.

           if (commitHash != null) {
References
  1. Per the style guide, use of idiomatic Kotlin, such as for null safety, is preferred. The double-bang !! operator is forbidden, and safe calls ?., elvis operator ?:, or standard null checks should be used instead. While is String works, != null is more direct and idiomatic for this check. (link)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

is String reads a bit better to me but I'm ambivalent.

@helin24: if you feel strongly, happy to tweak.

Comment on lines +65 to +66
println("plugin version: $pluginVersion")
println("ideaVersion: $ideaVersion")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[CONCERN] The repository style guide (rule #27) disallows the use of System.out.println. While this is a build script, using Gradle's own logging mechanism is a better practice for consistency and to control log levels. The logger is available by default in Gradle scripts.

        logger.lifecycle("plugin version: $pluginVersion")
        logger.lifecycle("ideaVersion: $ideaVersion")
References
  1. Style guide rule Remove the rest of the reference to "com.intellij.coverage.*" from the plugin #27 states: 'Reject any use of System.out.println or System.err.println for logging.' (link)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We might consider updating the style guide to ignore gradle files but here I do think System.outs are OK (and we have others too).

@pq pq marked this pull request as draft March 25, 2026 16:28
@pq pq mentioned this pull request Mar 25, 2026
6 tasks
@pq pq marked this pull request as ready for review March 31, 2026 01:27
@pq pq merged commit 8adf4f5 into flutter:main Mar 31, 2026
8 checks passed
@pq pq deleted the build_kokoro branch March 31, 2026 16:54
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