Skip to content

docs(readme,changelog): document Ent + Atlas + Goose; add operator upgrade notes - #1226

Merged
kalbasit merged 1 commit into
mainfrom
docs-readme-changelog
May 23, 2026
Merged

kalbasit merged 1 commit into
mainfrom
docs-readme-changelog

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

Two doc-only changes:

  • README.md

    • Replace the docker quick-start dbmate up invocation with
      ncps migrate up (the new migrator embeds the migrations and
      applies them via goose).
    • Add an Architecture section listing the new internal dependencies
      (Ent, Atlas-as-library, Goose, Chi, storage backends) and pointing
      at the docs for the full design.
  • CHANGELOG.md (new file)

    • Document the database tooling migration (sqlc + dbmate → Ent +
      Atlas + Goose), the removal of dbmate/dbmate-wrapper and
      the pkg/database/*db/ wrapper packages.
    • Operator upgrade procedure: backup first, then the one-shot
      adoption that converts the legacy schema_migrations table to
      the goose shape on first ncps migrate up. Calls out the
      SQLite/Postgres transactional path and the MySQL backup-table
      dance, plus the --dry-run preview for large databases.
    • Lists the four new nix flake check derivations.

Marks tasks 14.7 and 14.8 complete in the migrate-to-ent-and-atlas
change.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 21, 2026
@dosubot

dosubot Bot commented May 21, 2026

Copy link
Copy Markdown

Related Knowledge

1 document with suggested updates is ready for review.

kalbasit's Space

Development Environment with MinIO
View Suggested Changes
@@ -38,23 +38,27 @@
 [See initialization script](https://github.com/kalbasit/ncps/blob/cf8e19f/nix/process-compose/init-minio.sh)
 
 # Database Migration Transaction Handling
-**IMPORTANT:** Do NOT manually add `BEGIN`/`COMMIT` blocks to your migration files. The `dbmate` tool automatically wraps each migration in a transaction for atomicity. Adding manual transaction blocks will cause errors such as "cannot start a transaction within a transaction."
+**IMPORTANT:** Do NOT manually add `BEGIN`/`COMMIT` blocks to your migration files. Goose automatically wraps each migration in a transaction for atomicity. Adding manual transaction blocks will cause errors such as "cannot start a transaction within a transaction."
 
 **Example:**
 
 ```sql
 -- ❌ WRONG - Don't add manual transactions
--- migrate:up
 BEGIN;
 CREATE TABLE example (...);
 COMMIT;
 
--- ✅ CORRECT - Let dbmate handle transactions
--- migrate:up
+-- ✅ CORRECT - Let Goose handle transactions
 CREATE TABLE example (...);
 ```
 
-Letting dbmate manage transactions ensures that if any part of a migration fails, the entire migration is rolled back, preventing partial or inconsistent database states.
+Letting Goose manage transactions ensures that if any part of a migration fails, the entire migration is rolled back, preventing partial or inconsistent database states.
+
+**Migration Workflow:**
+
+- Schemas are authored under `ent/schema/*.go`
+- Migrations are generated via `go run ./cmd/generate-migrations --name=<descriptive_snake_case>`
+- Migrations are embedded at runtime and applied by `ncps migrate up --cache-database-url=<database-url>`
 
 ## Running MinIO and Initialization
 Start MinIO and run the initialization process using:

[Accept] [Edit] [Decline]

How did I do? Any feedback?  Join Discord

This was referenced May 21, 2026
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 5801be2 to 300cb72 Compare May 22, 2026 21:42
kalbasit added a commit that referenced this pull request May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from 711045f to ed3bd4a Compare May 22, 2026 21:54
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 300cb72 to edc206f Compare May 22, 2026 21:54
kalbasit added a commit that referenced this pull request May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from ed3bd4a to 056f388 Compare May 22, 2026 23:02
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from edc206f to 43acc87 Compare May 22, 2026 23:02
kalbasit added a commit that referenced this pull request May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from 056f388 to 13a2787 Compare May 22, 2026 23:16
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 43acc87 to 04980f2 Compare May 22, 2026 23:16
kalbasit added a commit that referenced this pull request May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from 13a2787 to 96faf37 Compare May 22, 2026 23:28
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 04980f2 to 5987ba9 Compare May 22, 2026 23:28
kalbasit added a commit that referenced this pull request May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from 96faf37 to 7568b3c Compare May 22, 2026 23:54
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 5987ba9 to 0ee1edf Compare May 22, 2026 23:54
kalbasit added a commit that referenced this pull request May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from 7568b3c to f4141c3 Compare May 23, 2026 00:07
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 0ee1edf to e59499f Compare May 23, 2026 00:08
kalbasit added a commit that referenced this pull request May 23, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from f4141c3 to 968ad67 Compare May 23, 2026 00:36
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from e59499f to 3e6f57a Compare May 23, 2026 00:36
kalbasit added a commit that referenced this pull request May 23, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kalbasit
kalbasit force-pushed the docs-skills-rewrite-migrate-and-ent-schema branch from 968ad67 to 94dec92 Compare May 23, 2026 03:31
@kalbasit
kalbasit force-pushed the docs-readme-changelog branch from 3e6f57a to c00cc0d Compare May 23, 2026 03:31
kalbasit added a commit that referenced this pull request May 23, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for
  generating new migrations, since it regenerates the Ent client first
  via task ent:generate. Mention the underlying go run invocation in
  parentheses for users who want the raw command.
- The schema_migrations adoption verifies row-count consistency, not
  parity — the new table intentionally adds a sentinel row, so the
  expected post-count is preCount + 1. Reword to make that explicit.

Addresses gemini-code-assist comments on PR #1226
(PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@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

…grade notes

Two doc-only changes:

- README.md
  - Replace the docker quick-start `dbmate up` invocation with
    `ncps migrate up` (the new migrator embeds the migrations and
    applies them via goose).
  - Add an Architecture section listing the new internal dependencies
    (Ent, Atlas-as-library, Goose, Chi, storage backends) and pointing
    at the docs for the full design.

- CHANGELOG.md (new file)
  - Document the database tooling migration (sqlc + dbmate → Ent +
    Atlas + Goose), the removal of `dbmate`/`dbmate-wrapper` and
    the `pkg/database/*db/` wrapper packages.
  - Operator upgrade procedure: backup first, then the one-shot
    adoption that converts the legacy `schema_migrations` table to
    the goose shape on first `ncps migrate up`. Calls out the
    SQLite/Postgres transactional path and the MySQL backup-table
    dance, plus the `--dry-run` preview for large databases.
  - Lists the four new `nix flake check` derivations.

Marks tasks 14.7 and 14.8 complete in the migrate-to-ent-and-atlas
change.
@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 (40ce6ec) to head (8fe0c86).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1226   +/-   ##
=====================================
  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 merge-stack size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant