Repository navigation
fix(helm,docs): use ncps migrate up, drop dbmate - #1234
Conversation
63b68d0 to
c4390fb
Compare
3c4ec51 to
c07f76f
Compare
c4390fb to
ebd2188
Compare
c07f76f to
e5e314f
Compare
ebd2188 to
bfedca2
Compare
e5e314f to
4c76679
Compare
bfedca2 to
647bfe2
Compare
4c76679 to
f8ce520
Compare
647bfe2 to
ad4a7a1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
charts/ncps/tests/migration_test.yaml (1)
117-139: ⚡ Quick winAdd StatefulSet env contract assertions to this suite.
This case checks command/args but not the env rename contract. Add
CACHE_DATABASE_URLpresence andDATABASE_URLabsence assertions for the StatefulSet migration initContainer.Proposed test addition
- it: statefulset migration initContainer invokes ncps migrate up template: statefulset.yaml set: mode: statefulset config.hostname: test.example.com config.storage.type: s3 config.storage.s3.bucket: b config.storage.s3.endpoint: https://s3.amazonaws.com config.storage.s3.accessKeyId: k config.storage.s3.secretAccessKey: s migration.enabled: true migration.mode: initContainer asserts: - equal: path: spec.template.spec.initContainers[?(@.name=="migration")].command value: - /bin/ncps - equal: path: spec.template.spec.initContainers[?(@.name=="migration")].args value: - migrate - up + - contains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: CACHE_DATABASE_URL + - notContains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: DATABASE_URL🤖 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 `@charts/ncps/tests/migration_test.yaml` around lines 117 - 139, Add assertions to the StatefulSet migration test that verify the initContainer named "migration" exposes the renamed environment variable: assert that spec.template.spec.initContainers[?(@.name=="migration")].env contains an entry with name "CACHE_DATABASE_URL" (and appropriate value or presence) and assert that there is no entry with name "DATABASE_URL" for the same initContainer; update the test case titled "statefulset migration initContainer invokes ncps migrate up" to include these two checks using the same JSONPath pattern used for command/args.
🤖 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 `@docs/docs/Developer` Guide/Contributing.md:
- Around line 149-151: The fenced command blocks in this document are missing
language identifiers (triggering markdownlint MD040); update each affected code
fence that contains shell/CLI commands (e.g., the blocks with "task
migrations:gen NAME=descriptive_snake_case", the blocks containing the various
"ncps migrate up --cache-database-url=..." examples, the "ncps migrate up
--cache-database-url=sqlite:./test.db" block, and the block with "go generate
./ent/..." / "go run ./cmd/ent-lint --root .") to use a shell language tag (add
```sh at the opening fence) so all those fenced code blocks include the language
identifier.
---
Nitpick comments:
In `@charts/ncps/tests/migration_test.yaml`:
- Around line 117-139: Add assertions to the StatefulSet migration test that
verify the initContainer named "migration" exposes the renamed environment
variable: assert that
spec.template.spec.initContainers[?(@.name=="migration")].env contains an entry
with name "CACHE_DATABASE_URL" (and appropriate value or presence) and assert
that there is no entry with name "DATABASE_URL" for the same initContainer;
update the test case titled "statefulset migration initContainer invokes ncps
migrate up" to include these two checks using the same JSONPath pattern used for
command/args.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a5654aec-f823-4705-828b-340229a2fc9b
📒 Files selected for processing (25)
charts/ncps/templates/_helpers.tplcharts/ncps/templates/deployment.yamlcharts/ncps/templates/migration-job.yamlcharts/ncps/templates/statefulset.yamlcharts/ncps/tests/migration_test.yamldocs/docs/Developer Guide.mddocs/docs/Developer Guide/Contributing.mddocs/docs/Developer Guide/Testing.mddocs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.mddocs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.mddocs/docs/User Guide/Configuration/Database/SQLite Configuration.mddocs/docs/User Guide/Getting Started/Quick Start.mddocs/docs/User Guide/Installation/Docker Compose.mddocs/docs/User Guide/Installation/Docker.mddocs/docs/User Guide/Installation/Helm Chart.mddocs/docs/User Guide/Installation/Kubernetes.mddocs/docs/User Guide/Installation/NixOS.mddocs/docs/User Guide/Operations/Troubleshooting.mddocs/docs/User Guide/Operations/Upgrading.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yamlopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.mdopenspec/specs/database-migrations/spec.md
|
Automated stack merge failed during the rebase step. The |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/docs/Developer Guide/Contributing.md (1)
149-151:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd language identifiers to fenced command blocks.
These command fences still miss language tags (
sh), which keeps triggering markdownlint MD040.Suggested patch
- ``` + ```sh task migrations:gen NAME=descriptive_snake_case ``` -``` +```sh ncps migrate up --cache-database-url=sqlite:/path/to/db.sqlite ncps migrate up --cache-database-url=postgresql://user:pass@host:port/db ncps migrate up --cache-database-url=mysql://user:pass@host:port/db # Preview without touching the DB: ncps migrate up --cache-database-url=... --dry-run
task migrations:gen NAME=descriptive_snake_case
ncps migrate up --cache-database-url=sqlite:./test.db --dry-run ncps migrate up --cache-database-url=sqlite:./test.db-
+sh
go generate ./ent/... # or: task ent:generate
go run ./cmd/ent-lint --root . # or: task ent:lintAlso applies to: 159-165, 632-634, 640-643, 651-654
🤖 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 `@docs/docs/Developer` Guide/Contributing.md around lines 149 - 151, Update the fenced code blocks that contain shell/command examples (e.g., the blocks with "task migrations:gen NAME=descriptive_snake_case", "ncps migrate up --cache-database-url=...", "go generate ./ent/..." and "go run ./cmd/ent-lint --root .") by adding the language identifier "sh" after the opening triple backticks (i.e., change ``` to ```sh) for each affected block (the ones around the shown command snippets and the other blocks noted in the comment ranges) so markdownlint MD040 no longer flags them.
🧹 Nitpick comments (1)
charts/ncps/tests/migration_test.yaml (1)
10-138: ⚡ Quick winConsider adding test coverage for missing env variable assertions.
The test suite comprehensively covers command/args across all three templates but has gaps in env variable coverage:
- Missing: deployment initContainer with postgres env
- Missing: statefulset initContainer with sqlite env
- Missing: statefulset initContainer with postgres env
- Minor: postgres tests verify
CACHE_DATABASE_URLpresence but don't assertDATABASE_URLabsence (sqlite tests do both)Adding these cases would provide complete contract coverage across all templates and database backends.
🧪 Suggested additional test cases
- it: deployment migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres) template: deployment.yaml set: mode: deployment config.hostname: test.example.com config.database.type: postgresql config.database.postgresql.host: pg config.database.postgresql.password: pw migration.enabled: true migration.mode: initContainer asserts: - contains: path: spec.template.spec.initContainers[?(@.name=="migration")].env content: name: CACHE_DATABASE_URL valueFrom: secretKeyRef: name: RELEASE-NAME-ncps key: database-url - it: statefulset migration initContainer env uses CACHE_DATABASE_URL (sqlite) template: statefulset.yaml set: mode: statefulset config.hostname: test.example.com config.database.type: sqlite migration.enabled: true migration.mode: initContainer asserts: - contains: path: spec.template.spec.initContainers[?(@.name=="migration")].env content: name: CACHE_DATABASE_URL value: "sqlite:/storage/db/ncps.db" - notContains: path: spec.template.spec.initContainers[?(@.name=="migration")].env content: name: DATABASE_URL - it: statefulset migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres) template: statefulset.yaml set: mode: statefulset config.hostname: test.example.com config.database.type: postgresql config.database.postgresql.host: pg config.database.postgresql.password: pw migration.enabled: true migration.mode: initContainer asserts: - contains: path: spec.template.spec.initContainers[?(@.name=="migration")].env content: name: CACHE_DATABASE_URL valueFrom: secretKeyRef: name: RELEASE-NAME-ncps key: database-url🤖 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 `@charts/ncps/tests/migration_test.yaml` around lines 10 - 138, The test suite is missing assertions for migration initContainer envs across some template+DB combinations; add three new test cases mirroring existing patterns: (1) "deployment migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres)" for template deployment.yaml with config.database.type: postgresql and assert spec.template.spec.initContainers[?(@.name=="migration")].env contains CACHE_DATABASE_URL valueFrom.secretKeyRef (name: RELEASE-NAME-ncps, key: database-url), (2) "statefulset migration initContainer env uses CACHE_DATABASE_URL (sqlite)" for template statefulset.yaml with config.database.type: sqlite asserting CACHE_DATABASE_URL value "sqlite:/storage/db/ncps.db" and notContains DATABASE_URL, and (3) "statefulset migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres)" for template statefulset.yaml with postgresql asserting the same secretKeyRef presence; also ensure postgres-related tests include notContains assertions for DATABASE_URL where sqlite tests already do.
🤖 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.
Duplicate comments:
In `@docs/docs/Developer` Guide/Contributing.md:
- Around line 149-151: Update the fenced code blocks that contain shell/command
examples (e.g., the blocks with "task migrations:gen
NAME=descriptive_snake_case", "ncps migrate up --cache-database-url=...", "go
generate ./ent/..." and "go run ./cmd/ent-lint --root .") by adding the language
identifier "sh" after the opening triple backticks (i.e., change ``` to ```sh)
for each affected block (the ones around the shown command snippets and the
other blocks noted in the comment ranges) so markdownlint MD040 no longer flags
them.
---
Nitpick comments:
In `@charts/ncps/tests/migration_test.yaml`:
- Around line 10-138: The test suite is missing assertions for migration
initContainer envs across some template+DB combinations; add three new test
cases mirroring existing patterns: (1) "deployment migration initContainer env
uses CACHE_DATABASE_URL with secretKeyRef (postgres)" for template
deployment.yaml with config.database.type: postgresql and assert
spec.template.spec.initContainers[?(@.name=="migration")].env contains
CACHE_DATABASE_URL valueFrom.secretKeyRef (name: RELEASE-NAME-ncps, key:
database-url), (2) "statefulset migration initContainer env uses
CACHE_DATABASE_URL (sqlite)" for template statefulset.yaml with
config.database.type: sqlite asserting CACHE_DATABASE_URL value
"sqlite:/storage/db/ncps.db" and notContains DATABASE_URL, and (3) "statefulset
migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef
(postgres)" for template statefulset.yaml with postgresql asserting the same
secretKeyRef presence; also ensure postgres-related tests include notContains
assertions for DATABASE_URL where sqlite tests already do.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 346dfeac-73bc-4481-b5b4-a8d0ce2f9705
📒 Files selected for processing (26)
charts/ncps/templates/_helpers.tplcharts/ncps/templates/deployment.yamlcharts/ncps/templates/migration-job.yamlcharts/ncps/templates/statefulset.yamlcharts/ncps/tests/migration_test.yamldocs/docs/Developer Guide.mddocs/docs/Developer Guide/Contributing.mddocs/docs/Developer Guide/Testing.mddocs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.mddocs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.mddocs/docs/User Guide/Configuration/Database/SQLite Configuration.mddocs/docs/User Guide/Getting Started/Quick Start.mddocs/docs/User Guide/Installation/Docker Compose.mddocs/docs/User Guide/Installation/Docker.mddocs/docs/User Guide/Installation/Helm Chart.mddocs/docs/User Guide/Installation/Kubernetes.mddocs/docs/User Guide/Installation/NixOS.mddocs/docs/User Guide/Operations/Troubleshooting.mddocs/docs/User Guide/Operations/Upgrading.mdnix/packages/ncps/default.nixopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yamlopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.mdopenspec/specs/database-migrations/spec.md
✅ Files skipped from review due to trivial changes (10)
- docs/docs/User Guide/Getting Started/Quick Start.md
- docs/docs/User Guide/Configuration/Database/SQLite Configuration.md
- docs/docs/Developer Guide/Testing.md
- docs/docs/User Guide/Operations/Upgrading.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml
- docs/docs/Developer Guide.md
- docs/docs/User Guide/Installation/Docker Compose.md
- docs/docs/User Guide/Installation/Helm Chart.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.md
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/docs/Developer Guide/Contributing.md (1)
149-151:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd language identifiers to fenced command blocks (
MD040).These command fences should be tagged (e.g.,
sh) to satisfy markdownlint.Suggested patch
- ``` + ```sh task migrations:gen NAME=descriptive_snake_case ``` -``` +```sh ncps migrate up --cache-database-url=sqlite:/path/to/db.sqlite ncps migrate up --cache-database-url=postgresql://user:pass@host:port/db ncps migrate up --cache-database-url=mysql://user:pass@host:port/db # Preview without touching the DB: ncps migrate up --cache-database-url=... --dry-run
task migrations:gen NAME=descriptive_snake_case
ncps migrate up --cache-database-url=sqlite:./test.db --dry-run ncps migrate up --cache-database-url=sqlite:./test.db-
+sh
go generate ./ent/... # or: task ent:generate
go run ./cmd/ent-lint --root . # or: task ent:lintAlso applies to: 159-165, 632-634, 640-643, 651-654
🤖 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 `@docs/docs/Developer` Guide/Contributing.md around lines 149 - 151, Add shell language identifiers to the fenced code blocks that currently lack them to satisfy markdownlint MD040: update the backticks for the blocks containing commands like "task migrations:gen NAME=descriptive_snake_case", the "ncps migrate up --cache-database-url=..." examples, the "ncps migrate up --cache-database-url=sqlite:./test.db" block, and the "go generate ./ent/..." / "go run ./cmd/ent-lint --root ." block so each opening fence is ```sh (and closing fence remains ```); ensure you apply the same change to the other affected ranges referenced in the comment (around lines showing those exact command strings).
🧹 Nitpick comments (1)
charts/ncps/tests/migration_test.yaml (1)
97-139: ⚡ Quick winAdd env-contract assertions for both initContainer templates.
Current suite validates env wiring for
migration-joband deployment+sqlite, but not deployment+postgres or statefulset env variants. Adding those cases will better lock theCACHE_DATABASE_URLcontract across both initContainer templates.📌 Suggested test additions
+ - it: deployment migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres) + template: deployment.yaml + set: + mode: deployment + config.hostname: test.example.com + config.database.type: postgresql + config.database.postgresql.host: pg + config.database.postgresql.password: pw + migration.enabled: true + migration.mode: initContainer + asserts: + - contains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: CACHE_DATABASE_URL + valueFrom: + secretKeyRef: + name: RELEASE-NAME-ncps + key: database-url + + - it: statefulset migration initContainer env uses CACHE_DATABASE_URL (sqlite) + template: statefulset.yaml + set: + mode: statefulset + config.hostname: test.example.com + config.database.type: sqlite + migration.enabled: true + migration.mode: initContainer + asserts: + - contains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: CACHE_DATABASE_URL + value: "sqlite:/storage/db/ncps.db" + - notContains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: DATABASE_URL + + - it: statefulset migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres) + template: statefulset.yaml + set: + mode: statefulset + config.hostname: test.example.com + config.database.type: postgresql + config.database.postgresql.host: pg + config.database.postgresql.password: pw + migration.enabled: true + migration.mode: initContainer + asserts: + - contains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: CACHE_DATABASE_URL + valueFrom: + secretKeyRef: + name: RELEASE-NAME-ncps + key: database-urlAs per coding guidelines,
charts/ncps/tests/*_test.yaml: "Run Helm chart tests usinghelm unittest charts/ncpsand add new tests tocharts/ncps/tests/(files must end with_test.yaml)."🤖 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 `@charts/ncps/tests/migration_test.yaml` around lines 97 - 139, Add env-contract assertions for the deployment+postgres and statefulset initContainer templates: for the deployment test using template deployment.yaml with config.database.type: postgres assert that spec.template.spec.initContainers[?(@.name=="migration")].env contains an entry with name: CACHE_DATABASE_URL and the expected postgres URL value and that there is no env entry named DATABASE_URL; likewise add a parallel assertion for the statefulset test using template statefulset.yaml to verify the migration initContainer's env contains CACHE_DATABASE_URL and does not contain DATABASE_URL (use the existing test names/patterns like the sqlite/deployment and statefulset migrate up tests to mirror structure).
🤖 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 `@docs/docs/User` Guide/Configuration/Database/PostgreSQL Configuration.md:
- Line 115: Update the example migration command so the PostgreSQL DSN is quoted
to prevent shell globbing; replace the unquoted flag value "ncps migrate up
--cache-database-url=postgresql://ncps:password@localhost:5432/ncps?sslmode=disable"
with a quoted DSN like "ncps migrate up
--cache-database-url='postgresql://ncps:password@localhost:5432/ncps?sslmode=disable'"
(single or double quotes are fine) so the `?sslmode=disable` portion isn't
expanded by the shell.
---
Duplicate comments:
In `@docs/docs/Developer` Guide/Contributing.md:
- Around line 149-151: Add shell language identifiers to the fenced code blocks
that currently lack them to satisfy markdownlint MD040: update the backticks for
the blocks containing commands like "task migrations:gen
NAME=descriptive_snake_case", the "ncps migrate up --cache-database-url=..."
examples, the "ncps migrate up --cache-database-url=sqlite:./test.db" block, and
the "go generate ./ent/..." / "go run ./cmd/ent-lint --root ." block so each
opening fence is ```sh (and closing fence remains ```); ensure you apply the
same change to the other affected ranges referenced in the comment (around lines
showing those exact command strings).
---
Nitpick comments:
In `@charts/ncps/tests/migration_test.yaml`:
- Around line 97-139: Add env-contract assertions for the deployment+postgres
and statefulset initContainer templates: for the deployment test using template
deployment.yaml with config.database.type: postgres assert that
spec.template.spec.initContainers[?(@.name=="migration")].env contains an entry
with name: CACHE_DATABASE_URL and the expected postgres URL value and that there
is no env entry named DATABASE_URL; likewise add a parallel assertion for the
statefulset test using template statefulset.yaml to verify the migration
initContainer's env contains CACHE_DATABASE_URL and does not contain
DATABASE_URL (use the existing test names/patterns like the sqlite/deployment
and statefulset migrate up tests to mirror structure).
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fd30283e-be17-4a51-8099-288300b24cb8
📒 Files selected for processing (25)
charts/ncps/templates/_helpers.tplcharts/ncps/templates/deployment.yamlcharts/ncps/templates/migration-job.yamlcharts/ncps/templates/statefulset.yamlcharts/ncps/tests/migration_test.yamldocs/docs/Developer Guide.mddocs/docs/Developer Guide/Contributing.mddocs/docs/Developer Guide/Testing.mddocs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.mddocs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.mddocs/docs/User Guide/Configuration/Database/SQLite Configuration.mddocs/docs/User Guide/Getting Started/Quick Start.mddocs/docs/User Guide/Installation/Docker Compose.mddocs/docs/User Guide/Installation/Docker.mddocs/docs/User Guide/Installation/Helm Chart.mddocs/docs/User Guide/Installation/Kubernetes.mddocs/docs/User Guide/Installation/NixOS.mddocs/docs/User Guide/Operations/Troubleshooting.mddocs/docs/User Guide/Operations/Upgrading.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yamlopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.mdopenspec/specs/database-migrations/spec.md
✅ Files skipped from review due to trivial changes (12)
- docs/docs/User Guide/Operations/Troubleshooting.md
- docs/docs/User Guide/Operations/Upgrading.md
- docs/docs/User Guide/Configuration/Database/SQLite Configuration.md
- docs/docs/User Guide/Installation/Helm Chart.md
- docs/docs/User Guide/Getting Started/Quick Start.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.md
- docs/docs/Developer Guide/Testing.md
- docs/docs/User Guide/Installation/Docker Compose.md
- docs/docs/Developer Guide.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.md
- docs/docs/User Guide/Installation/Docker.md
- docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md
The dbmate→Ent migration removed dbmate from the runtime container
image (only /bin/ncps ships now), but the Helm chart's three migration
entrypoints and the _helpers.tpl partial still invoked /bin/dbmate
with DATABASE_URL. Helm deploys of the post-Ent branch would crash
with `exec: "/bin/dbmate": no such file or directory`. Several
developer + user docs also described the dbmate-era workflow and
db/migrations/<dialect> paths that no longer exist.
Changes:
* charts/ncps/templates/_helpers.tpl: ncps.migrationDatabaseURLEnv
now emits CACHE_DATABASE_URL (the env-var source already declared
by the --cache-database-url flag in pkg/ncps/migrate.go). Secret
key name (database-url) is unchanged.
* charts/ncps/templates/{migration-job,statefulset,deployment}.yaml:
command "/bin/ncps", args ["migrate","up"].
* charts/ncps/tests/migration_test.yaml (new): 6 helm-unittest cases
asserting command/args/env for migration-job + both initContainer
forms, covering sqlite (literal value) and postgres (secretKeyRef).
Locks down the new spec contract added in this change.
* docs: replace every dbmate invocation across 12 files (developer +
user guides, Docker / Docker Compose / Kubernetes / NixOS install
recipes, troubleshooting) with the equivalent
`ncps migrate up --cache-database-url=...` command. Updated the
Contributing.md project tree to reflect ent/, migrations/, and the
cmd/{ent-lint,generate-migrations,atlas-sum-check} helpers. Added
an "Upgrading past the Ent migration release" subsection to
Operations/Upgrading.md.
* openspec/changes/update-migration-docs-and-chart/: full
spec-driven artifact set (proposal, design, specs delta on
database-migrations, tasks). The specs delta adds a new requirement
pinning the runtime migration entrypoint to /bin/ncps so any
future deployment artifact knows to avoid dbmate.
Verified: nix fmt clean, helm unittest charts/ncps green (135/135),
no dbmate references remain in charts/ or docs/ outside the
intentional upgrade-note callout.
The production deployment example's init container did not pass the database URL to `ncps migrate up`. The `envFrom: configMapRef` referenced the ncps-config ConfigMap, which only contains a config.yaml key — not a CACHE_DATABASE_URL environment variable — so the migration command had no way to connect to the database. Fix by adding the explicit --cache-database-url flag to the init container args, consistent with the basic deployment example. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md (1)
115-115:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winQuote the PostgreSQL DSN in the migration command.
Line 115 should quote the URL to avoid shell globbing on
?sslmode=disablein copy/paste usage.Suggested doc patch
-ncps migrate up --cache-database-url=postgresql://ncps:password@localhost:5432/ncps?sslmode=disable +ncps migrate up --cache-database-url="postgresql://ncps:password@localhost:5432/ncps?sslmode=disable"🤖 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 `@docs/docs/User` Guide/Configuration/Database/PostgreSQL Configuration.md at line 115, The example migration command currently risks shell globbing on the ?sslmode=disable part; update the example invocation (the DSN shown: ncps migrate up --cache-database-url=postgresql://ncps:password@localhost:5432/ncps?sslmode=disable) to wrap the entire URL in quotes (single or double) so the shell treats it as one argument (e.g., --cache-database-url="postgresql://...?sslmode=disable").docs/docs/Developer Guide/Contributing.md (1)
149-151:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd shell language tags to fenced command blocks.
These command fences are still missing a language identifier and will continue to fail MD040; use
```shfor each listed block.Also applies to: 159-165, 632-634, 640-643, 651-654
🤖 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 `@docs/docs/Developer` Guide/Contributing.md around lines 149 - 151, Update the fenced command blocks that lack a language tag by adding the shell identifier; specifically change the triple-backtick fences surrounding commands like "task migrations:gen NAME=descriptive_snake_case" (and the other blocks referenced at the ranges containing commands) to use ```sh so each listed command block includes a `sh` language tag and satisfies MD040.
🧹 Nitpick comments (2)
charts/ncps/templates/_helpers.tpl (1)
139-155: ⚡ Quick winDeduplicate migration/runtime DB env helpers to avoid drift.
ncps.migrationDatabaseURLEnvnow mirrorsncps.cacheDatabaseURLEnvexactly. Keeping both copies increases the chance of contract drift later.♻️ Proposed simplification
{{- define "ncps.migrationDatabaseURLEnv" -}} -- name: CACHE_DATABASE_URL -{{- if eq .Values.config.database.type "sqlite" }} - value: {{ include "ncps.databaseURL" . | quote }} -{{- else }} - valueFrom: - secretKeyRef: - {{- $dbType := .Values.config.database.type -}} - {{- $dbConfig := index .Values.config.database $dbType -}} - {{- if $dbConfig.existingSecret }} - name: {{ $dbConfig.existingSecret }} - {{- else }} - name: {{ include "ncps.fullname" . }} - {{- end }} - key: database-url -{{- end }} +{{ include "ncps.cacheDatabaseURLEnv" . }} {{- end -}}🤖 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 `@charts/ncps/templates/_helpers.tpl` around lines 139 - 155, The migration DB env helper ncps.migrationDatabaseURLEnv duplicates ncps.cacheDatabaseURLEnv; replace the duplicate by extracting the shared logic into one helper (e.g., ncps.databaseURLEnv) or have ncps.migrationDatabaseURLEnv simply include ncps.cacheDatabaseURLEnv so both use the same implementation; update references so ncps.migrationDatabaseURLEnv and ncps.cacheDatabaseURLEnv both rely on the common helper and keep existing uses of ncps.databaseURL, ncps.fullname and the secretKeyRef logic unchanged.charts/ncps/tests/migration_test.yaml (1)
53-139: ⚡ Quick winAdd initContainer env-contract assertions for parity across templates.
The suite validates env wiring well for
migration-job, but initContainer coverage is missing a postgressecretKeyRefcase and any statefulset env assertion (CACHE_DATABASE_URL/ noDATABASE_URL). Adding those closes the contract gap with very little effort.✅ Suggested additional tests
+ - it: deployment migration initContainer env uses CACHE_DATABASE_URL with secretKeyRef (postgres) + template: deployment.yaml + set: + mode: deployment + config.hostname: test.example.com + config.database.type: postgresql + config.database.postgresql.host: pg + config.database.postgresql.password: pw + migration.enabled: true + migration.mode: initContainer + asserts: + - contains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: CACHE_DATABASE_URL + valueFrom: + secretKeyRef: + name: RELEASE-NAME-ncps + key: database-url + - notContains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: DATABASE_URL + + - it: statefulset migration initContainer env uses CACHE_DATABASE_URL (sqlite) + template: statefulset.yaml + set: + mode: statefulset + config.hostname: test.example.com + config.database.type: sqlite + migration.enabled: true + migration.mode: initContainer + asserts: + - contains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: CACHE_DATABASE_URL + value: "sqlite:/storage/db/ncps.db" + - notContains: + path: spec.template.spec.initContainers[?(@.name=="migration")].env + content: + name: DATABASE_URLAs per coding guidelines,
charts/ncps/tests/*_test.yaml: Run Helm chart tests usinghelm unittest charts/ncpsand add new tests tocharts/ncps/tests/(files must end with_test.yaml).🤖 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 `@charts/ncps/tests/migration_test.yaml` around lines 53 - 139, Add missing initContainer environment assertions to charts/ncps/tests/migration_test.yaml so initContainer env parity matches migration-job tests: for the deployment initContainer test (template: deployment.yaml, set migration.mode: initContainer) add an asserts block that checks spec.template.spec.initContainers[?(@.name=="migration")].env contains name: CACHE_DATABASE_URL with valueFrom.secretKeyRef.name: RELEASE-NAME-ncps and key: database-url (postgres secretKeyRef case), and mirror the sqlite case for the statefulset test (template: statefulset.yaml, migration.mode: initContainer) by asserting the initContainer env contains CACHE_DATABASE_URL set to "sqlite:/storage/db/ncps.db" and notContains DATABASE_URL; keep test naming consistent with existing "deployment migration initContainer ..." and "statefulset migration initContainer ..." entries so helm unittest (helm unittest charts/ncps) picks them up.
🤖 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 `@docs/docs/User` Guide/Installation/Docker Compose.md:
- Line 177: The compose migration command uses the --cache-database-url flag
without quotes which allows the trailing ?sslmode=disable to be treated as a
shell glob; update the invocation of /bin/ncps migrate up to wrap the DSN value
in quotes (i.e., quote the argument passed to --cache-database-url) so the full
PostgreSQL URL including ?sslmode=disable is passed verbatim.
---
Duplicate comments:
In `@docs/docs/Developer` Guide/Contributing.md:
- Around line 149-151: Update the fenced command blocks that lack a language tag
by adding the shell identifier; specifically change the triple-backtick fences
surrounding commands like "task migrations:gen NAME=descriptive_snake_case" (and
the other blocks referenced at the ranges containing commands) to use ```sh so
each listed command block includes a `sh` language tag and satisfies MD040.
In `@docs/docs/User` Guide/Configuration/Database/PostgreSQL Configuration.md:
- Line 115: The example migration command currently risks shell globbing on the
?sslmode=disable part; update the example invocation (the DSN shown: ncps
migrate up
--cache-database-url=postgresql://ncps:password@localhost:5432/ncps?sslmode=disable)
to wrap the entire URL in quotes (single or double) so the shell treats it as
one argument (e.g., --cache-database-url="postgresql://...?sslmode=disable").
---
Nitpick comments:
In `@charts/ncps/templates/_helpers.tpl`:
- Around line 139-155: The migration DB env helper ncps.migrationDatabaseURLEnv
duplicates ncps.cacheDatabaseURLEnv; replace the duplicate by extracting the
shared logic into one helper (e.g., ncps.databaseURLEnv) or have
ncps.migrationDatabaseURLEnv simply include ncps.cacheDatabaseURLEnv so both use
the same implementation; update references so ncps.migrationDatabaseURLEnv and
ncps.cacheDatabaseURLEnv both rely on the common helper and keep existing uses
of ncps.databaseURL, ncps.fullname and the secretKeyRef logic unchanged.
In `@charts/ncps/tests/migration_test.yaml`:
- Around line 53-139: Add missing initContainer environment assertions to
charts/ncps/tests/migration_test.yaml so initContainer env parity matches
migration-job tests: for the deployment initContainer test (template:
deployment.yaml, set migration.mode: initContainer) add an asserts block that
checks spec.template.spec.initContainers[?(@.name=="migration")].env contains
name: CACHE_DATABASE_URL with valueFrom.secretKeyRef.name: RELEASE-NAME-ncps and
key: database-url (postgres secretKeyRef case), and mirror the sqlite case for
the statefulset test (template: statefulset.yaml, migration.mode: initContainer)
by asserting the initContainer env contains CACHE_DATABASE_URL set to
"sqlite:/storage/db/ncps.db" and notContains DATABASE_URL; keep test naming
consistent with existing "deployment migration initContainer ..." and
"statefulset migration initContainer ..." entries so helm unittest (helm
unittest charts/ncps) picks them up.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 779b1aa3-7215-49d5-acdd-18fa0f3c5fd1
📒 Files selected for processing (25)
charts/ncps/templates/_helpers.tplcharts/ncps/templates/deployment.yamlcharts/ncps/templates/migration-job.yamlcharts/ncps/templates/statefulset.yamlcharts/ncps/tests/migration_test.yamldocs/docs/Developer Guide.mddocs/docs/Developer Guide/Contributing.mddocs/docs/Developer Guide/Testing.mddocs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.mddocs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.mddocs/docs/User Guide/Configuration/Database/SQLite Configuration.mddocs/docs/User Guide/Getting Started/Quick Start.mddocs/docs/User Guide/Installation/Docker Compose.mddocs/docs/User Guide/Installation/Docker.mddocs/docs/User Guide/Installation/Helm Chart.mddocs/docs/User Guide/Installation/Kubernetes.mddocs/docs/User Guide/Installation/NixOS.mddocs/docs/User Guide/Operations/Troubleshooting.mddocs/docs/User Guide/Operations/Upgrading.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yamlopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.mdopenspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.mdopenspec/specs/database-migrations/spec.md
✅ Files skipped from review due to trivial changes (10)
- docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md
- docs/docs/User Guide/Operations/Troubleshooting.md
- docs/docs/User Guide/Operations/Upgrading.md
- docs/docs/Developer Guide/Testing.md
- docs/docs/Developer Guide.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml
- docs/docs/User Guide/Installation/Docker.md
- docs/docs/User Guide/Installation/Helm Chart.md
- openspec/specs/database-migrations/spec.md
- openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.md
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
=====================================
Coverage 5.50% 5.50%
=====================================
Files 6 6
Lines 400 400
=====================================
Hits 22 22
Misses 374 374
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The dbmate→Ent migration removed dbmate from the runtime container
image (only /bin/ncps ships now), but the Helm chart's three migration
entrypoints and the _helpers.tpl partial still invoked /bin/dbmate
with DATABASE_URL. Helm deploys of the post-Ent branch would crash
with
exec: "/bin/dbmate": no such file or directory. Severaldeveloper + user docs also described the dbmate-era workflow and
db/migrations/ paths that no longer exist.
Changes:
now emits CACHE_DATABASE_URL (the env-var source already declared
by the --cache-database-url flag in pkg/ncps/migrate.go). Secret
key name (database-url) is unchanged.
command "/bin/ncps", args ["migrate","up"].
asserting command/args/env for migration-job + both initContainer
forms, covering sqlite (literal value) and postgres (secretKeyRef).
Locks down the new spec contract added in this change.
user guides, Docker / Docker Compose / Kubernetes / NixOS install
recipes, troubleshooting) with the equivalent
ncps migrate up --cache-database-url=...command. Updated theContributing.md project tree to reflect ent/, migrations/, and the
cmd/{ent-lint,generate-migrations,atlas-sum-check} helpers. Added
an "Upgrading past the Ent migration release" subsection to
Operations/Upgrading.md.
spec-driven artifact set (proposal, design, specs delta on
database-migrations, tasks). The specs delta adds a new requirement
pinning the runtime migration entrypoint to /bin/ncps so any
future deployment artifact knows to avoid dbmate.
Verified: nix fmt clean, helm unittest charts/ncps green (135/135),
no dbmate references remain in charts/ or docs/ outside the
intentional upgrade-note callout.