From fc5ce79e694375598bcea15cf115d46ab8e2a3f4 Mon Sep 17 00:00:00 2001 From: antoine-le-calloch Date: Thu, 26 Mar 2026 14:37:24 -0500 Subject: [PATCH 1/4] Remove hardcoded bundle filename from Makefile; simplify bundle target and clean to rm -rf static/build to allow using content hashes in the name. --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d120910..d9d6525 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,6 @@ B=\033[1m # Normal N=\033[0m -bundle = static/build/main.bundle.js rspack = npx rspack # NOTE: These targets are meant to be *included* in the parent app @@ -35,7 +34,7 @@ rspack = npx rspack .PHONY: stop status test_headless test test_report check-js-updates lint-install .PHONY: lint lint-unix lint-githook baselayer_doc_reqs html .PHONY: system_setup service_setup -.PHONY: $(bundle) bundle bundle-watch +.PHONY: bundle bundle-watch help: @python ./baselayer/tools/makefile_to_help.py $(MAKEFILE_LIST) @@ -55,11 +54,9 @@ db_clear: ## Delete all data from the database. db_clear: dependencies @$(PYTHON) ./baselayer/tools/silent_monitor.py ./baselayer/tools/db_init.py -f $(FLAGS) -$(bundle): rspack.config.js package.json +bundle: @$(rspack) -bundle: $(bundle) - bundle-watch: $(rspack) -w @@ -126,7 +123,7 @@ attach: ## Attach to terminal of running webserver; useful to, e.g., use pdb. @echo "$(SUPERVISORCTL) fg app:app_NN" clean: - rm -f $(bundle) + rm -rf static/build stop: ## Stop all running services. $(SUPERVISORCTL) stop all From 8d95433702c416050c619289312105dc3015e75c Mon Sep 17 00:00:00 2001 From: antoine-le-calloch Date: Thu, 26 Mar 2026 14:40:22 -0500 Subject: [PATCH 2/4] Update frontend test to remove the hardcoded bundle name. --- tools/test_frontend.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/test_frontend.py b/tools/test_frontend.py index dce6cbc..2852cb1 100755 --- a/tools/test_frontend.py +++ b/tools/test_frontend.py @@ -65,9 +65,8 @@ def verify_server_availability(url, timeout=180): f"Expected status 200, got {response.status_code} for URL {url}. Retrying." ) - response = requests.get(url + "/static/build/main.bundle.js") - assert response.status_code == 200, ( - "Javascript bundle not found, did packing fail?" + assert 'src="/static/build/' in response.text, ( + "Javascript bundle not found in index.html, did packing fail?" ) return True # all checks passed From 8358f84d0dacdc884240e3ee0cd73cb1eff98fc0 Mon Sep 17 00:00:00 2001 From: antoine-le-calloch Date: Fri, 27 Mar 2026 01:24:37 -0500 Subject: [PATCH 3/4] Update frontend tests to check for the existence of JavaScript bundles with names like main.bundle.js or main.[hash].bundle.js. --- tools/test_frontend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test_frontend.py b/tools/test_frontend.py index 2852cb1..283dc9e 100755 --- a/tools/test_frontend.py +++ b/tools/test_frontend.py @@ -65,8 +65,9 @@ def verify_server_availability(url, timeout=180): f"Expected status 200, got {response.status_code} for URL {url}. Retrying." ) - assert 'src="/static/build/' in response.text, ( - "Javascript bundle not found in index.html, did packing fail?" + bundle_dir = pathlib.Path("static/build") + assert bundle_dir.exists() and any(bundle_dir.glob("main*.bundle.js")), ( + "Javascript bundle not found in static/build/, did packing fail?" ) return True # all checks passed @@ -131,7 +132,6 @@ def verify_server_availability(url, timeout=180): ) server_url = f"http://localhost:{cfg['ports.app']}" - print() log(f"Waiting for server to appear at {server_url}...") exit_status = (0, "OK") From f63a2e250ddd615e93d341f4f3f6e6a26732888e Mon Sep 17 00:00:00 2001 From: antoine-le-calloch Date: Fri, 27 Mar 2026 12:22:05 -0500 Subject: [PATCH 4/4] Fix handling of external services configuration in setup_services.py --- tools/setup_services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup_services.py b/tools/setup_services.py index 268d889..c3d5a08 100644 --- a/tools/setup_services.py +++ b/tools/setup_services.py @@ -399,7 +399,7 @@ def initialize_external_services() -> list: plugins_path = cfg["services.paths"][-1] os.makedirs(plugins_path, exist_ok=True) - plugins = cfg.get("services.external", {}) + plugins = cfg.get("services.external") or {} external_services = [] for plugin_name, plugin_info in plugins.items():