Add fetch_devedition function to generate.nu#62
Add fetch_devedition function to generate.nu#62LucasOe wants to merge 2 commits intonix-community:masterfrom
generate.nu#62Conversation
There was a problem hiding this comment.
Pull request overview
This PR separates the Firefox Developer Edition downloads to use the correct Mozilla CDN path (pub/devedition/releases/ instead of pub/firefox/releases/), which is the proper source for Developer Edition binaries.
Changes:
- Added a new
fetch_deveditionfunction togenerate.nuthat fetches from the Developer Edition CDN path - Updated the call site to use
fetch_deveditioninstead offetch_releasefor Developer Edition - Regenerated
latest.jsonwith the correct URLs and hashes for Developer Edition binaries
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| generate.nu | Added fetch_devedition function and updated the call site to use it for Developer Edition |
| latest.json | Updated Developer Edition URLs to use pub/devedition/releases/ path and regenerated hashes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def fetch_devedition (version: string, system: string, extension: string) { | ||
| let base = $"https://download.cdn.mozilla.net/pub/devedition/releases/($version)" | ||
|
|
||
| let filename = $"($system)/en-US/firefox-($version).($extension)" | ||
|
|
||
| let row = ( | ||
| http get $"($base)/SHA512SUMS" | ||
| | from ssv -m 1 --noheaders | ||
| | where column1 == $filename | ||
| ) | ||
|
|
||
| if ($row | is-not-empty) { | ||
| let hash = $row.column0.0 | ||
|
|
||
| return { | ||
| version: $version, | ||
| url: $"($base)/($filename)", | ||
| hash: (to_sri $hash) | ||
| } | ||
| } else { | ||
| return null | ||
| } | ||
| } |
There was a problem hiding this comment.
The fetch_devedition function is nearly identical to fetch_release (lines 8-30), with only the base URL differing. Consider refactoring to reduce code duplication by adding a parameter to control the URL path segment, or by extracting the common logic into a shared helper function. This would make the code more maintainable and reduce the risk of bugs when updating one function but forgetting to update the other.
There was a problem hiding this comment.
The duplication is intentional for now: separate functions are meant to make the semantic distinction between the different channels explicit at the call site, rather than encoding that distinction via a parameter.
I'm open to revisiting this if requested by @colemickens.
generate.nu
This pull request updates how the "devedition" (Developer Edition) Firefox builds are fetched and referenced. The main change is that "devedition" is now retrieved from its correct upstream location, which is separate from the standard Firefox releases. This ensures the correct URLs and hashes are used for these builds.
Fixes #61