Skip to content

refactor: simplify Node installation guidance - #60

Open
mldangelo-oai wants to merge 12 commits into
mainfrom
mdangelo/codex/python-wrapper-help-pr
Open

mldangelo-oai wants to merge 12 commits into
mainfrom
mdangelo/codex/python-wrapper-help-pr

Conversation

@mldangelo-oai

Copy link
Copy Markdown
Contributor

What changed

  • Replace repeated installation recipes and environment probes with a shorter missing-Node guide for the platform and deployment context. Kubernetes now selects the same container guidance as Docker.
  • Keep the Alpine Dockerfile, preserve the application, CPU architecture, and Python base in the Debian Bookworm and Trixie examples, install Node 24 with apt so it cannot be overwritten by a later package install, respect custom writable npm prefixes separate from Python, and fix Ubuntu Docker layering. Amazon Linux 2 users are directed to a compatible base; Amazon Linux 2023 guidance names the snapshot that first supplied Node 24. Windows verification works under restricted PowerShell and Git Bash, with a separate command for managers that ship npx.exe.
  • Distinguish local function development from hosted AWS, Google, and Azure deployments. Explain hosting plans that require migration, and avoid suggesting package installs in a running managed function. Preserve generic guidance for common CI providers.
  • Replace the duplicate, contradictory release FAQ with a link to the existing versioning policy.

Verification

  • pytest -q -m 'not smoke': 195 passed, 10 platform skips, 24 deselected on macOS.
  • Source and changed-test Ruff checks, mypy, pyright, and actionlint passed.
  • All five Dockerfiles were generated locally and their workflow shell and emitted commands validated. An isolated local npm install verified default and custom prefixes, an offline reinstall, and the updated npm/npx launchers. GitHub's Linux Docker check builds Alpine and both Debian images, checks custom prefixes set by environment or .npmrc, and verifies apt keeps Node 24. New Windows matrix tests execute the printed commands under restricted Windows PowerShell and Git Bash, including a native .exe alternative. Neither a local Docker daemon nor native Windows was available.

@mldangelo-oai
mldangelo-oai requested a lite review from Copilot September 18, 2026 21:58
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-18T22:01:50.622091Z 2c329b5 Manual request
🔒 Security Review Completed 2026-09-18T22:01:15.114318Z 2c329b5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment on lines +59 to +61
"Keep an existing writable npm prefix only if its bin is separate from Python's scripts directory. "
"If its bin is missing from PATH, add it before /usr/bin "
"and after your Python scripts (for example /opt/venv/bin or /usr/local/bin).",
Comment on lines +62 to +64
"If an inherited NPM_CONFIG_PREFIX points to an unwritable directory, change it in the Dockerfile "
"(for example `ENV NPM_CONFIG_PREFIX=/home/app/.npm-global`). Without that override, a non-root user "
"can run `npm config set prefix ~/.npm-global`. Add the writable bin to PATH in either case.",
Comment on lines +77 to +78
" RUN dnf --releasever=latest install -y nodejs24 nodejs24-npm "
"&& /usr/sbin/alternatives --set node /usr/bin/node-24 && dnf clean all",
Comment on lines +79 to +80
"Node 24 requires repository release 2023.9.20251110 or newer; replace latest with your approved recent "
"snapshot, or update an older base image before installing.",
Comment on lines +112 to +113
"If your pinned repository is older than 2023.9.20251110, update the base/repository or install from a "
"newer approved snapshot: sudo dnf --releasever=latest install -y nodejs24 nodejs24-npm",
Comment on lines +149 to +150
"If you choose a container image instead, create a new image-based function "
"and install Node at build time.",

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Serverless guidance still includes misleading runtime installation instructions.

Review effort: Lite
Findings: None

What changed in this PR

Refactors Node.js installation guidance to be shorter and deployment-aware across platforms, containers, serverless environments, CI, and Windows.

Changes:

  • Simplifies environment detection and installation instructions.
  • Adds Kubernetes, Docker, distribution-specific, serverless, and Windows guidance.
  • Expands Docker and platform validation tests.
  • Replaces the duplicate release FAQ with the versioning policy link.
File Description
tests/​test_instructions.py Updated instruction coverage.
tests/​test_environment.py Updated environment detection tests.
tests/​smoke/​test_installation.py Added Windows command smoke tests.
src/​promptfoo/​instructions.py Generates contextual Node.js guidance.
src/​promptfoo/​environment.py Simplifies environment detection.
AGENTS.md Consolidates release FAQ guidance.
.github/​workflows/​test.yml Validates generated Dockerfiles.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2c329b52a7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2c329b52a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants