Conversation
In order to present a valid list of versions, downstream clients are currently parsing the upstream '.versions.json' and synthesizing (or not) a '-SNAPSHOT' version. Since we're doing this already inside ASU, we might as well make it available to clients. This will allow us to rewrite Firmware Selector, which has a hard-coded regex to filter unsupported versions (which is currently wrong). With this change OFS will rely completely on the ASU server to tell it what is available. Likewise, this allows a cleanup of owut to remove its similar parsing of the branches and .versions files. It has no impact on LuCI ASU app, as it only uses the 'latest' list from this API call. Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1577 +/- ##
===========================================
+ Coverage 80.75% 91.97% +11.21%
===========================================
Files 15 16 +1
Lines 977 1745 +768
===========================================
+ Hits 789 1605 +816
+ Misses 188 140 -48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
And some more comments: We're already using I'd like for the The I'm looking at line 24 in the asu_schema.json of your refactoring PR. could be "Whether this branch has a rolling (snapshot) version..." EDIT: |
In order to present a valid list of versions, downstream clients are currently parsing the upstream '.versions.json' and synthesizing (or not) a '-SNAPSHOT' version. Since we're doing this already inside ASU, we might as well make it available to clients.
This will allow us to rewrite Firmware Selector, which has a hard-coded regex to filter unsupported versions (which is currently wrong). With this change OFS will rely completely on the ASU server to tell it what is available.
Likewise, this allows a cleanup of owut to remove its similar parsing of the branches and .versions files.
It has no impact on LuCI ASU app, as it only uses the 'latest' list from this API call.
Additional comments
Should this actually be a new API:
api/v1/versionsinstead of piling it onto the existingapi/v1/latest??? This was simple and all the clients are already grabbinglatest, so it seems like a good fit, but the endpoint name isn't the greatest.Here's that regex, this PR pretty much eliminates all that code turning it into
versions = get("api/v1/latest").versionsand filtering out the -SNAPSHOT versions if theshow_snapshotsetting is turned off.https://github.com/openwrt/firmware-selector-openwrt-org/blob/ea04cec0c9a507db3dabbc97ca6b6db4a58258e8/www/index.js#L828