chore(deps): update @codaco packages and migrate collected categorica…#803
Conversation
…l data Bump all @codaco packages to latest, including @codaco/protocol-utilities 1.x -> 2.0.0. Adapt the generateNetwork call sites in the test-interview generator to the new options-object signature (seed moved into options). @codaco/interview 1.1.0 stores categorical attribute values as arrays of selected option values, dropping the scalar-handling fallbacks. Add a one-time, idempotent migration that wraps scalar categorical values in collected interview networks into single-element arrays, resolving categorical variables from the protocol codebook. Wired into the build:platform migration step after the v8 protocol migration. Closes #795
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jthrilly
left a comment
There was a problem hiding this comment.
I am concerned about the scenario where the upgrade from version 3.x of Fresco (using the old interview module) to version 4.x fails. If any of the steps in setup-database fail, we need to revert data migrations so as not to cause issues for the user.
Wrap the protocol-v8 and interview-categorical data migrations in a single interactive transaction so a failure during setup-database rolls them all back. A partially-migrated database is dangerous on a failed 3.x -> 4.x upgrade: the previous Fresco version keeps serving and would read half-converted protocols/networks written for the new interview module. All-or-nothing keeps the old version working on the old data.
|
Good catch — addressed in 171f5cf. The two in-place data migrations ( Notes:
Full suite + typecheck green. |
protocol-validation 11.7.0 added strict validation that a NameGeneratorRoster dataSource (and Geospatial asset references) resolve to an entry in the protocol's assetManifest. migrateProtocolsToV8 reconstructed the protocol from only name/schemaVersion/stages/codebook, so the manifest was absent and migration failed for any protocol with a roster: Roster dataSource "..." does not reference an asset in the manifest. Fresco stores assets in a separate table, so rebuild the assetManifest from the protocol's linked Asset rows and include it in the document passed to migrateProtocol. The manifest is excluded from the protocol hash, so this does not change computed hashes. Verified against the real validator with a roster protocol.
…tract createInitialNetwork and isValidAssetType were imported from the @codaco/interview package root, whose single bundle evaluates React createContext at module load and so crashes the RSC production build when pulled into server code (server action / server component). Import them instead from the new server-safe @codaco/interview/contract entry (complexdatacollective/network-canvas-monorepo#705), and drop the temporary local reimplementations so the factory stays single-sourced in the package. NOTE: blocked on publishing @codaco/interview@1.2.0 with the ./contract export. Until then the build/install is red (the subpath does not resolve against 1.1.0). Once published, refresh the lockfile (pnpm install) to go green — no code change.
Deploy-preview RSC build failure — fixed properly upstreamThe deploy preview's Root cause: Rather than reimplement those utilities in Fresco (they're part of the package contract), the fix is upstream: network-canvas-monorepo#705 adds a separately-bundled, server-safe This PR now imports Warning Blocked / held red: this PR's build & deploy will stay red until #705 is merged and |
…export) @codaco/interview@1.2.0 is published with the ./contract entry. Refresh the lockfile so the @codaco/interview/contract imports resolve, unblocking the RSC production build.
|
✅ Unblocked. Verified locally: |
|
…l data
Bump all @codaco packages to latest, including @codaco/protocol-utilities 1.x -> 2.0.0. Adapt the generateNetwork call sites in the test-interview generator to the new options-object signature (seed moved into options).
@codaco/interview 1.1.0 stores categorical attribute values as arrays of selected option values, dropping the scalar-handling fallbacks. Add a one-time, idempotent migration that wraps scalar categorical values in collected interview networks into single-element arrays, resolving categorical variables from the protocol codebook. Wired into the build:platform migration step after the v8 protocol migration.
Closes #795