Skip to content

build: let a run of the release workflow that failed half-way be run again - #2059

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:build/rerunnable-release-workflow
Nov 22, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:build/rerunnable-release-workflow

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Proposed in #1940.

The first run of the release workflow for 0.30.0 published the plugin to the Marketplace and pushed the tag 0.30.0, and then failed at Increment Plugin Version, as the Main protection ruleset refused its push to main (GH013: Repository rule violations). The two runs after it failed at steps that the first one had done: one at Publish Plugin to JetBrains Marketplace, as the Marketplace already had 0.30.0, and one at Tag Release, as the tag already existed. So 0.30.0 never got the next version on main, nor its GitHub release with the release notes.

Each step now skips what an earlier run of the same release did:

  • Find an Earlier Tag, a new step: if the tag of the version exists, the run goes on from the commit that it points to, so that it builds the plugin that was published, and Tag Release is skipped. This also covers a run started again after commits landed on main.
  • Publish Plugin to JetBrains Marketplace asks the Marketplace API for the versions of LSP4IJ in the default channel. If the version is there, it only builds the plugin, for the GitHub release. If the Marketplace can't be asked, it publishes as before, which fails if the version is there, so a version is never published twice.
  • Increment Plugin Version sets the next SNAPSHOT version only if main still has the SNAPSHOT of the released version. If main has moved on since the release commit, which can then not be pushed on top of it, main gets the next version only, and the tag keeps the release commit; before, the push failed. For this check, actions/checkout fetches the whole history (fetch-depth: 0).
  • Create Github Release skips a release that exists, and Upload Release Asset replaces the asset that an earlier run uploaded (--clobber).

A run without an earlier run of the same release goes as before.

Test: actionlint finds nothing new; its five notes about unquoted variables are on lines that this doesn't change. A simulation of the git steps, run against a local bare repository with the scripts of the steps extracted from the workflow, gives the expected main and tag in five cases: a run without failure; a run that fails at the increment and is run again; one that fails at the increment, after which a commit lands on main and a new run starts; a run that went through and is run again; and a commit that lands on main during the run. The Marketplace check finds 0.30.0 and 0.30.1, doesn't find 0.30.2, and publishes when the API can't be reached. The workflow itself can only be tried with a release.

…again

The first run for 0.30.0 published the plugin and pushed the tag, and then
failed to push the next version to main. The runs after it failed at the
steps it had done, so 0.30.0 got neither the next version on main nor its
GitHub release. Each step now skips what an earlier run of the release did:
the run goes on from an existing tag, publishes only a version that the
Marketplace doesn't have, sets the next version only if main doesn't have
it yet, on top of main if main moved on, creates only a missing GitHub
release, and replaces an uploaded asset.
@lagergren lagergren added this to the 0.30.2 milestone Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Release publishing now handles existing version tags and releases without creating duplicates.
    • Existing release assets are replaced when updated, and interrupted releases can resume from their tagged version.
    • Version updates account for changes already present on the main branch.

The release workflow now detects existing release state, adjusts plugin publication and tagging, conditionally updates the snapshot version, and handles existing GitHub releases and assets.

Changes: Release workflow

Layer / File(s) Summary
Resume release and publish plugin
.github/workflows/release.yml
The workflow fetches full history and checks for an existing version tag. When the tag exists, it checks out that commit and records ALREADY_TAGGED. Marketplace publication checks whether the version is already listed, and tagging is skipped for resumed runs.
Synchronize the next snapshot version
.github/workflows/release.yml
The workflow skips the version update when origin/main already has the next snapshot version. Otherwise, it resets to origin/main when needed, then increments, commits, and pushes the version.
Create release and upload assets
.github/workflows/release.yml
The workflow skips GitHub release creation when the release already exists. Asset uploads replace existing assets.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: angelozerr

Merge Risk: Minimal · up to 1872b

The release workflow now resumes a partially completed release: it reuses an existing tag, skips republishing a version already in the Marketplace, creates only a missing GitHub release, and replaces an already-uploaded asset. No concrete defect was established. The remaining unknown is whether a version pending Marketplace approval appears in the public updates API, which can only be confirmed by a real release. Merge-readiness risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the release workflow can now be re-run after a partial failure. It matches the changeset (resume from existing tag, skip completed steps, idempotent publish/tag/releas…
Description check Passed The description explains the problem (the 0.30.0 release run failed half-way and later runs repeated completed steps) and lists the workflow step changes that address it. It also describes the testing…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the release workflow can now be re-run after a partial failure. It matches the changeset (resume from existing tag, skip completed steps, idempotent publish/tag/release steps). It is concise and specific, with no file lists or vague terms.

Full details: Description check

Explanation

The description explains the problem (the 0.30.0 release run failed half-way and later runs repeated completed steps) and lists the workflow step changes that address it. It also describes the testing done. It is directly related to the changeset.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dac1c15e-8aed-4c5e-98f3-7e531f9c6188
Commits

Reviewing files that changed from the base of the PR and between b982bd4 and 1872b27.

Files selected for processing: 1

  • .github/workflows/release.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.51%. Comparing base (b982bd4) to head (1872b27).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2059      +/-   ##
==========================================
+ Coverage   49.49%   49.51%   +0.02%     
==========================================
  Files         813      813              
  Lines       33350    33350              
  Branches     5195     5195              
==========================================
+ Hits        16505    16513       +8     
+ Misses      14272    14264       -8     
  Partials     2573     2573              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren
lagergren requested a review from angelozerr November 21, 2026 11:05
@lagergren
lagergren merged commit cff452a into redhat-developer:main Nov 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant