Skip to content

[infra] support local dev-channel uploads#8949

Merged
pq merged 3 commits into
flutter:mainfrom
pq:infra_localDevUploads
May 6, 2026
Merged

[infra] support local dev-channel uploads#8949
pq merged 3 commits into
flutter:mainfrom
pq:infra_localDevUploads

Conversation

@pq
Copy link
Copy Markdown
Collaborator

@pq pq commented May 6, 2026

Adds support for local dev channel builds and deployments to the JetBrains Marketplace for flutter-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)

  • Dynamic Git Hash Fallback: Dynamically resolves the Git commit hash prefix (git rev-parse --short HEAD) as part of the dev channel version calculation if the KOKORO_GIT_COMMIT environment variable is absent.
  • Configuration-Cache Safety: Refactored the dev, release, and singleIdeVersion project property lookups to use the modern Gradle providers.gradleProperty(...) API. This registers properties as configuration inputs, ensuring correct cache invalidation when switching project parameters.
  • Dynamic Version Inspection: Registered a new, configuration-cache safe printVersion task to easily query the calculated plugin version from the command line.
  • Robust Catching: Handled potential compilation/CLI environment crashes gracefully (e.g., if git is not present or executing outside of a git clone) with comprehensive code comments.

2. Kokoro Deployment Pipeline (tool/kokoro/deploy.sh)

  • Token Injection: Added support for the JB_MARKETPLACE_TOKEN environment variable to allow local authorization token injection.
  • Visible Debugging: Removed the --fail option and replaced it with curl -i to ensure full JetBrains Marketplace error payloads are printed directly to standard output on error rather than hidden behind generic curl exit codes.
  • Robust Zip Path Matching: Fallback to flutter-intellij.zip automatically if not running inside the Kokoro pipeline directory structure.
  • Local Setup Quality-of-Life: Updated setup.sh to bypass cloning the Flutter SDK if ../flutter is 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-9a1a847

Verified deployment 👍 :

image

Review the contribution guidelines below:

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • I've included the required information in the description above.
  • My up-to-date information is in the AUTHORS file.
  • I've updated CHANGELOG.md if appropriate.
Contribution guidelines:
  • See
    our contributor guide and
    the Flutter organization contributor guide
    for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Dart contributions to our repos should follow the Dart style guide and use
    dart format.
  • Java and Kotlin contributions should strive to follow Java and Kotlin best
    practices (discussion).

@pq pq requested a review from helin24 May 6, 2026 17:20
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 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)

high

[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)

medium

[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)

medium

[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

@pq pq merged commit 3ada93c into flutter:main May 6, 2026
8 checks passed
@pq pq deleted the infra_localDevUploads branch May 6, 2026 22:21
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.

[friction] Support for local dev channel uploads

2 participants