Skip to content

fix(helm,docs): use ncps migrate up, drop dbmate - #1234

Merged
kalbasit merged 2 commits into
mainfrom
fix-helm-docs-use-ncps-migrate
May 23, 2026
Merged

kalbasit merged 2 commits into
mainfrom
fix-helm-docs-use-ncps-migrate

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

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/ 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.

This was referenced May 22, 2026
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 22, 2026
@kalbasit
kalbasit force-pushed the fix-helm-docs-use-ncps-migrate branch from 63b68d0 to c4390fb Compare May 23, 2026 04:47
@kalbasit
kalbasit force-pushed the test-dev-scripts-add-e2e branch from 3c4ec51 to c07f76f Compare May 23, 2026 04:49
@kalbasit
kalbasit force-pushed the fix-helm-docs-use-ncps-migrate branch from c4390fb to ebd2188 Compare May 23, 2026 04:50
@kalbasit
kalbasit force-pushed the test-dev-scripts-add-e2e branch from c07f76f to e5e314f Compare May 23, 2026 05:25
@kalbasit
kalbasit force-pushed the fix-helm-docs-use-ncps-migrate branch from ebd2188 to bfedca2 Compare May 23, 2026 05:25
@kalbasit
kalbasit force-pushed the test-dev-scripts-add-e2e branch from e5e314f to 4c76679 Compare May 23, 2026 05:29
@kalbasit
kalbasit force-pushed the fix-helm-docs-use-ncps-migrate branch from bfedca2 to 647bfe2 Compare May 23, 2026 05:29
@kalbasit
kalbasit force-pushed the test-dev-scripts-add-e2e branch from 4c76679 to f8ce520 Compare May 23, 2026 05:41
@kalbasit
kalbasit force-pushed the fix-helm-docs-use-ncps-migrate branch from 647bfe2 to ad4a7a1 Compare May 23, 2026 05:41

@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

🧹 Nitpick comments (1)
charts/ncps/tests/migration_test.yaml (1)

117-139: ⚡ Quick win

Add StatefulSet env contract assertions to this suite.

This case checks command/args but not the env rename contract. Add CACHE_DATABASE_URL presence and DATABASE_URL absence 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

📥 Commits

Reviewing files that changed from the base of the PR and between 78c0e7e and 228be28.

📒 Files selected for processing (25)
  • charts/ncps/templates/_helpers.tpl
  • charts/ncps/templates/deployment.yaml
  • charts/ncps/templates/migration-job.yaml
  • charts/ncps/templates/statefulset.yaml
  • charts/ncps/tests/migration_test.yaml
  • docs/docs/Developer Guide.md
  • docs/docs/Developer Guide/Contributing.md
  • docs/docs/Developer Guide/Testing.md
  • docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md
  • docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md
  • docs/docs/User Guide/Configuration/Database/SQLite Configuration.md
  • docs/docs/User Guide/Getting Started/Quick Start.md
  • docs/docs/User Guide/Installation/Docker Compose.md
  • docs/docs/User Guide/Installation/Docker.md
  • docs/docs/User Guide/Installation/Helm Chart.md
  • docs/docs/User Guide/Installation/Kubernetes.md
  • docs/docs/User Guide/Installation/NixOS.md
  • docs/docs/User Guide/Operations/Troubleshooting.md
  • docs/docs/User Guide/Operations/Upgrading.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.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
  • openspec/specs/database-migrations/spec.md

@kalbasit

Copy link
Copy Markdown
Owner Author

Automated stack merge failed during the rebase step. The merge-stack label has been removed from all PRs in the stack. Please resolve conflicts locally, push, and re-apply the label on the top-most PR to retry. Run: https://github.com/kalbasit/ncps/actions/runs/26326665317

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

♻️ Duplicate comments (1)
docs/docs/Developer Guide/Contributing.md (1)

149-151: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add 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:lint

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 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 win

Consider 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_URL presence but don't assert DATABASE_URL absence (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

📥 Commits

Reviewing files that changed from the base of the PR and between 228be28 and b9a47da.

