[infra] support local dev-channel uploads#8949
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the build configuration to use Gradle providers for property and environment variable access and updates deployment and setup scripts for better flexibility and artifact detection. Feedback identifies a risk of silent CI failures due to the removal of the curl fail flag, suggests using Gradle providers for environment variables to improve configuration cache compatibility, and questions the explicit disabling of the configuration cache in the deployment script.
I am having trouble creating individual review comments. Click here to see my feedback.
tool/kokoro/deploy.sh (40)
[MUST-FIX] Removing the --fail (or -f) flag from curl means the script will not exit with a non-zero status code if the upload fails (e.g., due to a 401 or 500 error). This can lead to silent failures in CI. If you need to see the error body, consider using --fail-with-body (available in curl 7.76.0+) or manually checking the HTTP response code.
curl -if \
build.gradle.kts (74)
[CONCERN] Accessing environment variables via System.getenv is discouraged for Gradle Configuration Cache compatibility. Use providers.environmentVariable("KOKORO_GIT_COMMIT") instead.
val commitHash = providers.environmentVariable("KOKORO_GIT_COMMIT").orNull ?: try {tool/kokoro/deploy.sh (11)
[CONCERN] The PR description mentions adding safeguards for the Gradle Configuration Cache, yet this script explicitly disables it with --no-configuration-cache. If the build is now cache-safe, this flag should be removed.
./gradlew buildPlugin -Pdev
Adds support for local
devchannel builds and deployments to the JetBrains Marketplace forflutter-intellij, comparable to what we did for the Dart plugin: flutter/dart-intellij-third-party#340.Along the way we found some gradle issues and curl failures and added safeguards for Gradle Configuration Cache invalidation and more verbose local diagnostics.
Fixes: #8925
Key Changes
1. Gradle Build & Versioning (
build.gradle.kts)git rev-parse --short HEAD) as part of thedevchannel version calculation if theKOKORO_GIT_COMMITenvironment variable is absent.dev,release, andsingleIdeVersionproject property lookups to use the modern Gradleproviders.gradleProperty(...)API. This registers properties as configuration inputs, ensuring correct cache invalidation when switching project parameters.printVersiontask to easily query the calculated plugin version from the command line.2. Kokoro Deployment Pipeline (
tool/kokoro/deploy.sh)JB_MARKETPLACE_TOKENenvironment variable to allow local authorization token injection.--failoption and replaced it withcurl -ito ensure full JetBrains Marketplace error payloads are printed directly to standard output on error rather than hidden behind generic curl exit codes.flutter-intellij.zipautomatically if not running inside the Kokoro pipeline directory structure.setup.shto bypass cloning the Flutter SDK if../flutteris already present locally, making local pipeline test runs pain-free.Verification & Testing
1. Version calculation matches local Git state:
$ ./gradlew printVersion -Pdev flutterPluginVersion: 93.0.0-dev.20260506-9a1a847 ... > Task :printVersion 93.0.0-dev.20260506-9a1a847Verified deployment 👍 :
Review the contribution guidelines below:
AUTHORSfile.CHANGELOG.mdif appropriate.Contribution guidelines:
our contributor guide and
the Flutter organization contributor guide
for general expectations for PRs.
dart format.practices (discussion).