chore: deps update, migration fix, marketplace cleanup#151
Conversation
…llback - Add missing relation_type values: follows, prompted_by, references, referenced_by (used by detector.go FR-4,5,36) - Replace silent error swallowing (_ = tx.Exec) with proper error returns - Add Rollback function that restores original migration 019 constraints
Breaking change DaemonControlPath(baseDir, name) is internal to engine — engram uses only engine.New/Run, no direct calls affected. Benefit: named daemon sockets prevent conflicts between muxcore apps.
Marketplace repo switched to git-subdir source — CC now fetches plugin files directly from engram:plugin/engram/ via sparse checkout. The sync workflow is obsolete and was generating noise (59 commits that didn't update the marketplace version, causing stale installs).
Source of truth for marketplace.json is now the engram-marketplace repo (thebtf/engram-marketplace). This file was a copy target for the now-deleted sync-marketplace workflow.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughУдалён workflow синхронизации маркетплейса и локальный манифест; обновлён модуль Go; расширены типы отношений в коде и миграции БД (с fail‑fast и Rollback), изменён matcher cmux для gRPC (h2c), и повышена версия плагина до 4.0.2. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.4)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
cmux.HTTP2HeaderFieldPrefix doesn't work for plaintext HTTP/2 (h2c) because the gRPC client blocks waiting for the server SETTINGS frame before sending HEADERS. Switch to HTTP2MatchHeaderFieldPrefixSendSettings which actively participates in the h2c handshake. Symptom: "error reading server preface: use of closed network connection" Root cause: cmux routed h2c gRPC connections to the HTTP handler
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/db/gorm/migrations.go`:
- Around line 2264-2268: The DB migration expands allowed relation_type values
but the in-code enum/constants still list only the original 17 types; update the
code so the application and schema match by adding the new values
("modifies","reads","follows","prompted_by","references","referenced_by") to the
relation type definitions used by the app: update the relation type list/enum in
internal/db/gorm/models.go (the RelationType or related constant slice around
the existing lines 195-210) and in pkg/models/relation.go (the relation
types/validation list around lines 9-63), or better yet centralize the list into
a single exported source (e.g., a shared constant slice or type) and reference
it from both places so the DB migration and app validation remain in sync.
Ensure any validation logic or switch/case handling that enumerates relation
types is updated to include the new values.
- Around line 2280-2292: The rollback's Rollback func(tx *gorm.DB) error re-adds
narrower CHECK constraints (chk_observation_relations_relation_type and
chk_observation_relations_detection_source) on observation_relations without
first normalizing or removing rows that violate them (e.g., creative_association
used by internal/consolidation/associations.go:270-280), so ADD CONSTRAINT will
fail on real data; fix by either (A) adding a data-migration step inside
Rollback that updates or removes incompatible relation_type and detection_source
values (identify and transform creative_association and any new relation_type
values into allowed values or NULL) before executing the ALTER TABLE statements,
or (B) mark the rollback as irreversible (return a descriptive error indicating
rollback is not supported) and remove the destructive ALTERs; modify the
Rollback function accordingly and reference
chk_observation_relations_relation_type,
chk_observation_relations_detection_source, observation_relations, and the
Rollback func(tx *gorm.DB) error when making the change.
🪄 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: 39877d2b-19fb-4c31-b1e1-6b80050302d4
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (5)
.github/workflows/sync-marketplace.ymlgo.modinternal/db/gorm/migrations.goplugin/.claude-plugin/marketplace.jsonplugin/engram/.claude-plugin/plugin.json
💤 Files with no reviewable changes (2)
- plugin/.claude-plugin/marketplace.json
- .github/workflows/sync-marketplace.yml
…ack irreversible - Add 6 new RelationType constants to pkg/models/relation.go (modifies, reads, follows, prompted_by, references, referenced_by) - Update AllRelationTypes slice (used by handler validation and stats) - Update GORM struct tag CHECK constraint to match migration 077 - Replace destructive rollback with explicit irreversible error (rows with new types may exist after migration runs) CodeRabbit review finding: handler rejected new types with 400, GORM model out of sync with DB schema.
Changes
fix(db): expand migration 077 constraints
follows,prompted_by,references,referenced_bychore(deps): muxcore v0.15.0 → v0.17.0
DaemonControlPath(baseDir, name)is internal to engine — no engram code affectedchore(ci): remove sync-marketplace workflow
git-subdirsource — CC fetches plugin files directly fromengram:plugin/engram/chore: remove plugin/.claude-plugin/marketplace.json
chore(plugin): bump version to 4.0.2
Smoke test
go build ./cmd/engram/✅go build ./cmd/engram-server/✅Known issue
gRPC over plaintext (h2c) doesn't work with cmux
HTTP2HeaderFieldPrefixmatcher — cmux routes h2c connections to the HTTP handler. Needscmux.HTTP2()matcher or TLS. Filed as separate issue.Summary by CodeRabbit
Примечания к выпуску
Обновления версий
Обновления зависимостей
Улучшения базы данных
Улучшения сети
Удалено