Add preview URL readiness check and Cloudflare deploy example#56
Merged
DeDuckProject merged 3 commits intomainfrom Mar 16, 2026
Merged
Add preview URL readiness check and Cloudflare deploy example#56DeDuckProject merged 3 commits intomainfrom
DeDuckProject merged 3 commits intomainfrom
Conversation
…s polling (#52) The core use-case (waiting for a Cloudflare/Vercel deploy before recording) is already solvable with GitHub Actions' native `needs:` keyword — no git-glimpse changes required for the orchestration itself. The one gap was that even after a deploy job finishes, the preview URL may not be immediately reachable (DNS/CDN propagation). This PR closes that gap: - Poll the external preview URL for readiness before running the pipeline, reusing the existing `waitForUrl` helper that was already used for local apps. - Add a `ready-timeout` action input (default: 30 s) so consumers can tune the wait for slower CDNs. - Add `examples/cloudflare-deploy/workflow.yml` — a fully annotated example showing the `needs:` pattern with Cloudflare Pages. The same pattern applies to Vercel, Netlify, etc. by swapping the deploy step. - Unit tests for `waitForUrl` covering immediate success, retry-until- ready, and timeout-exceeded cases. https://claude.ai/code/session_0174r6vAgr36hTnDVwhPv8mu
Explains how to use GitHub Actions' `needs:` keyword to wait for a deploy preview before recording, how `ready-timeout` handles propagation delay, and how to support `/glimpse` comment triggers alongside deploy jobs. Links to the Cloudflare example workflow and the simple-app example. https://claude.ai/code/session_0174r6vAgr36hTnDVwhPv8mu
…mpse/core The test was importing from index.ts which transitively imports @git-glimpse/core, causing Vite resolution failures in CI. Moving waitForUrl to a standalone module breaks that dependency chain. https://claude.ai/code/session_0174r6vAgr36hTnDVwhPv8mu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for waiting until a preview URL becomes reachable before running git-glimpse, along with a complete example workflow for deploying to Cloudflare Pages and recording visual demos.
Key Changes
Preview URL readiness check: Added a new
ready-timeoutinput (default 30s) that controls how long the action waits for a preview URL to become reachable via HTTP before proceeding. This is essential when using deploy preview services like Cloudflare Pages, Vercel, or Netlify where the URL may not be immediately available.Improved app startup logic: Modified the app startup condition to distinguish between:
startCommand(when no preview URL is provided)previewUrlconfig orpreview-urlinput is provided)Exported
waitForUrlfunction: Made thewaitForUrlutility function exportable for testing and potential reuse.Cloudflare Pages example workflow: Added a complete, production-ready example (
examples/cloudflare-deploy/workflow.yml) demonstrating:/glimpsecommands) without redeployingUnit tests: Added comprehensive tests for the
waitForUrlfunction covering success, retry, and timeout scenarios.Implementation Details
The
waitForUrlfunction polls the preview URL every 1 second until it returns a successful response or the timeout is exceeded. This allows the action to work seamlessly with any deploy preview service that provides a URL before the deployment is fully propagated to the CDN.The example workflow demonstrates a practical pattern: use GitHub's
needs:keyword to orchestrate job dependencies, allowing git-glimpse to automatically use the preview URL from the deploy job without requiring custom configuration.https://claude.ai/code/session_0174r6vAgr36hTnDVwhPv8mu