Skip to content

Commit 6f07fab

Browse files
committed
fix(pinning): resolve PROJECT_ROOT undefined error breaking tool detection
Critical bug fix: - Used undefined PROJECT_ROOT variable in pinning code - Caused NameError exception for all tools during audit - Resulted in all tools showing as 'unknown' with no version info Fix: - Replaced PROJECT_ROOT with os.path.dirname(os.path.abspath(__file__)) - Use os.path.join() for cross-platform path construction - Now correctly loads catalog files to check for pinned_version Affected tools (now working again): - node, docker, docker-compose, bat, entr, parallel - And all other tools in the audit system
1 parent 356114a commit 6f07fab

File tree

4 files changed

+92
-90
lines changed

4 files changed

+92
-90
lines changed

catalog/sponge.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"dnf": "moreutils",
1212
"pacman": "moreutils"
1313
},
14-
"notes": "sponge is part of the moreutils package, which includes other useful tools like chronic, combine, errno, ifdata, ifne, isutf8, lckdo, parallel, pee, ts, vidir, vipe, and zrun."
14+
"notes": "sponge is part of the moreutils package, which includes other useful tools like chronic, combine, errno, ifdata, ifne, isutf8, lckdo, parallel, pee, ts, vidir, vipe, and zrun.",
15+
"pinned_version": "0.69"
1516
}

cli_audit.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,8 +2502,9 @@ def audit_tool(tool: Tool) -> tuple[str, str, str, str, str, str, str, str]:
25022502

25032503
# Check if tool is pinned to current version
25042504
if status == "OUTDATED" and inst_num:
2505-
catalog_file = PROJECT_ROOT / "catalog" / f"{tool.name}.json"
2506-
if catalog_file.exists():
2505+
script_dir = os.path.dirname(os.path.abspath(__file__))
2506+
catalog_file = os.path.join(script_dir, "catalog", f"{tool.name}.json")
2507+
if os.path.exists(catalog_file):
25072508
try:
25082509
with open(catalog_file, "r", encoding="utf-8") as f:
25092510
catalog_data = json.load(f)

latest_versions.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
"gh:BurntSushi/ripgrep": "latest_redirect",
44
"gh:GAM-team/GAM": "latest_redirect",
55
"gh:TomWright/dasel": "latest_redirect",
6-
"gh:antonmedv/fx": "releases_api",
6+
"gh:antonmedv/fx": "latest_redirect",
77
"gh:aquasecurity/tfsec": "latest_redirect",
88
"gh:aquasecurity/trivy": "latest_redirect",
99
"gh:arxanas/git-branchless": "latest_redirect",
1010
"gh:ast-grep/ast-grep": "latest_redirect",
1111
"gh:astral-sh/uv": "latest_redirect",
12-
"gh:aws/aws-cli": "tags_api",
12+
"gh:aws/aws-cli": "atom",
1313
"gh:casey/just": "latest_redirect",
1414
"gh:cli/cli": "latest_redirect",
1515
"gh:composer/composer": "latest_redirect",
1616
"gh:dandavison/delta": "latest_redirect",
1717
"gh:direnv/direnv": "latest_redirect",
18-
"gh:docker/cli": "tags_api",
18+
"gh:docker/cli": "atom",
1919
"gh:docker/compose": "latest_redirect",
20-
"gh:eradman/entr": "tags_api",
20+
"gh:eradman/entr": "atom",
2121
"gh:eslint/eslint": "latest_redirect",
2222
"gh:git-lfs/git-lfs": "latest_redirect",
23-
"gh:git/git": "tags_api",
23+
"gh:git/git": "atom",
2424
"gh:gitleaks/gitleaks": "latest_redirect",
2525
"gh:golang/go": "tags_api",
2626
"gh:golangci/golangci-lint": "latest_redirect",

tools_snapshot.json

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"__meta__": {
33
"count": 70,
4-
"created_at": "2025-10-21T05:50:53Z",
4+
"created_at": "2025-10-21T05:58:11Z",
55
"offline": false,
6-
"partial_failures": 9,
6+
"partial_failures": 0,
77
"schema_version": 1
88
},
99
"tools": [
@@ -114,15 +114,15 @@
114114
},
115115
{
116116
"category": "runtimes",
117-
"classification_reason_selected": "",
118-
"installed": "",
119-
"installed_method": "",
120-
"installed_path_selected": "",
121-
"installed_version": "",
122-
"latest_upstream": "",
123-
"latest_url": "https://github.com/nodejs/node/releases/latest",
124-
"latest_version": "",
125-
"status": "UNKNOWN",
117+
"classification_reason_selected": "path-under-~/.nvm",
118+
"installed": "24.10.0",
119+
"installed_method": "nvm/npm",
120+
"installed_path_selected": "/home/cybot/.nvm/versions/node/v24.10.0/bin/node",
121+
"installed_version": "24.10.0",
122+
"latest_upstream": "25.0.0",
123+
"latest_url": "https://github.com/nodejs/node/releases/tag/v25.0.0",
124+
"latest_version": "25.0.0",
125+
"status": "OUTDATED",
126126
"tool": "node",
127127
"tool_url": "https://github.com/nodejs/node",
128128
"upstream_method": "github"
@@ -249,15 +249,15 @@
249249
},
250250
{
251251
"category": "editors",
252-
"classification_reason_selected": "",
253-
"installed": "",
254-
"installed_method": "",
255-
"installed_path_selected": "",
256-
"installed_version": "",
257-
"latest_upstream": "",
258-
"latest_url": "https://github.com/universal-ctags/ctags/releases/latest",
259-
"latest_version": "",
260-
"status": "UNKNOWN",
252+
"classification_reason_selected": "dpkg-query",
253+
"installed": "5.9.0",
254+
"installed_method": "apt/dpkg",
255+
"installed_path_selected": "/usr/bin/ctags",
256+
"installed_version": "5.9.0",
257+
"latest_upstream": "6.2.0",
258+
"latest_url": "https://github.com/universal-ctags/ctags/releases/tag/v6.2.0",
259+
"latest_version": "6.2.0",
260+
"status": "OUTDATED",
261261
"tool": "ctags",
262262
"tool_url": "https://github.com/universal-ctags/ctags",
263263
"upstream_method": "github"
@@ -399,15 +399,15 @@
399399
},
400400
{
401401
"category": "editors",
402-
"classification_reason_selected": "",
403-
"installed": "",
404-
"installed_method": "",
405-
"installed_path_selected": "",
406-
"installed_version": "",
407-
"latest_upstream": "",
408-
"latest_url": "https://github.com/sharkdp/bat/releases/latest",
409-
"latest_version": "",
410-
"status": "UNKNOWN",
402+
"classification_reason_selected": "path-under-~/.local/bin",
403+
"installed": "0.25.0",
404+
"installed_method": "/home/cybot/.local/bin",
405+
"installed_path_selected": "/home/cybot/.local/bin/bat",
406+
"installed_version": "0.25.0",
407+
"latest_upstream": "0.26.0",
408+
"latest_url": "https://github.com/sharkdp/bat/releases/tag/v0.26.0",
409+
"latest_version": "0.26.0",
410+
"status": "OUTDATED",
411411
"tool": "bat",
412412
"tool_url": "https://github.com/sharkdp/bat",
413413
"upstream_method": "github"
@@ -429,15 +429,15 @@
429429
},
430430
{
431431
"category": "automation",
432-
"classification_reason_selected": "",
433-
"installed": "",
434-
"installed_method": "",
435-
"installed_path_selected": "",
436-
"installed_version": "",
437-
"latest_upstream": "",
438-
"latest_url": "https://github.com/eradman/entr/releases/latest",
439-
"latest_version": "",
440-
"status": "UNKNOWN",
432+
"classification_reason_selected": "dpkg-query",
433+
"installed": "5.5",
434+
"installed_method": "apt/dpkg",
435+
"installed_path_selected": "/usr/bin/entr",
436+
"installed_version": "5.5",
437+
"latest_upstream": "5.7",
438+
"latest_url": "https://github.com/eradman/entr/releases/tag/5.7",
439+
"latest_version": "5.7",
440+
"status": "OUTDATED",
441441
"tool": "entr",
442442
"tool_url": "https://github.com/eradman/entr",
443443
"upstream_method": "github"
@@ -459,15 +459,15 @@
459459
},
460460
{
461461
"category": "other",
462-
"classification_reason_selected": "",
463-
"installed": "",
464-
"installed_method": "",
465-
"installed_path_selected": "",
466-
"installed_version": "",
467-
"latest_upstream": "",
462+
"classification_reason_selected": "dpkg-query",
463+
"installed": "20231122",
464+
"installed_method": "apt/dpkg",
465+
"installed_path_selected": "/usr/bin/parallel",
466+
"installed_version": "20231122",
467+
"latest_upstream": "20250922",
468468
"latest_url": "https://ftp.gnu.org/gnu/parallel/",
469-
"latest_version": "",
470-
"status": "UNKNOWN",
469+
"latest_version": "20250922",
470+
"status": "OUTDATED",
471471
"tool": "parallel",
472472
"tool_url": "https://ftp.gnu.org/gnu/parallel/",
473473
"upstream_method": "gnu-ftp"
@@ -684,15 +684,15 @@
684684
},
685685
{
686686
"category": "git-helpers",
687-
"classification_reason_selected": "",
688-
"installed": "",
689-
"installed_method": "",
690-
"installed_path_selected": "",
691-
"installed_version": "",
692-
"latest_upstream": "",
693-
"latest_url": "https://github.com/arxanas/git-branchless/releases/latest",
694-
"latest_version": "",
695-
"status": "UNKNOWN",
687+
"classification_reason_selected": "path-under-~/.local/bin",
688+
"installed": "0.9.0",
689+
"installed_method": "/home/cybot/.local/bin",
690+
"installed_path_selected": "/home/cybot/.local/bin/git-branchless",
691+
"installed_version": "0.9.0",
692+
"latest_upstream": "0.10.0",
693+
"latest_url": "https://github.com/arxanas/git-branchless/releases/tag/v0.10.0",
694+
"latest_version": "0.10.0",
695+
"status": "OUTDATED",
696696
"tool": "git-branchless",
697697
"tool_url": "https://github.com/arxanas/git-branchless",
698698
"upstream_method": "github"
@@ -894,15 +894,15 @@
894894
},
895895
{
896896
"category": "vcs",
897-
"classification_reason_selected": "",
898-
"installed": "",
899-
"installed_method": "",
900-
"installed_path_selected": "",
901-
"installed_version": "",
902-
"latest_upstream": "",
903-
"latest_url": "https://github.com/git/git/releases/latest",
904-
"latest_version": "",
905-
"status": "UNKNOWN",
897+
"classification_reason_selected": "dpkg-query",
898+
"installed": "2.43.0",
899+
"installed_method": "apt/dpkg",
900+
"installed_path_selected": "/usr/bin/git",
901+
"installed_version": "2.43.0",
902+
"latest_upstream": "2.51.1",
903+
"latest_url": "https://github.com/git/git/releases/tag/v2.51.1",
904+
"latest_version": "2.51.1",
905+
"status": "OUTDATED",
906906
"tool": "git",
907907
"tool_url": "https://github.com/git/git",
908908
"upstream_method": "github"
@@ -1029,30 +1029,30 @@
10291029
},
10301030
{
10311031
"category": "cloud-infra",
1032-
"classification_reason_selected": "",
1033-
"installed": "",
1034-
"installed_method": "",
1035-
"installed_path_selected": "",
1036-
"installed_version": "",
1037-
"latest_upstream": "",
1038-
"latest_url": "https://github.com/docker/cli/releases/latest",
1039-
"latest_version": "",
1040-
"status": "UNKNOWN",
1032+
"classification_reason_selected": "no-match",
1033+
"installed": "28.5.1",
1034+
"installed_method": "unknown",
1035+
"installed_path_selected": "/usr/bin/docker",
1036+
"installed_version": "28.5.1",
1037+
"latest_upstream": "29.0.0",
1038+
"latest_url": "https://github.com/docker/cli/releases/tag/v29.0.0-rc.1",
1039+
"latest_version": "29.0.0",
1040+
"status": "OUTDATED",
10411041
"tool": "docker",
10421042
"tool_url": "https://github.com/docker/cli",
10431043
"upstream_method": "github"
10441044
},
10451045
{
10461046
"category": "cloud-infra",
1047-
"classification_reason_selected": "",
1048-
"installed": "",
1049-
"installed_method": "",
1050-
"installed_path_selected": "",
1051-
"installed_version": "",
1052-
"latest_upstream": "",
1053-
"latest_url": "https://github.com/docker/compose/releases/latest",
1054-
"latest_version": "",
1055-
"status": "UNKNOWN",
1047+
"classification_reason_selected": "docker-info-os",
1048+
"installed": "2.40.0",
1049+
"installed_method": "docker-desktop (WSL)",
1050+
"installed_path_selected": "/usr/bin/docker-compose",
1051+
"installed_version": "2.40.0",
1052+
"latest_upstream": "2.40.1",
1053+
"latest_url": "https://github.com/docker/compose/releases/tag/v2.40.1",
1054+
"latest_version": "2.40.1",
1055+
"status": "OUTDATED",
10561056
"tool": "docker-compose",
10571057
"tool_url": "https://github.com/docker/compose",
10581058
"upstream_method": "github"

0 commit comments

Comments
 (0)