Skip to content

Add preview URL readiness check and Cloudflare deploy example#56

Merged
DeDuckProject merged 3 commits intomainfrom
claude/github-action-dependencies-Gl7bx
Mar 16, 2026
Merged

Add preview URL readiness check and Cloudflare deploy example#56
DeDuckProject merged 3 commits intomainfrom
claude/github-action-dependencies-Gl7bx

Conversation

@DeDuckProject
Copy link
Owner

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-timeout input (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:

    • Starting a local app via startCommand (when no preview URL is provided)
    • Waiting for a preview URL to be ready (when previewUrl config or preview-url input is provided)
  • Exported waitForUrl function: Made the waitForUrl utility function exportable for testing and potential reuse.

  • Cloudflare Pages example workflow: Added a complete, production-ready example (examples/cloudflare-deploy/workflow.yml) demonstrating:

    • Deploying to Cloudflare Pages on pull requests
    • Running git-glimpse against the resulting preview URL
    • Supporting comment-triggered re-runs (e.g., /glimpse commands) without redeploying
    • Proper job dependencies and conditional execution
    • Caching of Playwright and FFmpeg dependencies
  • Unit tests: Added comprehensive tests for the waitForUrl function covering success, retry, and timeout scenarios.

Implementation Details

The waitForUrl function 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

claude added 3 commits March 16, 2026 22:26
…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
@DeDuckProject DeDuckProject merged commit 9737234 into main Mar 16, 2026
3 checks passed
@DeDuckProject DeDuckProject deleted the claude/github-action-dependencies-Gl7bx branch March 16, 2026 23:00
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