Skip to content

Commit a73863f

Browse files
committed
api: show latest version of all branches
Not only show latest stable branches but the latest version for every branch supported. Clients should figure out on their own if an upgrade is required. * Stable releases don't require an upgrade to the same stable release * Release SNAPSHOTS can be upgraded to release SNAPSHOTS ,RCs or release * SNAPSHOTS only upgrade to SNAPSHOTS Signed-off-by: Paul Spooren <mail@aparcar.org>
1 parent 30a229d commit a73863f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

asu/api.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ def get_latest() -> dict:
4646
lambda b: b["versions"][0],
4747
filter(
4848
lambda b: b.get("enabled"),
49-
filter(
50-
lambda b: not b.get("snapshot"),
51-
current_app.config["BRANCHES"],
52-
),
49+
current_app.config["BRANCHES"],
5350
),
5451
)
5552
)

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def app(redis):
8383
{
8484
"name": "19.07",
8585
"enabled": True,
86-
"versions": ["19.07.6", "19.07.5"],
86+
"versions": ["19.07.7", "19.07.6"],
8787
"git_branch": "openwrt-19.07",
8888
"path": "releases/{version}",
8989
"path_packages": "releases/packages-{branch}",

tests/test_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def test_api_build(client):
2424

2525
def test_api_latest_default(client):
2626
response = client.get("/api/latest")
27-
assert response.json == {"latest": ["19.07.6"]}
27+
assert "19.07.7" in response.json["latest"]
28+
assert "21.02.0-rc1" in response.json["latest"]
29+
assert "SNAPSHOT" in response.json["latest"]
2830
assert response.status == "200 OK"
2931

3032

0 commit comments

Comments
 (0)