Skip to content

ci(release): allow PSGallery publish to recover when the GitHub release already exists#33

Merged
tablackburn merged 1 commit into
mainfrom
ci/publish-recovery-gap
May 22, 2026
Merged

ci(release): allow PSGallery publish to recover when the GitHub release already exists#33
tablackburn merged 1 commit into
mainfrom
ci/publish-recovery-gap

Conversation

@tablackburn
Copy link
Copy Markdown
Owner

Summary

Fixes a recoverability gap in the publish workflow, flagged by both CodeRabbit and Copilot during the YouTubeMusicPS rollout review.

Problem: the PSGallery existence check and the Publish to PSGallery step were gated on steps.check_release.outputs.exists == 'false'. So once a GitHub release exists, publishing is permanently skipped — a run that created the GitHub release but then failed to publish to PSGallery (transient gallery/API-key error) can never recover; re-runs do nothing, leaving the version released-on-GitHub but absent from the Gallery.

Fix (matches the pattern PlexAutomationToolkit already uses):

  • Check if PSGallery Version Exists — runs whenever the repo isn't the un-initialized template (no longer gated on the release check).
  • Bootstrap — runs if a release needs creating or a publish is needed (... 'false' || check_psgallery ... 'false').
  • Publish to PSGallery — gated only on the PSGallery check (publish when the version isn't on the gallery, regardless of GitHub release state).
  • Create GitHub Release — unchanged (still skipped when the release exists, so it's never recreated).

Net effect: a release-created-but-publish-failed run recovers on re-run (creates nothing new, publishes the missing version).

Verification

  • Workflow YAML parses (8 steps).
  • Recovery path: release exists + version not on gallery → check_psgallery runs → Bootstrap runs → Publish runs → Create Release skipped. Template/placeholder path stays inert (gated on the template guard).

This is the template change; it will be propagated to the consumer modules (Plex already has this pattern).

🤖 Generated with Claude Code

…ady exists

The publish step (and PSGallery existence check) were gated on
'GitHub release does not exist', so a run that created the release but failed to
publish to PSGallery could never recover — re-runs skipped publishing entirely.

Regate (matching PlexAutomationToolkit's existing pattern):
- Check if PSGallery Version Exists: runs whenever not the un-initialized template
  (no longer gated on the release check).
- Bootstrap: runs if a release needs creating OR a publish is needed.
- Publish to PSGallery: gated only on the PSGallery check (publish if the version
  isn't on the gallery, regardless of whether the GitHub release exists).
- Create GitHub Release: unchanged (still skipped if the release exists).

Flagged by both CodeRabbit and Copilot during the YouTubeMusicPS rollout review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 22, 2026 00:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Warning

Rate limit exceeded

@tablackburn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 37 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 998838b0-5b97-4cd6-927f-f82279b1fb4b

📥 Commits

Reviewing files that changed from the base of the PR and between e3d324f and e55d32f.

📒 Files selected for processing (1)
  • .github/workflows/PublishModuleToPowerShellGallery.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/publish-recovery-gap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the PowerShell Gallery publish workflow to be recoverable when a GitHub Release already exists (e.g., a prior run created the release but failed to publish to PSGallery). It ensures PSGallery publish is driven by PSGallery state rather than being blocked by the presence of an existing GitHub release.

Changes:

  • Run the PSGallery version existence check independently of whether a GitHub release already exists (while still respecting the template guard).
  • Update Bootstrap gating to run when either a release needs creating or a PSGallery publish is needed.
  • Gate Publish to PSGallery solely on the PSGallery existence check so reruns can publish missing versions even if the GitHub release is already present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tablackburn tablackburn merged commit 090de78 into main May 22, 2026
15 checks passed
@tablackburn tablackburn deleted the ci/publish-recovery-gap branch May 22, 2026 01:11
tablackburn added a commit that referenced this pull request May 23, 2026
…uming not-published (#34)

Now that Publish is gated only on this check (recovery-gap fix #33), a
Find-Module -ErrorAction SilentlyContinue returning $null was treated as
'not on gallery' for BOTH a genuine miss and a transient query failure — so a
network/PSGallery hiccup could trigger a blind publish attempt. Capture
-ErrorVariable: publish only on a clean miss (Find-Module records no error for a
genuine not-found, verified for new-version and never-published cases); on a
recorded error, throw so the run is visibly retryable.

Surfaced by CodeRabbit/Copilot during the YouTubeMusicPS rollout review.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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