Skip to content

feat: show newer pre-release on downloads page (robust, from real assets)#62

Merged
ErikBjare merged 3 commits into
masterfrom
feat/downloads-show-prerelease
Jul 12, 2026
Merged

feat: show newer pre-release on downloads page (robust, from real assets)#62
ErikBjare merged 3 commits into
masterfrom
feat/downloads-show-prerelease

Conversation

@ErikBjare

Copy link
Copy Markdown
Member

What

The /downloads/ page only shows the latest stable (v0.13.2); v0.14.0b1 is filtered out as a prerelease. This adds a Pre-release section whenever the newest prerelease is newer than stable.

Why the rewrite

The old update-downloads.py built links by substituting the version number into a fixed template. v0.14 changed asset naming (activitywatch-tauri-...) and moved macOS to arm64, so substitution would have produced dead -macos-x86_64.dmg links. The rewrite builds each platform's links from the release's actual assets (preferring the plain non-tauri builds), so it survives naming changes — and future-proofs stable for when it moves to v0.14.

  • _data/downloads.yml is now { stable, prerelease? }.
  • downloads.pug renders a "Pre-release: vX" section (with an instability note) when prerelease is present.
  • Package-manager (Chocolatey/AUR/nixpkgs/Homebrew) and Play Store links stay on stable only — betas aren't distributed there.
  • macOS buttons now note Intel vs Apple Silicon.

Verification

Ran the script against the live API and HEAD-checked all 14 generated GitHub asset URLs → all 200, including the v0.14.0b1 Apple Silicon macOS builds. CI build will confirm the pug/Liquid render.

Note: for v0.14 (which ships both classic and tauri builds) this shows the classic activitywatch-* builds for consistency with stable; easy to flip to tauri if preferred.

v4/v5 still target Node 20, which the runners now force onto Node 24 with
a deprecation warning. v5/v6 are the Node-24-native majors and clear it.
… assets

The downloads page only showed the latest stable (prereleases were filtered
out), and update-downloads.py generated links by substituting the version
number into a fixed template — which breaks when asset naming changes (v0.14
ships 'tauri' builds and moved macOS to arm64, so substitution would produce
dead -macos-x86_64.dmg links).

Rewrite update-downloads.py to build each platform's links from the release's
actual assets, and emit a 'prerelease' block whenever the latest pre-release
is newer than the latest stable. downloads.yml is now {stable, prerelease?};
downloads.pug renders a 'Pre-release: vX' section when present. Package-manager
and Play Store links stay on the stable block only.

Verified: all 14 generated GitHub asset URLs return 200, including the
v0.14.0b1 arm64 macOS builds.
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the downloads page to show a newer prerelease when one exists. The main changes are:

  • Generate download data from real GitHub release assets.
  • Store stable and prerelease downloads under separate YAML keys.
  • Render a prerelease section on downloads.pug.
  • Bump the Pages workflow checkout and Python setup actions.

Confidence Score: 4/5

The changed download data path needs fixes before merging.

  • The regenerated YAML shape can break existing homepage schema and download-button consumers.
  • GitHub API error bodies can be treated as release data and crash the scheduled update job.
  • The workflow action bumps look compatible with the hosted runner setup.

scripts/update-downloads.py, _includes/download-url.js, _includes/schema-index.html

Important Files Changed

Filename Overview
.github/workflows/pages.yml Bumps checkout and setup-python to newer action majors that match the hosted runner setup.
_data/downloads.yml Changes download metadata to separate stable and prerelease releases.
downloads.pug Reads the new stable data and conditionally renders prerelease downloads.
scripts/update-downloads.py Rewrites release selection and asset extraction, but leaves schema consumers and API error handling incomplete.

Reviews (1): Last reviewed commit: "feat: show newer pre-release on download..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1db6dced8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread _data/downloads.yml

platforms:
# Generated by scripts/update-downloads.py — do not edit by hand.
stable:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update remaining download data consumers

Because the downloads data now lives under stable, the existing consumers that still read site.data.downloads.version and site.data.downloads.platforms lose their inputs. On the homepage download button, _includes/download-url.js parses the missing platforms value and then calls .filter(...), so visitors with a detected OS hit a JS error instead of getting a direct platform download; _includes/schema-index.html also emits an empty software version and no per-platform entry points. Please either preserve the old top-level aliases or update those includes to read site.data.downloads.stable.*.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in e4749b4. Updated _includes/download-url.js (download button) and _includes/schema-index.html (JSON-LD) to read site.data.downloads.stable.*. Verified no flat downloads.version/downloads.platforms references remain anywhere in the repo.

raise SystemExit("No stable release found")
latest_stable = stable[-1]

data = {"stable": build_block(latest_stable, include_packages=True, with_android=True)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Nested Downloads Break Consumers

When this script writes only stable and prerelease, the existing homepage schema and download-button include still read site.data.downloads.version and site.data.downloads.platforms. After regeneration, those old keys are missing, so the JSON-LD loses its version/download entries and the site-wide download CTA can fail when it tries to filter a null platform list.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in e4749b4. Updated _includes/download-url.js (download button) and _includes/schema-index.html (JSON-LD) to read site.data.downloads.stable.*. Verified no flat downloads.version/downloads.platforms references remain anywhere in the repo.

Comment thread scripts/update-downloads.py Outdated
token = os.getenv("GITHUB_TOKEN")
if token:
headers["Authorization"] = f"Bearer {token}"
releases = requests.get(API, headers=headers, timeout=30).json()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 API Error Becomes Releases

When GitHub returns a JSON error body for a rate limit, auth failure, or transient server error, this line still decodes it and the next filter treats the object keys as release records. The scheduled pages workflow can then crash at r["draft"] instead of reporting the HTTP failure clearly or keeping generation deterministic.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in e4749b4. Added resp.raise_for_status() and an isinstance(releases, list) guard, so a GitHub API error body (rate-limit/auth/5xx) now fails loudly instead of being parsed as releases and crashing at r['draft'].

…rrors

Address review on #62:
- download-url.js (homepage download button) and schema-index.html (JSON-LD)
  still read the old flat site.data.downloads.version/.platforms, which the
  stable/prerelease split removed — point them at .stable.* so the CTA and
  schema keep working.
- update-downloads.py: raise_for_status() + validate the response is a list,
  so a GitHub API error body (rate-limit/auth/5xx) fails loudly instead of
  being parsed as releases and crashing at r['draft'].
@ErikBjare ErikBjare merged commit 1e8ede8 into master Jul 12, 2026
1 check passed
@ErikBjare ErikBjare deleted the feat/downloads-show-prerelease branch July 12, 2026 17:57
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