Skip to content

Replace hardcoded release config with dynamic GitHub Releases API loading#78

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/replace-hand-coded-release-configuration
Draft

Replace hardcoded release config with dynamic GitHub Releases API loading#78
Copilot wants to merge 3 commits intomasterfrom
copilot/replace-hand-coded-release-configuration

Conversation

Copy link

Copilot AI commented Mar 18, 2026

The version dropdown was hand-coded HTML <option> elements pointing to static manifest JSON files. Every new WLED release required manual HTML edits and committing new manifest files.

Approach

Dynamically fetch releases from https://api.github.com/repos/wled/WLED/releases, generate esp-web-tools manifests on the fly as blob URLs, and set them as data-* attributes on <option> elements — the same interface script.js already consumes. Zero changes to script.js.

Changes

  • releases.js (new) — Core logic:

    • Fetches releases, categorizes into Release/Beta/Nightly groups
    • Detects available variants (Ethernet, V4, Debug, Audioreactive, etc.) by matching asset name suffixes against VARIANTS config
    • Generates esp-web-tools manifest JSON per variant with absolute bootloader URLs + CORS-proxied firmware URLs
    • Creates blob URLs and sets as data-manifest, data-ethernet, data-v4, etc. on each <option>
    • sessionStorage cache (5 min TTL) to stay within GitHub's 60 req/hr unauthenticated limit
    • Graceful fallback: if API fails, existing static HTML options remain untouched
  • bin/boot/ (new) — Shared bootloader/partition files in a single location, referenced by absolute URL in dynamic manifests

  • index.htm — Two lines: added <script src="releases.js"> and loadReleases() in onload. Static options kept as fallback.

How variant detection works

// Asset suffixes per variant — if the asset exists in the release, the variant is available
const VARIANTS = {
  normal:   { 'ESP32': '_ESP32.bin', 'ESP32-C3': '_ESP32-C3.bin', ... },
  ethernet: { 'ESP32': '_ESP32_Ethernet.bin', 'ESP8266': '_ESP8266.bin' },
  v4:       { 'ESP32': '_ESP32_V4.bin' },
  debug:    { 'ESP32': '_ESP32_DEBUG.bin' },
  // ...
};
// Missing asset → no data-attribute → radio button auto-disabled by existing handleCheckbox()

Future enhancement

If the WLED build process includes a web_installer.json asset in releases, releases.js could prefer that over pattern matching for exact per-release control.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esphome.github.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 18, 2026 09:03
- Create bin/boot/ with shared bootloader/partition files
- Create releases.js: fetches wled/WLED releases, generates esp-web-tools
  manifests dynamically as blob URLs, populates dropdown, with sessionStorage
  caching and graceful fallback to static HTML options
- Update index.htm: add releases.js script, call loadReleases() on load
- Static options remain as fallback when API is unavailable

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
…gging

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add dynamic release configuration using GitHub release API Replace hardcoded release config with dynamic GitHub Releases API loading Mar 18, 2026
Copilot AI requested a review from netmindz March 18, 2026 09:08
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