📒 Files selected for processing (26)
  • charts/ncps/templates/_helpers.tpl
  • charts/ncps/templates/deployment.yaml
  • charts/ncps/templates/migration-job.yaml
  • charts/ncps/templates/statefulset.yaml
  • charts/ncps/tests/migration_test.yaml
  • docs/docs/Developer Guide.md
  • docs/docs/Developer Guide/Contributing.md
  • docs/docs/Developer Guide/Testing.md
  • docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md
  • docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md
  • docs/docs/User Guide/Configuration/Database/SQLite Configuration.md
  • docs/docs/User Guide/Getting Started/Quick Start.md
  • docs/docs/User Guide/Installation/Docker Compose.md
  • docs/docs/User Guide/Installation/Docker.md
  • docs/docs/User Guide/Installation/Helm Chart.md
  • docs/docs/User Guide/Installation/Kubernetes.md
  • docs/docs/User Guide/Installation/NixOS.md
  • docs/docs/User Guide/Operations/Troubleshooting.md
  • docs/docs/User Guide/Operations/Upgrading.md
  • nix/packages/ncps/default.nix
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.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
  • openspec/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

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":401,"request":{"method":"PATCH","url":"https://api.github.com/repos/kalbasit/ncps/issues/comments/4521545841","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- This is an auto-generated comment: rate limited by coderabbit.ai -->\n\n> [!WARNING]\n> ## Review limit reached\n> \n> `@kalbasit`, we couldn't start this review because you've used your available PR reviews for now.\n> \n> Your plan currently allows 5 reviews/hour. Refill in 56 seconds.\n> \n> Your organization has run out of usage credits. Purchase more in the [billing tab](https://app.coderabbit.ai/settings/subscription?tab=usage&tenantId=32762653-f2c3-46d1-950f-ea0cf172d376).\n> \n> <details>\n> <summary>⌛ How to resolve this issue?</summary>\n> \n> After more review capacity refills, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR.\n> \n> We recommend that you space out your commits to avoid hitting the rate limit.\n> \n> </details>\n> \n> \n> <details>\n> <summary>🚦 How do rate limits work?</summary>\n> \n> CodeRabbit enforces hourly rate limits for each developer per organization.\n> \n> Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.\n> \n> Please see our [FAQ](https://docs.coderabbit.ai/faq) for further information.\n> \n> </details>\n> \n> <details>\n> <summary>ℹ️ Review info</summary>\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Organization UI\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro\n> \n> **Run ID**: `91e83a8f-a45b-4b5a-b6da-1ec241866145`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between b9a47daf6ee8ca2813ca5d2591b3d770016bf281 and 797f911a6d6104eb6dde961fac2abc39e3463f0e.\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (25)</summary>\n> \n> * `charts/ncps/templates/_helpers.tpl`\n> * `charts/ncps/templates/deployment.yaml`\n> * `charts/ncps/templates/migration-job.yaml`\n> * `charts/ncps/templates/statefulset.yaml`\n> * `charts/ncps/tests/migration_test.yaml`\n> * `docs/docs/Developer Guide.md`\n> * `docs/docs/Developer Guide/Contributing.md`\n> * `docs/docs/Developer Guide/Testing.md`\n> * `docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md`\n> * `docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md`\n> * `docs/docs/User Guide/Configuration/Database/SQLite Configuration.md`\n> * `docs/docs/User Guide/Getting Started/Quick Start.md`\n> * `docs/docs/User Guide/Installation/Docker Compose.md`\n> * `docs/docs/User Guide/Installation/Docker.md`\n> * `docs/docs/User Guide/Installation/Helm Chart.md`\n> * `docs/docs/User Guide/Installation/Kubernetes.md`\n> * `docs/docs/User Guide/Installation/NixOS.md`\n> * `docs/docs/User Guide/Operations/Troubleshooting.md`\n> * `docs/docs/User Guide/Operations/Upgrading.md`\n> * `openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml`\n> * `openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.md`\n> * `openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.md`\n> * `openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/specs/database-migrations/spec.md`\n> * `openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/tasks.md`\n> * `openspec/specs/database-migrations/spec.md`\n> \n> </details>\n> \n> </details>\n\n<!-- end of auto-generated comment: rate limited by coderabbit.ai -->\n\n<!-- tips_start -->\n\n---\n\n\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->"},"request":{"retryCount":1,"signal":{}}},"response":{"url":"https://api.github.com/repos/kalbasit/ncps/issues/comments/4521545841","status":401,"headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","connection":"close","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Sat, 23 May 2026 16:59:32 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-media-type":"github.v3; format=json","x-github-request-id":"80BB:337367:C32CDE7:2EB28BE3:6A11DCF4","x-xss-protection":"0"},"data":{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest","status":"401"}}}

@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

♻️ Duplicate comments (1)
docs/docs/Developer Guide/Contributing.md (1)

149-151: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add 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:lint

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, 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 win

Add env-contract assertions for both initContainer templates.

Current suite validates env wiring for migration-job and deployment+sqlite, but not deployment+postgres or statefulset env variants. Adding those cases will better lock the CACHE_DATABASE_URL contract 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-url

As per coding guidelines, charts/ncps/tests/*_test.yaml: "Run Helm chart tests using helm unittest charts/ncps and add new tests to charts/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

📥 Commits

Reviewing files that changed from the base of the PR and between b9a47da and 6cbc1fc.

📒 Files selected for processing (25)
  • charts/ncps/templates/_helpers.tpl
  • charts/ncps/templates/deployment.yaml
  • charts/ncps/templates/migration-job.yaml
  • charts/ncps/templates/statefulset.yaml
  • charts/ncps/tests/migration_test.yaml
  • docs/docs/Developer Guide.md
  • docs/docs/Developer Guide/Contributing.md
  • docs/docs/Developer Guide/Testing.md
  • docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md
  • docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md
  • docs/docs/User Guide/Configuration/Database/SQLite Configuration.md
  • docs/docs/User Guide/Getting Started/Quick Start.md
  • docs/docs/User Guide/Installation/Docker Compose.md
  • docs/docs/User Guide/Installation/Docker.md
  • docs/docs/User Guide/Installation/Helm Chart.md
  • docs/docs/User Guide/Installation/Kubernetes.md
  • docs/docs/User Guide/Installation/NixOS.md
  • docs/docs/User Guide/Operations/Troubleshooting.md
  • docs/docs/User Guide/Operations/Upgrading.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.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
  • openspec/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

kalbasit and others added 2 commits May 23, 2026 19:19
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]>
@github-actions

Copy link
Copy Markdown
Contributor

@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

♻️ Duplicate comments (2)
docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md (1)

115-115: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Quote the PostgreSQL DSN in the migration command.

Line 115 should quote the URL to avoid shell globbing on ?sslmode=disable in 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 win

Add shell language tags to fenced command blocks.

These command fences are still missing a language identifier and will continue to fail MD040; use ```sh for 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 win

Deduplicate migration/runtime DB env helpers to avoid drift.

ncps.migrationDatabaseURLEnv now mirrors ncps.cacheDatabaseURLEnv exactly. 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 win

Add initContainer env-contract assertions for parity across templates.

The suite validates env wiring well for migration-job, but initContainer coverage is missing a postgres secretKeyRef case and any statefulset env assertion (CACHE_DATABASE_URL / no DATABASE_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_URL

As per coding guidelines, charts/ncps/tests/*_test.yaml: Run Helm chart tests using helm unittest charts/ncps and add new tests to charts/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

📥 Commits

Reviewing files that changed from the base of the PR and between 6cbc1fc and 7650eaf.

📒 Files selected for processing (25)
  • charts/ncps/templates/_helpers.tpl
  • charts/ncps/templates/deployment.yaml
  • charts/ncps/templates/migration-job.yaml
  • charts/ncps/templates/statefulset.yaml
  • charts/ncps/tests/migration_test.yaml
  • docs/docs/Developer Guide.md
  • docs/docs/Developer Guide/Contributing.md
  • docs/docs/Developer Guide/Testing.md
  • docs/docs/User Guide/Configuration/Database/MySQLMariaDB Configuration.md
  • docs/docs/User Guide/Configuration/Database/PostgreSQL Configuration.md
  • docs/docs/User Guide/Configuration/Database/SQLite Configuration.md
  • docs/docs/User Guide/Getting Started/Quick Start.md
  • docs/docs/User Guide/Installation/Docker Compose.md
  • docs/docs/User Guide/Installation/Docker.md
  • docs/docs/User Guide/Installation/Helm Chart.md
  • docs/docs/User Guide/Installation/Kubernetes.md
  • docs/docs/User Guide/Installation/NixOS.md
  • docs/docs/User Guide/Operations/Troubleshooting.md
  • docs/docs/User Guide/Operations/Upgrading.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/.openspec.yaml
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/design.md
  • openspec/changes/archive/2026-05-21-update-migration-docs-and-chart/proposal.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
  • openspec/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

codecov Bot commented May 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.50%. Comparing base (2e97b37) to head (7650eaf).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation helm merge-stack size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant