Sr versions#3382
Draft
jmthomas wants to merge 8 commits into
Draft
Conversation
Enable bucket versioning on OPENC3_CONFIG_BUCKET via versitygw, threading a sibling /versions volume + VGW_VERSIONING_DIR through the openc3-buckets image and entrypoint. Add list_object_versions and version_id-aware get/head/delete to AwsBucket. Introduce ScriptLifecycleModel to track per-version state (saved/validated/reviewed/executed) with usernames and timestamps; saves over a reviewed version return 409 unless force_taint is sent, in which case the new version is flagged with provenance back to the prior reviewer. Auto-validate inline on save (syntax + mnemonic) to record validated_at for API-driven saves. Remove Script.lock entirely along with the editor-locking UI now that versioning eliminates overwrite risk. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add four new endpoints under /script-api/scripts/*name: GET versions (S3 versions merged with lifecycle metadata, newest-first), GET version (body of a specific version_id), POST restore (re-PUT a historical body with the same review-lock + force_taint semantics as save), and POST review (sign-off, gated by a new can_approve_script? predicate that's no-op in Core and overridable in Enterprise's existing Authorization module). Sign-off requires the supplied version_id to match the current latest_version_id, returning 409 version_mismatch if the script was edited between display and click. Refactor ScriptLifecycleModel into nested validated/reviewed blocks plus a richer executions array (disconnect, environment, suite_runner, running_script_id) so the UI can render three independent badges (validated/reviewed/executed) that fill in with metadata as each facet acquires data. Final execution status stays in ScriptStatusModel — dereferenced via running_script_id — to avoid cross-process writes from the spawned RunningScript. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add three lifecycle badges (validated/reviewed/executed) to the Script Runner toolbar, each greyed out and filling in with status as its facet acquires data. Reviews now carry a decision (approved | changes_requested); only approved decisions lock the script for further saves. The reviewed badge renders bright green on approval, dull green when an earlier version was approved but the current isn't, and red on changes_requested. Executed badge dereferences the latest run's running_script_id against ScriptStatusModel and colors by terminal state (green/yellow/red), with a live tonal-blue while the user is running it in-session. Combine the Script -> Syntax Check and Mnemonic Check menu items into a single Script -> Validate that records the result on the validated block, and surface validation failures from the inline auto-validate-on-save in the same dialog. Replace the now-removed Script.lock UI with a 409 locked_for_review handler that prompts the user to taint, plus a sign-off dialog with separate Approve and Request Changes buttons. Bug fix: save-on-Start triggered the locked_for_review 409 even when the content was unchanged. Frontend now skips non-menu saves when nothing has been modified, and the controller treats identical-body saves as no-ops that bypass the lock check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…ly lock
Add a Version History dialog with side-by-side ace-diff and per-version
restore (with the same force_taint flow as save) under Script -> Version
History. Routes reordered so the GET catchall doesn't swallow the new
specific paths (/versions, /version, /latest), and the diff dialog uses
absolute positioning anchored to its column so ace-diff's editors can't
push the title bar off screen.
Capture the plugin-installed baseline on first edit: copy targets/{name}
to targets_modified/{name} before the user's first save and record it as
saved_by '<original>' so the original content shows up as V1 in history
and is restorable.
Lock the editor read-only when the latest version is approved. A yellow
banner above the editor shows the reviewer + notes with "View History"
and "Edit Anyway" buttons; clicking Edit Anyway flips a per-session
override that auto-applies force_taint on the next save. After the save
lands the lock releases naturally as the new version isn't reviewed.
Polling endpoint /scripts/*name/latest now returns the full latest
lifecycle so reviewed/executed badges update in near-real-time when one
user signs off or runs a script while another is watching the same
version. Frontend mirrors the polled lifecycle only when on the latest
version, and re-fetches ScriptStatusModel state for the badge color
when a new running_script_id appears.
Defensive AWS error handling on /version and /restore — Aws::Errors::
ServiceError (e.g. Invalid version id specified from real-S3/MinIO when
a null-version-marker is fetched) now returns 404 with the backend's
reason instead of a 500. Bucket policy for the SR user gains s3:Get
ObjectVersion and s3:ListBucketVersions so version reads survive in
permission-enforcing backends.
Other UI polish: tainted toolbar chip removed (the reviewed badge alone
conveys the lock state); diff pane has a close X and re-clicking the
active version closes it; validation failures pop the same dialog as
Script -> Validate when surfaced from inline auto-validate-on-save.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3382 +/- ##
==========================================
- Coverage 78.87% 78.76% -0.11%
==========================================
Files 687 687
Lines 57285 57383 +98
Branches 728 728
==========================================
+ Hits 45184 45199 +15
- Misses 12023 12106 +83
Partials 78 78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jmthomas
commented
May 18, 2026
| command: () => { | ||
| this.showVersionHistory = true | ||
| }, | ||
| }, |
Member
Author
There was a problem hiding this comment.
Rather than a hidden menu option should this be a front and center history icon?
|
Member
Author
|
I'd like to experiment with a git based system before merging this bucket version based system |
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.



Still needs some playwright tests and code reviews but this is the effect:
