fix(isms): production-deploy review follow-ups (CS-701)#3365
Merged
Conversation
Addresses the ISMS issues cubic flagged on the main->release deploy PR (#3364): - hasApprovedVersion is now status-aware (currentVersionId != null OR status === 'approved'), so a document approved before versioning existed — whose legacy version row the migration drops — still reports an approved version instead of flipping to false. (P2) - ScopeForm re-seeds when the persisted draft content changes: its remount key now reflects draftNarrative, not just the published currentVersionId, so scope text refreshes after "Generate from platform data" / reload. (P3) - export DTO description now matches runtime: omitting versionId exports the current published version (or the draft if never published), not always the draft. (P3) - Approval banner renders "(v2)" instead of "v 2" (single JSX expression). (P3) Migration is intentionally left non-destructive (approvals preserved); the hasApprovedVersion fix makes that state self-consistent without a heavy backfill for pre-GA data. Tests: 319 api + 123 app ISMS tests passing; typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CweXoSSEP89mX93u3Bdcp
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
claudfuen
pushed a commit
that referenced
this pull request
Jul 7, 2026
# [3.99.0](v3.98.1...v3.99.0) (2026-07-07) ### Bug Fixes * **integrations:** don't persist unverified GitHub installation_id ([#3370](#3370)) ([9c6f6fa](9c6f6fa)) * **isms:** lock before writing control links so edits serialize with approve ([#3369](#3369)) ([a21f866](a21f866)) * **isms:** production-deploy review follow-ups (CS-701) ([#3365](#3365)) ([d756d4a](d756d4a)), closes [#3364](#3364) * **isms:** serialize approve against ALL register/content edits (central lock) ([#3367](#3367)) ([5c88a3d](5c88a3d)) * **isms:** serialize approve/decline to prevent concurrent double-publish (CS-701) ([#3366](#3366)) ([b158bc9](b158bc9)), closes [#3364](#3364) ### Features * **integrations:** add read-only GitHub App integration (CS-710) ([#3363](#3363)) ([a5a9243](a5a9243)) * **isms:** document versioning and history (CS-701) ([#3361](#3361)) ([d95dc2e](d95dc2e))
Contributor
|
🎉 This PR is included in version 3.99.0 🎉 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.
Why
The main→release production-deploy PR (#3364) got an automated review that flagged 4 ISMS issues in the CS-701 versioning work (already merged to
main). This PR fixes the real ones. Base ismain(stage); it flows torelease(production) on the next deploy.What (each maps to a flagged issue)
hasApprovedVersioncould reportfalsefor an approved doc. The migration intentionally drops legacy (pre-CS-701, snapshot-less) version rows but preserves theapprovedstatus, leavingcurrentVersionIdnull.hasApprovedVersionnow checkscurrentVersionId != null || status === 'approved', so those docs stay consistent (they capture a real versioned artifact on their next approval). Locked with a unit test.ScopeFormreads its defaults at mount; its remount key tracked the publishedcurrentVersionId, which doesn't change when the draft does. The key now reflectsdraftNarrative, so the form re-seeds on draft changes. (LeadershipForm already handled this via a reset effect; ScopeForm's narrative is a fresh object each render, so keying is the clean equivalent.)versionIdexports the working draft, but runtime serves the current published version when one exists. Description updated to match.v 2instead ofv2(JSX split thevand the number). Now a single expression.Not changed (by design)
The migration stays non-destructive (approvals preserved rather than reset to draft). The
hasApprovedVersionfix makes that state self-consistent, so no destructive reset or heavy backfill is needed for pre-GA (flag-gated) data.Testing
Follows up on #3361 (CS-701). Flagged in #3364.
🤖 Generated with Claude Code
https://claude.ai/code/session_012CweXoSSEP89mX93u3Bdcp
Summary by cubic
Fixes ISMS follow-ups from CS-701 versioning to keep approval state accurate and refresh scope text, plus minor UI/DTO copy corrections for a cleaner publish/export experience.
hasApprovedVersionnow true whencurrentVersionIdexists orstatus === 'approved'(covers pre-versioning approvals); adds unit test.draftNarrativechanges so generated/reloaded text appears immediately.versionIdexports the current published version, or the draft if never published.(v2)instead ofv 2.Written for commit c815b48. Summary will update on new commits.