fix(cli): ship db/ in wheels-base-template by whitelisting db/.keep#3188
fix(cli): ship db/ in wheels-base-template by whitelisting db/.keep#3188wheels-bot[bot] wants to merge 1 commit into
Conversation
The published wheels-base-template zip omitted the conventional db/ directory because tools/build/base/.gitignore carried a /db/** rule and CommandBox package publish honors .gitignore, silently stripping db/.keep. SQLite/H2 file paths under db/ then failed without a manual mkdir. Whitelist !/db/.keep so the directory marker ships while end-user db files stay ignored, and add a structural guard spec pinning the ignore file. A paired presence assertion in release.yml's Validate Package Structure step is deferred to a human follow-up: the wheels-bot GitHub App token cannot push .github/workflows changes without the workflows permission. Refs #3174 Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Wheels Bot — No doc updatesReviewed this PR's diff and found no docs that need updating (purely internal build/packaging bug fix — restores the |
There was a problem hiding this comment.
Wheels Bot — Reviewer
TL;DR: This PR fixes the #3174 root cause — the published wheels-base-template zip lost its db/ directory because tools/build/base/.gitignore's /db/** rule stripped db/.keep at publish time — by whitelisting !/db/.keep, pinned by a new structural guard spec plus a changelog fragment. The fix is correct as far as it can be verified from source, the spec follows the suite's established structural-guard patterns, and the commit is clean. Verdict: comment — two minor, non-blocking test-robustness notes below; nothing blocks merge.
What was verified
- gitignore semantics are right. Per the gitignore documentation, a trailing
/**matches everything inside a directory but not the directory itself, so the re-include restriction ("it is not possible to re-include a file if a parent directory of that file is excluded") does not apply:/db/**+!/db/.keepis the canonical keep-an-empty-directory pattern. The PR also correctly rejected the drop-/db/**alternative, which would un-ignore end users' SQLite files. - Root-cause chain checks out.
tools/build/scripts/prepare-base.sh:34is indeedcp -r db "${BUILD_DIR}/",db/.keepis tracked at the repo root, and line 60 copiestools/build/base/.gitignoreinto the build dir as the package.gitignore— matching the issue's analysis. - Spec follows suite prior art.
expandPath("/wheels/../..")+ describe-bodyvar+fileRead/regex mirrorsbuildArtifactLicenseSpec.cfc:22andLinuxPackageStagingSpec.cfc:33. Cross-engine regex portability is established:(?m)is used inRateLimiterMemoryStoreSpec.cfc:95and POSIX[[:space:]]inLinuxPackageStagingSpec.cfc:184-188(which documents the BoxLang/Java translation) — both green across the CI matrix. #escaping is correct. The failure message usesissue ##3174inside the string literal (the unescaped-#-crashes-the-suite gotcha from CLAUDE.md § Test-specific gotchas); bare#3174appears only in//comments, which is safe.- Changelog fragment
changelog.d/3174-base-template-db-directory.fixed.mduses a valid type and avoids a directCHANGELOG.mdedit.
Tests
-
Guard scope gap (minor): the spec only protects the exact
/db/**form.vendor/wheels/tests/specs/cli/BaseTemplateDbDirectoryShipsSpec.cfc:47-51:var ignoresDb = reFindNoCase("(?m)^[[:space:]]*/db/\*\*[[:space:]]*$", src) > 0; ... expect(!ignoresDb || reIncludesKeep).toBeTrue(If a future edit rewrites the rule as
/db/(the directory form — exactly what the repo-root.gitignore:29uses) or unanchoreddb/**,ignoresDbisfalse, the!ignoresDb || reIncludesKeepexpression short-circuits true, and the spec passes — but!/db/.keepcannot re-include through a/db/directory exclusion (gitignore: re-inclusion is impossible when a parent directory is excluded), so the artifact would silently losedb/again. Suggested hardening: detect any db-ignore form, e.g.reFindNoCase("(?m)^[[:space:]]*/?db/", src), and fail outright when the directory form (/db/with no**) is present, since no whitelist can rescue it. Non-blocking — the guard is correct for the file as it stands today. -
Effectiveness at publish time is unproven by this spec (acknowledged in the PR, non-blocking). The spec is structural — it pins the ignore file's contents, not the published artifact. Whether CommandBox's
package publishignore matcher honors!negation can only be conclusively confirmed at the next publish. The PR's deferred follow-up (adb/presence assertion inrelease.yml's "Validate Package Structure" step, blocked on the bot token's missingworkflowspermission) is the real end-to-end guard — recommend a maintainer pick that up before the next release cut so a silent negation no-op surfaces at publish time rather than via user reports.
Commits
No findings — single commit, valid conventional header (fix(cli): …, 68 chars), body explains the why, Signed-off-by matches the author identity, and Refs (not Fixes) is correctly used so the merge doesn't auto-close #3174 while the workflow hardening is pending.
|
Superseded by #3196 (merged): a propose-fix draft that raced the ForgeBox path-repair campaign for the same issue; the campaign PR landed first and closed the underlying issue. Closing the duplicate. |
Summary
The published
wheels-base-templatezip shipped without the conventionaldb/directory, so SQLite/H2 file paths underdb/failed without a manualmkdir. Root cause:tools/build/base/.gitignore(copied into the build dir as the package.gitignorebyprepare-base.sh) carried a/db/**rule, and CommandBoxpackage publishhonors.gitignore— sodb/.keepwas silently stripped from the artifact even thoughprepare-base.sh:34copiesdb/in.This whitelists
!/db/.keepin that ignore file so the directory marker ships while end-user db files stay ignored. The drop-/db/**-entirely alternative would un-ignore users' SQLite files — the whitelist re-includes only the keep file, so no unwanted files re-enter the package. A new structural guard spec pins the ignore file against regression.Related Issue
Refs #3174
Type of Change
Feature Completeness Checklist
Signed-off-by:vendor/wheels/tests/specs/cli/BaseTemplateDbDirectoryShipsSpec.cfc(failing → passing)bot-update-docs.ymlbot-update-docs.ymlbot-update-docs.ymlchangelog.d/3174-base-template-db-directory.fixed.mdTest Plan
The fix touches build/packaging source (
.gitignore) and a pure-structural CFML guard spec (fileRead+ regex, no DB/server). The spec asserts:db/.keepexists forprepare-base.shto copy.tools/build/base/.gitignoredoes not stripdb/.keep— if/db/**is present,!/db/.keepmust follow.Fail→pass verified by source analysis: pre-fix, assertion (2) failed (
.gitignorewas exactly/vendor/*/+/db/**, no re-include); post-fix the!/db/.keepline is present and matches the spec's anchored regex.Note on local execution: the server-backed
bash tools/test-local.sh clirunner could not execute in the bot sandbox — thewheelsbinary is not installed (only the unbrandedlucliruntime, which is permission-blocked per the bot rails). CI runs the full suite across every engine × DB on this PR for the authoritative signal. The spec is purely structural (no datasource/server dependency), so its logic was verified directly against source.Screenshots / Output
n/a