Skip to content

Make marketplace publish reruns tolerant of duplicate package failures#9516

Merged
JoeRobich merged 30 commits into
mainfrom
copilot/update-azure-pipelines-release-yml
Jul 10, 2026
Merged

Make marketplace publish reruns tolerant of duplicate package failures#9516
JoeRobich merged 30 commits into
mainfrom
copilot/update-azure-pipelines-release-yml

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PublishToMarketplaceStep currently fails hard when a rerun encounters packages that were already published. This updates the release pipeline to treat the known duplicate-package vsce error as success, while still retrying real publish failures with the requested 1/3/5 minute backoff schedule.

  • Publish step resiliency

    • Wraps vsce @publishArgs so the step can inspect both command output and exit code before deciding whether to fail, retry, or continue.
    • Preserves the existing visible vsce command logging.
  • Duplicate publish detection

    • Adds a small PowerShell helper that matches the vsce duplicate-package error line shape, e.g. ERROR ... v<version> already exists.
    • Treats that case as a successful no-op so rerunning the step does not fail after artifacts are already in the marketplace.
  • Retry behavior for real failures

    • Retries non-duplicate failures up to 3 times after the initial attempt.
    • Uses the requested delays: 1 minute, then 3 minutes, then 5 minutes.
    • Logs attempt numbers and the retry delay, along with the last relevant output line for fast diagnosis.
  • Failure handling

    • Fails clearly after the final unsuccessful attempt.
    • Leaves parameters.test == true behavior unchanged.
Write-Host "##[command]vsce $publishArgs"

$publishOutputLines = & vsce @publishArgs 2>&1 | Out-String -Stream
$exitCode = $LASTEXITCODE

if ($exitCode -eq 0) {
  # success
} elseif (Test-AlreadyPublishedFailure -CommandOutputLines $publishOutputLines) {
  # duplicate publish on rerun -> treat as success
} else {
  # retry with 1/3/5 minute backoff, then fail clearly
}

Copilot AI and others added 13 commits July 9, 2026 16:54
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Copilot AI changed the title [WIP] Update pipeline to handle duplicate package publish errors Make marketplace publish reruns tolerant of duplicate package failures Jul 9, 2026
Copilot AI requested a review from JoeRobich July 9, 2026 17:03
Copilot AI and others added 8 commits July 9, 2026 17:24
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
…kout

Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Comment thread azure-pipelines/release.yml Outdated
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the release pipeline publishing logic to be resilient to reruns where VSIX packages were already published, by centralizing the publish behavior in a PowerShell helper that can interpret vsce output and apply retry/backoff rules.

Changes:

  • Replace direct vsce publish invocation in release.yml with a Publish-Vsix.ps1 helper that supports duplicate-package detection and retries with 1/3/5 minute backoff.
  • Remove the global @vscode/vsce install step and run vsce via npx inside the helper script.
  • Ensure Publish-Vsix.ps1 is included in the build artifact (Packages) so the release pipeline can execute it.
Show a summary per file
File Description
azure-pipelines/release.yml Switches marketplace publishing to run Publish-Vsix.ps1 (with PreRelease/DryRun/CI flags) and sets isPrerelease output.
azure-pipelines/Publish-Vsix.ps1 New script that publishes signed VSIXes via npx @vscode/vsce, detects duplicate-package errors, and retries failures with backoff.
azure-pipelines/build-vsix.yml Copies Publish-Vsix.ps1 into the Packages artifact so it’s available during release publishing.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment on lines +162 to +163
$vsceArgs += '--azure-credential'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have run this locally and did not run into any issue here.

Comment thread azure-pipelines/Publish-Vsix.ps1 Outdated
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
@JoeRobich JoeRobich marked this pull request as ready for review July 9, 2026 23:06
@JoeRobich JoeRobich requested a review from a team as a code owner July 9, 2026 23:06
Copilot AI review requested due to automatic review settings July 9, 2026 23:06
@JoeRobich JoeRobich requested a review from akhera99 July 9, 2026 23:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment thread azure-pipelines/release.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 10, 2026 17:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1


$publishArgs += '-CI'

Write-Host "##[command]& $publishScript $($publishArgs -join ' ')"
@JoeRobich JoeRobich merged commit 51928a4 into main Jul 10, 2026
34 checks passed
@JoeRobich JoeRobich deleted the copilot/update-azure-pipelines-release-yml branch July 10, 2026 20:50
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.

4 participants