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
LatestVersion
function 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-bash
also since we are doingmapfile -t RECIPE_VERSIONS < <(echo "$recipe_json" | $JQ -r ".versions | keys | .[]" - | sort)
but asort
is 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.py
script, we run a localgit tags -l
and 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_versions
to return a list inapp-json.py
abra-bash
to understand this new list inget_recipe_versions
and make a new point releaseapps.json
to https://apps.coopcloud.tech/cc @roxxers @3wordchant