Skip to content

Restructure CI/CD workflows and add test tier separation#4

Merged
wl2027 merged 4 commits into
mainfrom
claude/blissful-franklin-Dg6KQ
Jun 7, 2026
Merged

Restructure CI/CD workflows and add test tier separation#4
wl2027 merged 4 commits into
mainfrom
claude/blissful-franklin-Dg6KQ

Conversation

@wl2027

@wl2027 wl2027 commented Jun 7, 2026

Copy link
Copy Markdown
Owner

What type of change does this PR introduce?

  • Build-related changes. 编译&构建相关的更改
  • Refactoring. 功能重构

Description of the PR:

This PR restructures the GitHub Actions CI/CD workflows to improve clarity, maintainability, and separation of concerns:

Workflow Changes:

  1. build.yml - Refactored into focused stages:

    • test job: Runs unit, integration, and headless UI tests on every push/PR
    • detect job: Determines if a release draft is needed (non-PR events only)
    • releaseDraft job: Builds plugin and creates/refreshes GitHub Release draft (conditional)
    • inspectCode job: Runs Qodana analysis independently (non-blocking)
  2. release.yml (new) - Dedicated workflow for publishing to JetBrains Marketplace:

    • Triggered only when a maintainer manually publishes a GitHub Release
    • Verifies release tag matches project version
    • Validates all required secrets before publishing
    • Keeps Marketplace credentials isolated from draft creation
  3. run-plugin-verifier.yml (new) - Separated Plugin Verifier workflow:

    • Runs on-demand or weekly schedule (not on every build)
    • Prevents slow/disk-heavy verification from blocking release drafts
    • Can still be run locally via Gradle configuration
  4. run-ui-tests.yml - Simplified to run headless component tests:

    • Removed RemoteRobot server setup (not needed for headless tests)
    • Unified test execution across Linux, Windows, macOS
    • Clearer naming and documentation

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 enums
  • RuntimePivotPluginIntegrationTest: Integration tests verifying plugin loading and service registration
  • RuntimePivotSwingComponentTest: Headless Swing component tests

Key Improvements:

  • Release drafts are created/refreshed based on version state (new/draft/published/tagged)
  • Marketplace publishing is decoupled from draft creation and requires manual approval
  • Plugin Verifier runs independently on schedule, not blocking releases
  • Test execution is split into logical tiers for faster feedback
  • All workflows have explicit permission scopes (principle of least privilege)
  • Better documentation and clearer job dependencies

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

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Qodana Community for JVM

It 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 report

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

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@v2024.2.5
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

claude added 3 commits June 7, 2026 02:24
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
@wl2027 wl2027 merged commit 28592c7 into main Jun 7, 2026
6 checks passed
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