From 49f82071d1d7b8e9d1f084dfe20a0d465ed0ca67 Mon Sep 17 00:00:00 2001 From: Abhinav Arya <3499arya@gmail.com> Date: Tue, 24 Nov 2026 09:27:13 +0530 Subject: [PATCH] fix(cli): recognize Julia nodes in validate, inspect, status and watch (#708) --- concore_cli/commands/_process_match.py | 2 ++ concore_cli/commands/inspect.py | 4 +++ concore_cli/commands/validate.py | 2 +- concore_cli/commands/watch.py | 2 +- tests/test_cli.py | 39 ++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/concore_cli/commands/_process_match.py b/concore_cli/commands/_process_match.py index f1b143e..2d022be 100644 --- a/concore_cli/commands/_process_match.py +++ b/concore_cli/commands/_process_match.py @@ -10,6 +10,8 @@ "concoredocker.hpp", "concore.java", "concoredocker.java", + "concore.jl", + "concoredocker.jl", "concore.v", "concoredocker.v", "concore_read.m", diff --git a/concore_cli/commands/inspect.py b/concore_cli/commands/inspect.py index 4cfcf91..d3ae9be 100644 --- a/concore_cli/commands/inspect.py +++ b/concore_cli/commands/inspect.py @@ -61,6 +61,8 @@ def _inspect_rich(workflow_path, source_dir, console): lang_counts["C++"] += 1 elif ext == ".v": lang_counts["Verilog"] += 1 + elif ext == ".jl": + lang_counts["Julia"] += 1 else: lang_counts["Other"] += 1 @@ -132,6 +134,7 @@ def _inspect_rich(workflow_path, source_dir, console): ".cpp": "C++", ".hpp": "C++", ".v": "Verilog", + ".jl": "Julia", } lang = lang_map.get(ext, "Other") @@ -217,6 +220,7 @@ def _inspect_json(workflow_path, source_dir): ".cpp": "cpp", ".hpp": "cpp", ".v": "verilog", + ".jl": "julia", } lang = lang_map.get(ext, "other") lang_counts[lang] += 1 diff --git a/concore_cli/commands/validate.py b/concore_cli/commands/validate.py index c8972d7..288694b 100644 --- a/concore_cli/commands/validate.py +++ b/concore_cli/commands/validate.py @@ -258,7 +258,7 @@ def finalize(): errors.append(f"Node '{label}' has no filename") elif not any( filename.endswith(ext) - for ext in [".py", ".cpp", ".m", ".v", ".java"] + for ext in [".py", ".cpp", ".m", ".v", ".java", ".jl"] ): warnings.append( f"Node '{label}' has unusual file extension" diff --git a/concore_cli/commands/watch.py b/concore_cli/commands/watch.py index a834f60..e66df67 100644 --- a/concore_cli/commands/watch.py +++ b/concore_cli/commands/watch.py @@ -196,7 +196,7 @@ def _read_edge_files(edge_path): def _detect_source(node_path): - for ext in ("*.py", "*.m", "*.cpp", "*.v", "*.sh", "*.java"): + for ext in ("*.py", "*.m", "*.cpp", "*.v", "*.sh", "*.java", "*.jl"): matches = list(node_path.glob(ext)) for m in matches: # skip concore library copies diff --git a/tests/test_cli.py b/tests/test_cli.py index b95c60d..bee0970 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1029,6 +1029,7 @@ def test_watch_skips_runtime_files_when_detecting_source(self): cases = { "pidM.m": ["import_concore.m", "concore_read.m"], "Plant.java": ["ConcoreJavaRuntimeCore.java", "concoredocker.java"], + "ctrl.jl": ["concore.jl", "concoredocker.jl"], } for source, runtime_files in cases.items(): with self.subTest(source=source): @@ -1038,6 +1039,44 @@ def test_watch_skips_runtime_files_when_detecting_source(self): (node / name).write_text("") self.assertEqual(_detect_source(node), source) + def test_validate_and_inspect_julia_node(self): + graphml = """ + + + + + + + + 0:ctrl.jl + + + + +""" + with self.runner.isolated_filesystem(temp_dir=self.temp_dir): + Path("workflow.graphml").write_text(graphml) + src_dir = Path("src") + src_dir.mkdir() + (src_dir / "ctrl.jl").write_text("# julia controller") + + # validate passes with no unusual file extension warning + val_res = self.runner.invoke(cli, ["validate", "workflow.graphml", "--format", "json"]) + self.assertEqual(val_res.exit_code, 0) + val_payload = json.loads(val_res.output) + self.assertTrue(val_payload["valid"]) + self.assertEqual(val_payload["summary"]["error_count"], 0) + warning_messages = [w["message"] for w in val_payload["warnings"]] + self.assertFalse(any("unusual file extension" in m for m in warning_messages)) + + # inspect reports Julia language + insp_res = self.runner.invoke(cli, ["inspect", "workflow.graphml", "--json"]) + self.assertEqual(insp_res.exit_code, 0) + insp_payload = json.loads(insp_res.output) + self.assertEqual(insp_payload["nodes"]["by_language"].get("julia"), 1) + self.assertEqual(insp_payload["nodes"]["list"][0]["language"], "julia") + if __name__ == "__main__": unittest.main()