Restructure CI/CD workflows and add test tier separation#4
Conversation
Restructure the plugin CI/CD into a draft-first release pipeline driven by the project version in gradle.properties (pluginVersion), the single source of truth — no version is hardcoded in any workflow. build.yml (rewritten) - test: runs unitTest + integrationTest + ideaUiTest on every push/PR with --continue --no-configuration-cache --console=plain; uploads test reports only on failure (7-day retention); permissions contents: read. - detect (non-PR only): reads the version and emits should_prepare_release, distinguishing draft / published / already-tagged / brand-new via the GitHub Release isDraft flag (existence alone is not treated as published). - releaseDraft (non-PR, tests green, should_prepare_release == true): builds the plugin, asserts a ZIP exists, generates notes from the changelog, then creates or refreshes the draft (updates target SHA + title + notes and --clobber's the ZIP). Refuses to modify a release that was published in the meantime. permissions contents: write; fixed per-branch concurrency group. - inspectCode (Qodana) kept but made independent and non-blocking for releases. release.yml (new): on release: published only — checks out the tag, verifies the tag equals the project version, fails listing any missing signing/publish secret, then runs publishPlugin. Secrets are read only for this trusted event and never printed. run-plugin-verifier.yml (new): Plugin Verifier moved out of the main flow to a manual + weekly schedule so it never blocks release drafts; Gradle pluginVerification config is retained. run-ui-tests.yml (rewritten): manual Linux/Windows/macOS matrix that runs the headless ideaUiTest directly (no RemoteRobot server); per-OS reports on failure, timeout, short retention. runIdeForUiTests/robot-server config is left intact for future RemoteRobot tests. build.gradle.kts: add unitTest / integrationTest / ideaUiTest tasks via intellijPlatformTesting.testIde (filtered by package, headless, marked configuration-cache incompatible). Signing/publishing/publishPlugin wiring was already correct and is left untouched. src/test: add the three test tiers — a pure JUnit unit test, a BasePlatformTestCase integration test, and a headless Swing component test. https://claude.ai/code/session_01VJGUoc28c8yYBmQTLXZaa4
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b629ea12a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.2.5
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
Two CI failures observed on PR #4: 1. The Test job died at gradle/actions/wrapper-validation@v3 with connect ETIMEDOUT to services.gradle.org (the only step touching that host). The auto dependency-submission job minutes earlier had already resolved every project plugin from plugins.gradle.org and a prior run (#13) downloaded Gradle from the Tencent mirror and the IntelliJ Platform from JetBrains, so the build infra works — only this optional supply-chain check was flaky. Remove it so the tests can run. 2. The automatic Gradle dependency-submission job failed because `./gradlew` was "Permission denied" (committed mode 100644), so it fell back to the runner's system Gradle 9.5.1, which is incompatible with the IntelliJ Platform Gradle Plugin 2.1.0 ("Adding a provider of configurations directly to the configuration container is not allowed"). Mark gradlew executable (100755) so the wrapper (8.10.2) is used. https://claude.ai/code/session_01VJGUoc28c8yYBmQTLXZaa4
P1: detection and Marketplace publish now accept both the bare version and the legacy "v"-prefixed release tag (e.g. v2.0.0 from the previous workflow). The detect job searches releases/tags in both forms and exports the resolved tag (release_tag); releaseDraft creates/refreshes that exact tag, so an existing v-prefixed draft is refreshed in place instead of being duplicated. release.yml strips an optional leading "v" before comparing the tag to the project version. New releases keep the bare version, which is what the CHANGELOG compare links and the project's git-tag history use. P2: the workflow-level concurrency now only cancels in-progress runs for pull requests (cancel-in-progress is true only for pull_request events). Release-producing push/dispatch runs serialize within the group instead of being cancelled mid draft-update, so a draft can't be left pointing at a new commit/notes while keeping the old ZIP. https://claude.ai/code/session_01VJGUoc28c8yYBmQTLXZaa4
Bump pluginVersion 2.0.0 -> 2.1.0 and record the CI/CD overhaul under the [Unreleased] changelog heading. On merge to main the detect job will see no release/tag for 2.1.0 and create a fresh Draft Release; patchChangelog moves [Unreleased] to [2.1.0] when the release is published. https://claude.ai/code/session_01VJGUoc28c8yYBmQTLXZaa4
What type of change does this PR introduce?
Description of the PR:
This PR restructures the GitHub Actions CI/CD workflows to improve clarity, maintainability, and separation of concerns:
Workflow Changes:
build.yml - Refactored into focused stages:
testjob: Runs unit, integration, and headless UI tests on every push/PRdetectjob: Determines if a release draft is needed (non-PR events only)releaseDraftjob: Builds plugin and creates/refreshes GitHub Release draft (conditional)inspectCodejob: Runs Qodana analysis independently (non-blocking)release.yml (new) - Dedicated workflow for publishing to JetBrains Marketplace:
run-plugin-verifier.yml (new) - Separated Plugin Verifier workflow:
run-ui-tests.yml - Simplified to run headless component tests:
Test Tier Separation (build.gradle.kts):
Added three distinct test tasks backed by the IntelliJ Platform test runtime:
unitTest: Fast unit tests (package:com.runtime.pivot.plugin.unit.*)integrationTest: Platform integration tests using BasePlatformTestCase (package:com.runtime.pivot.plugin.integration.*)ideaUiTest: Headless Swing/UI component tests (package:com.runtime.pivot.plugin.ui.*)New Test Classes:
RuntimePivotConstantsTest: Unit tests for plugin constants and enumsRuntimePivotPluginIntegrationTest: Integration tests verifying plugin loading and service registrationRuntimePivotSwingComponentTest: Headless Swing component testsKey Improvements:
Additional information:
The restructuring maintains backward compatibility with local Gradle builds while improving CI/CD security and efficiency. The test tier separation allows developers to run specific test categories locally and provides faster feedback in CI.
https://claude.ai/code/session_01VJGUoc28c8yYBmQTLXZaa4