Skip to content

fix(images): bump the toolbox to Node 24 and upgrade npm in place (#2166) - #2168

Merged
Gregory91G merged 2 commits into
mainfrom
fix/toolbox-node24-npm
Aug 5, 2026
Merged

fix(images): bump the toolbox to Node 24 and upgrade npm in place (#2166)#2168
Gregory91G merged 2 commits into
mainfrom
fix/toolbox-node24-npm

Conversation

@Gregory91G

@Gregory91G Gregory91G commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes #2166. Takes insight-toolbox from 24 HIGH to 10.

The fifteen npm findings are not this repository's dependencies — npm bundles its own tree, and
the Node 20 distro package carries npm 10.8.2 against a current 12.0.2. Node 24 brings 11.16.0
and clears most of them; upgrading npm in place clears the rest.

Measured on the real image

docker build -f src/ingestion/tools/toolbox/Dockerfile src/ingestion, then trivy image with
the flags trivy-images.yml uses (--scanners vuln --severity CRITICAL,HIGH --ignore-unfixed):

HIGH+CRITICAL
before — Node 20, npm 10.8.2 24
after — Node 24, npm 12.0.2 10

Cleared: tar ×8, minimatch ×3, glob, cross-spawn, sigstore, and one of the three
brace-expansion.

What remains, and why it cannot move here

golang.org/x/net ×4, golang.org/x/text ×2, stdlib — in usr/local/bin/kubectl and usr/local/bin/yq Both binaries are already the newest upstream release (kubectl v1.36.3 from stable.txt, yq v4.53.3 from releases/latest, both resolved at build time). The fixes need upstream to rebuild against newer Go libraries.
brace-expansion 5.0.7 ×2, ip-address 10.2.0 Still bundled unfixed by npm 12.0.2. Clears when npm ships a build carrying 5.0.9 / 10.3.1.

Test plan

  • Image builds from the repository's own context
  • trivy image, CI flags: 24 → 10
  • Everything the image provides is intact: node v24.18.1, npm 12.0.2,
    kubectl v1.36.3, yq v4.53.3, jq 1.7, envsubst 0.23.1, dbt 1.11.12
  • Still runs as uid=1000(appuser) — the non-root change from fix(images): run the tooling images as a non-root user #2089 is preserved
  • git diff --check clean
  • After merge: trivy-images.yml reports 10 for insight-toolbox on its next nightly run

Summary by CodeRabbit

  • Chores
    • Updated the application build environment to Node.js 24.
    • Upgraded npm to the latest version.
    • Improved image cleanup during the build process.

)

The image scan reports 24 HIGH on insight-toolbox. Fifteen of them are npm's
own bundled dependency tree -- tar, minimatch, glob, cross-spawn, sigstore,
brace-expansion -- carried by the npm 10.8.2 that ships with the Node 20 distro
package. Nothing in this repository depends on those packages; they come with
the interpreter.

Node 24 brings npm 11.16.0, which clears most of it; upgrading npm in place to
12.0.2 clears the rest. Measured on the real image, same flags as
trivy-images.yml:

  Node 20, npm 10.8.2   24 HIGH
  Node 24, npm 11.16.0   6 HIGH   (npm tree only, probe)
  Node 24, npm 12.0.2   10 HIGH   (full image)

What remains: 7 Go CVEs inside the kubectl and yq binaries, which already carry
the newest upstream releases (kubectl v1.36.3, yq v4.53.3) and can only be
fixed by an upstream rebuild; and 3 that npm 12.0.2 still bundles unfixed
(brace-expansion 5.0.7, ip-address 10.2.0).

The image keeps everything it had: node 24.18.1, npm 12.0.2, kubectl v1.36.3,
yq v4.53.3, jq 1.7, envsubst 0.23.1, dbt 1.11.12, and it still runs as uid 1000.

Signed-off-by: Gregory Gogin <grigoriy.gogin@constructor.tech>
@Gregory91G
Gregory91G requested a review from a team as a code owner August 4, 2026 08:04
@Gregory91G Gregory91G self-assigned this Aug 4, 2026
@Gregory91G
Gregory91G requested a review from cyberantonz August 4, 2026 08:04
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ee07e40e-962a-4010-a5ad-7752c3bb8d3c

📥 Commits

Reviewing files that changed from the base of the PR and between 6bd89cc and b303fa1.

📒 Files selected for processing (1)
  • src/ingestion/tools/toolbox/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/ingestion/tools/toolbox/Dockerfile

📝 Walkthrough

Walkthrough

The toolbox Dockerfile now uses Node.js 24, upgrades npm globally, cleans the npm cache, and retains package-list cleanup during image construction.

Changes

Toolbox runtime

Layer / File(s) Summary
Update Node.js and npm image setup
src/ingestion/tools/toolbox/Dockerfile
The image setup changes from Node.js 20 to 24, upgrades npm globally, and cleans the npm cache.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • constructorfabric/insight#2014 — This issue also concerns the toolbox Dockerfile Node.js runtime update.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Node.js 24 and npm upgrade made in the Dockerfile.
Linked Issues check ✅ Passed The changes address issue #2166 by moving to Node.js 24, upgrading npm, and preserving the toolbox image configuration.
Out of Scope Changes check ✅ Passed The Dockerfile changes are limited to the requested Node.js and npm upgrades and related cache cleanup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/toolbox-node24-npm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/ingestion/tools/toolbox/Dockerfile`:
- Line 13: Update the Dockerfile’s global npm installation command to pin npm to
exactly version 12.0.2 instead of latest, then add a verification step that
asserts the installed npm version matches 12.0.2.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5792c19a-29c0-422b-b19a-ddcd722f1fdc

📥 Commits

Reviewing files that changed from the base of the PR and between 98bd0c5 and f6e53bd.

📒 Files selected for processing (1)
  • src/ingestion/tools/toolbox/Dockerfile

# tree is what the image scan reports.
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g npm@latest && \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="src/ingestion/tools/toolbox/Dockerfile"

if rg -nF 'npm install -g npm@latest' "$file"; then
  echo "Floating npm tag is still present" >&2
  exit 1
fi

rg -nF 'npm install -g npm@12.0.2' "$file"

Repository: constructorfabric/insight

Length of output: 235


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="src/ingestion/tools/toolbox/Dockerfile"

echo "== Dockerfile snippet =="
cat -n "$file" | sed -n '1,80p'

echo
echo "== npm version references relevant to toolbox or PR context =="
rg -n "npm(@|[: ]|version|12\.0\.2|latest)" . --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' | sed -n '1,120p'

Repository: constructorfabric/insight

Length of output: 3807


Pin npm to npm@12.0.2.

The Dockerfile comment says the bundled npm dependency tree is important for image scans, but line 13 installs the mutable latest tag. Use an exact npm version and assert the installed version after install.

Proposed fix
-    npm install -g npm@latest && \
+    npm install -g npm@12.0.2 && \
+    test "$(npm --version)" = "12.0.2" && \
     npm cache clean --force && \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ingestion/tools/toolbox/Dockerfile` at line 13, Update the Dockerfile’s
global npm installation command to pin npm to exactly version 12.0.2 instead of
latest, then add a verification step that asserts the installed npm version
matches 12.0.2.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🤖 connectors-ddl snapshot drift

The committed snapshot does not match what this branch actually produces. The regenerated snapshot is waiting in #2169 — review the DDL diff there and merge it into this branch; the gate re-runs on your merge.

Refreshed on every drifting gate run (the regen branch is force-pushed), so it reflects this branch as of the last completed run.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@Gregory91G
Gregory91G enabled auto-merge August 5, 2026 09:46
@Gregory91G
Gregory91G added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 5290fb8 Aug 5, 2026
45 checks passed
@Gregory91G
Gregory91G deleted the fix/toolbox-node24-npm branch August 5, 2026 10:35
cyberantonz pushed a commit to cyberantonz/insight that referenced this pull request Aug 6, 2026
…ructorfabric#2018)

Two gates, both on CRITICAL with --ignore-unfixed, matching what the issue
asks for.

Publish side: a new composite action scans the push-by-digest blobs in each
merge job, before docker/metadata-action's tags are applied. A rejected build
therefore keeps no build tag and does not move :latest, so no descriptor bump
and no chart can reference it. It covers the seven jobs that produce the
fourteen images the nightly scans; insight-ui-tests stays out, as it is out of
that matrix.

Drift side: trivy-images.yml gets a verdict step. It runs last and reads the
JSON the scan already wrote, so the job summary and the SARIF upload still
happen for a failing image -- putting --exit-code 1 on the scan itself would
abort before `trivy convert` and lose both.

Gating on Trivy's own severity rather than on the Code Scanning level is
deliberate: GitHub derives its level from the CVSS score, so CVE-2026-59873
(constructorfabric#2014) was CRITICAL for Trivy and high in the Security tab. Note that
`--severity` is undocumented on `trivy convert` yet honoured, which is one
more reason the image stays pinned by digest.

Baseline measured before enabling: insight-toolbox 0 critical after constructorfabric#2168,
insight-gateway, insight-front and source-salesforce-insight also 0.

Signed-off-by: Gregory Gogin <grigoriy.gogin@constructor.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

insight-toolbox carries 24 HIGH, most of them npm's bundled tree on Node 20

3 participants