App.LatestVersion() broken because maps are unordered #44
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We currently have
LatestVersionfunction which purports to return the latest version of a recipe by iterating over a map of the versions listed for a recipe in theapps.json. This doesn't work because Golang maps are unordered. A potentially new version is returned each time...Looks like this is actually broken in
abra-bashalso since we are doingmapfile -t RECIPE_VERSIONS < <(echo "$recipe_json" | $JQ -r ".versions | keys | .[]" - | sort)but asortis not necessarily the actual latest/oldest order we need!For example,
wget -q https://registry.hub.docker.com/v1/repositories/gitea/gitea/tags -O - | jq -r '.[].name'returns the wrong order as well.We could use a list instead in the
apps.json. This would work because in theapp-json.pyscript, we run a localgit tags -land iterate backwards through them - a latest/oldest order which we control (not upstream or Docker Hub).We'd have to do the following:
get_app_versionsto return a list inapp-json.pyabra-bashto understand this new list inget_recipe_versionsand make a new point releaseapps.jsonto https://apps.coopcloud.tech/cc @roxxers @3wordchant