Skip to content

fix: resolve latest.json manifest via /releases/latest (#2225) - #356

Open
DTTerastar wants to merge 1 commit into
mainfrom
fix-latest-manifest-2225
Open

fix: resolve latest.json manifest via /releases/latest (#2225)#356
DTTerastar wants to merge 1 commit into
mainfrom
fix-latest-manifest-2225

Conversation

@DTTerastar

Copy link
Copy Markdown
Contributor

Summary

Fixes the root cause of #2225 — "Failed to download manifest".

Root cause

The manifest handler (functions/releases/[[path]].ts:128) fetched GitHub's /releases/tags/${tag} endpoint. When tag === 'latest', GitHub returns 404 because latest is not a real Git tag. The handler propagated the 404 as {"error":"Release not found"}, which the web installer surfaced as a generic "Failed to download manifest" toast.

The sibling /latest/download/:filename route (line 204) already used the correct /releases/latest endpoint — the manifest handler was never updated to match.

Fix

  1. Resolve latest correctly: when tag === 'latest', fetch from /releases/latest (GitHub's endpoint for the newest non-prerelease) instead of /releases/tags/latest.
  2. Use resolved tag for binary paths: part paths now use rel.tag_name (the real tag, e.g. v4.0.6) instead of the literal ${tag}, so latest manifests produce working download/v4.0.6/*.bin URLs rather than nonexistent download/latest/*.bin paths.
  3. wrangler.toml: add missing compatibility_date (was absent; local wrangler pages dev defaulted to today and exceeded the bundled workerd).

Verification

Before (production, GHA run #29879346118):

[status] latest/esp32: HTTP 404 (body: {"error":"Release not found"})
[status] latest/esp32c3: HTTP 404
[status] latest/esp32s3: HTTP 404
... 31 failures total

After (local wrangler pages dev):

$ python3 tools/manifest_check/check_manifest.py --base http://localhost:8788
Checked 12 target(s).
All manifests OK.

After (Cloudflare Pages preview deployment):

$ python3 tools/manifest_check/check_manifest.py --base https://fix-latest-manifest-2225.espresense.pages.dev
Checked 12 target(s).
All manifests OK.

The manifest-check tool used for verification is in the companion PR (linked below).

Refs: #2225.

The manifest handler fetched GitHub's /releases/tags/${tag}, but 'latest'
is not a real Git tag — GitHub returns 404, propagated as
{"error":"Release not found"} to the web installer, surfacing as
"Failed to download manifest" (#2225).

Fix: when tag === 'latest', use /releases/latest (the endpoint GitHub
provides for resolving newest non-prerelease), matching what the sibling
/latest/download/:filename route already does. Binary part paths now use
rel.tag_name (the resolved real tag, e.g. v4.0.6) instead of the literal
${tag}, so 'latest' manifests produce working download/v4.0.6/*.bin URLs
rather than nonexistent download/latest/*.bin paths.

wrangler.toml: add compatibility_date (was missing; local dev defaulted
to today's date which exceeds the bundled workerd).

Verified locally: wrangler pages dev + manual probe of
/releases/latest.json?flavor=esp32 returns 200 with correct builds and
binary paths pointing at the resolved v4.0.6 tag.

Refs: #2225.
@DTTerastar

Copy link
Copy Markdown
Contributor Author

Companion tool PR: #355

The manifest-check tool used to verify this fix lives in #355. Once both merge, the hourly cron acts as a regression guard.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@DTTerastar, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b35c4477-9956-4c3a-bc2a-97adba78f784

📥 Commits

Reviewing files that changed from the base of the PR and between bc835cd and 4fa54cc.

📒 Files selected for processing (2)
  • functions/releases/[[path]].ts
  • wrangler.toml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-latest-manifest-2225

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying espresense with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4fa54cc
Status: ✅  Deploy successful!
Preview URL: https://b822949f.espresense.pages.dev
Branch Preview URL: https://fix-latest-manifest-2225.espresense.pages.dev

View logs

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.

1 participant