ci(release): allow PSGallery publish to recover when the GitHub release already exists#33
Conversation
…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>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
Bootstrapgating to run when either a release needs creating or a PSGallery publish is needed. - Gate
Publish to PSGallerysolely 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.
…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>
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 PSGallerystep were gated onsteps.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):
... 'false' || check_psgallery ... 'false').Net effect: a release-created-but-publish-failed run recovers on re-run (creates nothing new, publishes the missing version).
Verification
check_psgalleryruns →Bootstrapruns →Publishruns →Create Releaseskipped. 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