Conversation
…t + content shape) Two prod bugs hit when importing an exported framework (e.g. the first NIST SP800-53 framework): 1. 5000-char limit on import. FRAME-2 raised the requirement description cap to 10000 only on the standalone requirement DTOs; the import flow uses a separate ImportRequirementDto that was still @maxlength(5000). NIST PL-2's requirement text is >6000 chars, so import failed validation. Raise it to 10000 to match (control/policy/task stay 5000, consistent with their standalone create DTOs). 2. "policyTemplates[].content must be an object". Policy content is an untyped Json column that legitimately holds either a {type:'doc',content:[...]} object or a bare ProseMirror node array (legacy data). Export emits it verbatim, but the import DTO required @isObject, which rejects arrays. - Relax ImportPolicyTemplateDto.content to accept array-or-object. - Normalize content to a canonical doc node on import-persist (and on export for forward-compat) via normalizeTipTapDoc. This also replaces the old `(content ?? {})` fallback that wrote a bare {} — which onboarding silently turned into an empty policy. Adds the IsObjectOrArray validator, the normalizeTipTapDoc helper, and tests for both (DTO validation boundaries + helper shape cases). All 60 framework- editor tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend the import limit fix beyond requirement descriptions: control, policy, and task descriptions on import also go 5000 -> 10000. Import is the bulk-load path for externally-authored frameworks (e.g. NIST), where any description can be verbose, and we can't assume only requirements exceed 5000. All four columns are unbounded Postgres text, so there's no DB risk. Adds a test covering 10k control/policy/task descriptions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mit-and-content fix(framework-editor): unblock framework import (10k requirement limit + content shape)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Contributor
|
🎉 This PR is included in version 3.82.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Unblocks framework imports by raising description limits to 10k and accepting/normalizing TipTap policy content, fixing failures when importing exported frameworks (e.g., NIST SP800-53). Also standardizes exported policy content to a canonical doc shape.
policyTemplates.contentto be an object or array viaIsObjectOrArray(size guard retained).normalizeTipTapDocto always emit{ type: 'doc', content: [] }(avoids bare{}and supports legacy arrays).Written for commit 381f7f3. Summary will update on new commits.