From 7ceabb6f945993745b357d06731888181baacaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Andr=C3=A9s=20P=C3=A9rez=20Batanero?= Date: Fri, 26 Dec 2025 19:37:19 +0100 Subject: [PATCH 1/2] Revert "build-request: sanitize incoming "supported devices" list" This reverts commit 1579236ca291a13b1f9f8b2e2552a776821e642d. Since the issue which originated that commit has been fixed[1] revert it to avoid other issues related to device identification when the devices share SUPPORTED_DEVICES strings[2]. [1]: https://github.com/openwrt/openwrt/pull/21095 [2]: https://github.com/openwrt/asu/issues/1525#issuecomment-3497242570 --- asu/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asu/util.py b/asu/util.py index 6daf3fe3..7166bbb7 100644 --- a/asu/util.py +++ b/asu/util.py @@ -578,7 +578,7 @@ def reload_profiles(app: FastAPI, version: str, target: str) -> bool: ) app.profiles[version][target] = { - name.replace(",", "_"): profile + name: profile for profile, data in response.json()["profiles"].items() for name in data.get("supported_devices", []) + [profile] } From 4ffc3a45d185b312a3dea9998e812012b4d34ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Andr=C3=A9s=20P=C3=A9rez=20Batanero?= Date: Fri, 26 Dec 2025 19:40:43 +0100 Subject: [PATCH 2/2] Revert "build-request: sanitize profile before use" This reverts commit 2e9edfd62ed5b079348b1e27c8f19024603d0420. Since the issue which originated that commit has been fixed[1] revert it to avoid other issues related to device identification when the devices share SUPPORTED_DEVICES strings[2]. [1]: https://github.com/openwrt/openwrt/pull/21095 [2]: https://github.com/openwrt/asu/issues/1525#issuecomment-3497242570 --- asu/routers/api.py | 3 --- asu/util.py | 2 +- tests/test_api.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/asu/routers/api.py b/asu/routers/api.py index b26c85de..06b604a1 100644 --- a/asu/routers/api.py +++ b/asu/routers/api.py @@ -209,9 +209,6 @@ def api_v1_build_post( request: Request, user_agent: str = Header(None), ): - # Sanitize the profile in case the client did not (bug in older LuCI app). - build_request.profile = build_request.profile.replace(",", "_") - add_build_event("requests") request_hash: str = get_request_hash(build_request) diff --git a/asu/util.py b/asu/util.py index 7166bbb7..7da271fd 100644 --- a/asu/util.py +++ b/asu/util.py @@ -168,7 +168,7 @@ def get_request_hash(build_request: BuildRequest) -> str: build_request.version, build_request.version_code, build_request.target, - build_request.profile, + build_request.profile.replace(",", "_"), get_packages_hash( build_request.packages_versions.keys() or build_request.packages ), diff --git a/tests/test_api.py b/tests/test_api.py index fb62343c..42f35a35 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -537,7 +537,7 @@ def test_api_build_real_ath79(app): target="ath79/generic", version="23.05.5", packages=["tmux", "vim"], - profile="8dev,carambola2", # Test unsanitized profile. + profile="8dev_carambola2", ), )