Skip to content

fix(docker): include DuckDB extension installer script in runtime image#1502

Merged
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
uwence:fix/docker-include-duckdb-installer
May 11, 2026
Merged

fix(docker): include DuckDB extension installer script in runtime image#1502
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
uwence:fix/docker-include-duckdb-installer

Conversation

@uwence

@uwence uwence commented May 11, 2026

Copy link
Copy Markdown
Contributor

Title: fix(docker): include DuckDB extension installer script in runtime image

What

  • Include gitnexus/scripts/install-duckdb-extension.mjs in Docker runtime image.

Why

  • Runtime code in gitnexus/src/core/lbug/extension-loader.ts executes this script when trying to install optional DuckDB extensions (FTS path).
  • Current runtime image omits scripts, causing:
    Cannot find module '/app/gitnexus/scripts/install-duckdb-extension.mjs'

Patch

diff --git a/Dockerfile.cli b/Dockerfile.cli
@@
 COPY --from=builder --chown=node:node /app/gitnexus/dist ./gitnexus/dist
 COPY --from=builder --chown=node:node /app/gitnexus/node_modules ./gitnexus/node_modules
 COPY --from=builder --chown=node:node /app/gitnexus/package.json ./gitnexus/package.json
 COPY --from=builder --chown=node:node /app/gitnexus/vendor ./gitnexus/vendor
+COPY --from=builder --chown=node:node /app/gitnexus/scripts/install-duckdb-extension.mjs ./gitnexus/scripts/install-duckdb-extension.mjs

Validation

  • Build runtime image from this branch.
  • Run:
    node gitnexus/dist/cli/index.js analyze /repo
  • Confirm no MODULE_NOT_FOUND for install-duckdb-extension.mjs.

Notes

  • This keeps image change minimal while preserving current extension-loader behavior.

Copilot AI review requested due to automatic review settings May 11, 2026 09:31
@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

@uwence is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

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.

Pull request overview

Fixes the CLI runtime Docker image so optional DuckDB extension installation (used by LadybugDB/FTS paths) can execute its bundled installer script without failing with MODULE_NOT_FOUND.

Changes:

  • Copy gitnexus/scripts/install-duckdb-extension.mjs from the builder stage into the runtime stage in Dockerfile.cli.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@magyargergo

Copy link
Copy Markdown
Collaborator

Nice find! 🚀

@magyargergo magyargergo self-assigned this May 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
8672 8671 0 1 399s

✅ All 8671 tests passed

1 test(s) skipped — expand for details
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 77.96% 25730/33004 N/A% 🟢 ███████████████░░░░░
Branches 66.47% 16265/24468 N/A% 🟢 █████████████░░░░░░░
Functions 83.14% 2590/3115 N/A% 🟢 ████████████████░░░░
Lines 81.01% 23259/28710 N/A% 🟢 ████████████████░░░░

📋 View full run · Generated by CI

@magyargergo magyargergo merged commit a3af0dc into abhigyanpatwari:main May 11, 2026
38 of 40 checks passed
RoJLD added a commit to RoJLD/GitNexus that referenced this pull request May 26, 2026
Phase 2 du plan CI/CD (cf docs/superpowers/specs/2026-05-26-cicd-test-pyramid-design.md).
Skip Phase 1 complète (test pyramid bloquée par Node 21 + vitest 4 issue, cf
docs/superpowers/decisions/2026-05-26-defer-node22-upgrade.md). Filet de
régression actuel = smoke loop manuel (canonical curl per CLAUDE.md gitnexus).

=== Conflits résolus ===

4 conflits hard exactement comme prédit par le spec :

1. **Dockerfile.web** — v1.6.5 a migré `alpine` → `bookworm-slim` (apt au
   lieu d'apk, suppression de npm/corepack en runtime). Nos patches
   ré-écrites en syntaxe apt : ajout zip/unzip/git, ajout `git config
   safe.directory '*'`, +14 lignes COPY docker-server-*.mjs, switch
   `npm ci` → `npm install --no-audit --no-fund` (lockfile flexible).

2. **docker-server.mjs** — v1.6.5 a été réécrit pour conformité CodeQL
   (inline path-relative containment au lieu d'helpers). Merge manuel
   complet : conservation de la pipeline statique CodeQL + injection de
   nos 14 routes (export, import, listdir, analytics) en amont du
   serving statique. Imports fusionnés (basename/dirname/extname/join/
   normalize/relative/resolve/sep/isAbsolute), Promise resolve renommé en
   resolveProm pour éviter conflit avec path.resolve.

3. **gitnexus-web/package.json** — versions v1.6.5 bumpées (react 18→19,
   etc.) → nos 3 deps additionnelles (react-force-graph-3d, three,
   @types/three) ré-insérées au bon endroit positionnel.

4. **gitnexus-web/package-lock.json** — non mergé manuellement. Le
   Dockerfile.web utilise désormais `npm install` (pas `npm ci`), donc
   le lockfile est régénéré au build.

=== Régressions révélées par le build ===

Vite/rolldown en v1.6.5 est plus strict sur la résolution des deps
transitives. `react-force-graph-3d` → `3d-force-graph` →
`three-render-objects` a des deps non-déclarées en peer mais nécessaires
au bundling. Ajoutées en deps directes :
  - polished
  - accessor-fn
  - float-tooltip
  - kapsule

=== Simplifications gagnées ===

Bug upstream abhigyanpatwari#1502 (`install-duckdb-extension.mjs` manquant du runtime
stage de gitnexus/Dockerfile.cli) **fixé en v1.6.5**. Conséquences :
  - Suppression de `scripts/install-duckdb-extension.mjs` vendoré
  - Suppression de la ligne COPY correspondante dans notre Dockerfile.cli
  - Mise à jour du commentaire header (3 bugs → 2 bugs upstream restants)

Le bug "stale lbug connection in REST adapter" reste présent en v1.6.5.
`scripts/patch-lbug-staleness.mjs` (self-validating) s'applique sans
erreur, confirmant que la shape de `ensureLbugInitialized` n'a pas
changé en v1.6.5. Patch conservé.

=== Fix du script apply-upstream-patches.mjs ===

Bug identifié pendant le bump : le `git apply` était lancé avec
`cwd: UPSTREAM` mais le chemin `patches/upstream-all.diff` est résolu
relativement à UPSTREAM, où il n'existe pas. Fix : `../patches/...`.

Aussi : retrait du `--depth 50` du clone pour avoir l'historique complet
nécessaire au `git apply --3way` (sinon fallback en direct apply qui
échoue sur les fichiers divergés). Et défaut GITNEXUS_VERSION bumpé à
v1.6.5.

=== Vérification smoke ===

docker compose build → ✅ les deux images (gitnexus-derived:1.6.5-patched
+ gitnexus-web-derived:1.6.5-patched).
docker compose up -d → ✅ containers recréés avec nouvelles images.

Smoke loop sur tous les endpoints (port 4173) avec hmm_studio :
  listdir, snapshots, churn, coupling, growth, lifespan, entropy,
  ownership, semantic-labels → HTTP 200
  dissonance → HTTP 404 (attendu : pas de .gitnexus-domains.json)
  coupling/cross, growth/cross, similarity → HTTP 200 avec
  ?repos=hmm_studio,Experiment.Crypto.2026S1.RobinDenis

API server (port 4747) /api/repos → HTTP 200, 4 repos listés.

=== Distance upstream ===

Avant : v1.6.3, +275 commits behind main.
Après : v1.6.5, +64 commits behind main.

Prochain bump (v1.6.6) sera plus simple grâce au script corrigé.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

3 participants