feat(#4286): add connector __schemaVersion leaf and migration - #4315
feat(#4286): add connector __schemaVersion leaf and migration#4315fullsend-ai-coder[bot] wants to merge 3 commits into
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4315 +/- ##
==========================================
- Coverage 61.36% 61.36% -0.01%
==========================================
Files 2520 2520
Lines 100978 101004 +26
Branches 28295 28312 +17
==========================================
+ Hits 61965 61980 +15
- Misses 38462 38473 +11
Partials 551 551
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/fs-fix changeset and all known issues so far (like CI) |
|
🤖 Finished Fix · ✅ Success · Started 6:51 AM UTC · Completed 7:07 AM UTC Commit: |
Add changeset for connector schema versioning feature. Export CONNECTOR_SCHEMA_VERSION, CONNECTOR_IDS, ConnectorId, ConnectorMigrationFn, and ConnectorMigrationRegistry from the package entry point to fix ae-forgotten-export API report warnings. Regenerate API reports for boost-backend and boost packages. Addresses review feedback on #4315
🔧 Fix agent — iteration 1 (human-triggered)Addressed all 3 known issues: added missing changeset, exported new types from package entry point, and regenerated API reports. All 455 tests pass, prettier check passes, and API reports pass CI validation. Fixed (3):
Tests: passed Updated by fullsend fix agent |
|
/fs-fix rebase and make sure the CI passes |
|
🤖 Finished Fix · ❌ Failure · Started 7:33 AM UTC · Completed 7:47 AM UTC Commit: |
Register per-connector `boost.connectors.<id>.__schemaVersion` metadata leaves for jira, github, and gitlab with configScope `db-only` so they survive the `validateStoredValues()` startup sweep without being stripped. Add `CONNECTOR_SCHEMA_VERSION` constant (v1), `CONNECTOR_IDS` array, and `ConnectorId` type to schemas.ts. Export these along with `ConnectorMigrationFn` and `ConnectorMigrationRegistry` types from the config barrel. Implement `RuntimeConfigResolver.migrateConnectorSchemas()` which iterates known connectors on startup, stamps missing versions as v1, and applies sequentially-keyed migration functions when the stored version is behind `CONNECTOR_SCHEMA_VERSION`. No actual data migrations exist yet (v1 is the initial version); the hook infrastructure is ready for future v1→v2 field changes. Add TypeScript declarations in config.d.ts for the new field. Tests cover: leaf registration and db-only scope, Zod validation (positive int, rejects zero/negative/non-integer), survival through validateStoredValues(), migration stamping for missing versions, skip when current, per-connector independence, and cache invalidation after migration. Closes #4286
Add changeset for connector schema versioning feature. Export CONNECTOR_SCHEMA_VERSION, CONNECTOR_IDS, ConnectorId, ConnectorMigrationFn, and ConnectorMigrationRegistry from the package entry point to fix ae-forgotten-export API report warnings. Regenerate API reports for boost-backend and boost packages. Addresses review feedback on #4315
cf26102 to
84f0837
Compare
|
Rebased manually |
bee573b to
91fd159
Compare
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 9:29 AM UTC · Completed 9:49 AM UTC Commit: |
ReviewFindingsMedium
Low
Next steps:
|
There was a problem hiding this comment.
See the review comment for full details.
Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:
workspaces/boost/plugins/boost-backend/src/config/RuntimeConfigResolver.ts(file-level): Line 497 · [medium] logic-error
When storedVersion is undefined (no __schemaVersion in DB), the code stamps CONNECTOR_SCHEMA_VERSION directly and continues without running any migrations. The comment says 'treating as v1' but the behavior is 'stamp as current version.' When CONNECTOR_SCHEMA_VERSION is bumped above 1, a connector from a pre-versioning deployment will be stamped at the new version without running intermediate migrations on its existing data.
Suggested fix: When storedVersion is undefined, set effectiveVersion = 1 and fall through to the migration loop instead of using continue.
workspaces/boost/plugins/boost-backend/src/config/RuntimeConfigResolver.ts(file-level): Line 523 · [low] edge-case
The migration loop has no error handling around individual migrationFn calls. If a migration function throws, partially-applied changes remain in the DB but the version is not stamped. On next startup, earlier successful migrations would re-run.
Suggested fix: Either stamp the version after each successful migration step, or document that all migration functions must be idempotent.
workspaces/boost/plugins/boost-backend/src/config/RuntimeConfigResolver.ts(file-level): Line 510 · [low] edge-case
The storedVersion >= CONNECTOR_SCHEMA_VERSION guard silently treats a stored version higher than current as current. After a rollback, data from a newer schema is consumed without warning.
Suggested fix: Log a warning when storedVersion > CONNECTOR_SCHEMA_VERSION.
workspaces/boost/plugins/boost-backend/src/config/schemas.ts:462: [low] pattern-inconsistency
The three __schemaVersion field definitions are identical except for the connector label. The existing codebase uses factory functions for per-connector field duplication.
Suggested fix: Extract a connectorSchemaVersion(label) factory function following the pattern of connectorEnabled() etc.
workspaces/boost/plugins/boost-backend/config.d.ts:178: [low] code-organization
__schemaVersion is placed as the first property in each connector block (before enabled). Existing convention orders user-facing fields first; internal db-only metadata should go last.
Suggested fix: Move __schemaVersion to the end of each connector's property block.
workspaces/boost/plugins/boost-backend/src/config/schemas.ts:462: [low] code-organization
The three __schemaVersion entries are in a dedicated block rather than within each connector's existing section comment block, splitting connector config across two locations.
Suggested fix: Place each __schemaVersion entry within its connector's existing section comment block.
workspaces/boost/plugins/boost-backend/src/config/schemas.ts:190: [low] naming-convention
CONNECTOR_SCHEMA_VERSION omits the BOOST_ prefix used by BOOST_CONFIG_SCHEMA_VERSION. Other public exports from this module use the boost/Boost namespace prefix.
Suggested fix: Rename to BOOST_CONNECTOR_SCHEMA_VERSION.



Register per-connector
boost.connectors.<id>.__schemaVersionmetadata leaves for jira, github, and gitlab with configScopedb-onlyso they survive thevalidateStoredValues()startup sweep without being stripped.Add
CONNECTOR_SCHEMA_VERSIONconstant (v1),CONNECTOR_IDSarray, andConnectorIdtype to schemas.ts. Export these along withConnectorMigrationFnandConnectorMigrationRegistrytypes from the config barrel.Implement
RuntimeConfigResolver.migrateConnectorSchemas()which iterates known connectors on startup, stamps missing versions as v1, and applies sequentially-keyed migration functions when the stored version is behindCONNECTOR_SCHEMA_VERSION. No actual data migrations exist yet (v1 is the initial version); the hook infrastructure is ready for future v1→v2 field changes.Add TypeScript declarations in config.d.ts for the new field.
Tests cover: leaf registration and db-only scope, Zod validation (positive int, rejects zero/negative/non-integer), survival through validateStoredValues(), migration stamping for missing versions, skip when current, per-connector independence, and cache invalidation after migration.
Closes #4286
Post-script verification
agent/4286-connector-schema-versioning)e6c850f7dd03d646d614fb0c74f80e7e4b9d0026..HEAD)