Skip to content

fix(tooling): handle missing node in generate_key_fold.py - #990

Merged
yakew7 merged 1 commit into
yakew7:mainfrom
Enard52:fix/generate-key-fold-missing-node-982
Oct 14, 2026
Merged

yakew7 merged 1 commit into
yakew7:mainfrom
Enard52:fix/generate-key-fold-missing-node-982

Conversation

@Enard52

@Enard52 Enard52 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Gracefully skips scripts/generate_key_fold.py --check when Node is missing unless --require is passed, avoiding tracebacks on environments without Node installed.

Type

  • Audit
  • Explainer
  • Bug fix
  • Other (tooling / CI)

Linked issue

Closes #982

Details

  • scripts/generate_key_fold.py:
    • In --check mode, checks if shutil.which("node") is available. If missing, prints node is needed for this check (install Node 18+); skipping and exits 0 (or 2 if --require is passed).
    • Added --require flag to enforce hard failure in CI where Node is guaranteed to be set up.
    • Retains failure in table rewrite mode (calling subprocess.run(["node", ...]) without --check continues to raise FileNotFoundError).
  • .github/workflows/audits.yml:
    • Updated profiler workflow step to pass python scripts/generate_key_fold.py --check --require to preserve strict CI verification.
  • tests/test_generate_key_fold.py:
    • Replaced module-level skip with @needs_node decorator for tests that explicitly require Node execution.
    • Added tests for --check with cleared PATH (exiting 0), --check --require with cleared PATH (exiting 2), and rewrite mode with cleared PATH (raising error).

Fixes yakew7#982

- Skip --check mode with exit 0 and notification when node is missing
- Add --require flag to enforce failure when node is missing
- Pass --require in CI key-normalisation workflow step
- Keep failure in table rewrite mode
- Add unit tests for missing node and per-test skip for node requirements
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@Enard52 is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

@yakew7 @ahmdkaml @propcgamer20-png - new PR touching a path you own, please review.

@github-actions

Copy link
Copy Markdown

Hey @Enard52, your first PR on Fair Code, that's awesome, thank you.

This project is about making AI more accountable, and contributions like yours are what keep that work going. We'll review your changes shortly.

If you haven't already, give the contributing guide a quick read: it covers how audits are structured and what we look for in a review.

And if you're finding Fair Code useful or interesting, a star on the repo genuinely helps more people find it - no pressure, just appreciated.

@yakew7
yakew7 merged commit f0cca68 into yakew7:main Oct 14, 2026
17 of 19 checks passed
yakew7 added a commit that referenced this pull request Oct 15, 2026
…enth sweep

Adds the twelfth-wave changelog entries for the 19 closed issues, marks them done on the roadmap and lists the 19 new follow-ups (#992-#1010), adds Enard52 to the contributors file (#990, #991), and refreshes traction (forks 57, 86 issues closed this week).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generate_key_fold.py fails with a traceback when node is not installed

2 participants