Skip to content

feat(automation): add version listing and rollback support - #3200

Draft
ppatel9703 wants to merge 4 commits into
devfrom
feat-automation-version-history
Draft

ppatel9703 wants to merge 4 commits into
devfrom
feat-automation-version-history

Conversation

@ppatel9703

@ppatel9703 ppatel9703 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds project-owned version history and forward-only restore support for Automation definitions.

Automation graph JSON and owned developer.python sources continue to live in the Automation project's standard Git repository. Listing reads that history; restoring reads a validated historical aggregate and saves it through the existing Automation save boundary, creating a new commit instead of rewinding Git history.

Companion UI: SEMOSS/semoss-ui#3800

Flow

flowchart LR
    Save[Save Automation] --> Validate[Validate graph and node sources]
    Validate --> Persist[Persist Automation-owned assets]
    Persist --> Commit[Create project Git commit]

    List[List versions] --> ViewACL[Require project view access]
    ViewACL --> History[Read bounded Automation-only Git history]

    Restore[Restore selected version] --> EditACL[Require project edit access]
    EditACL --> Concurrency[Verify expected current revision]
    Concurrency --> Reachable[Require full reachable Automation commit]
    Reachable --> Read[Read graph and developer sources]
    Read --> Validate
    Commit --> Audit[Record successful Automation update]
Loading

Changes

  • Adds ListAutomationVersions, returning up to 100 newest Automation revisions with author, timestamp, message, and full commit SHA.
  • Adds RollbackAutomation, requiring the selected full SHA and the current definition revision.
  • Filters history to commits that changed the Automation workflow definition or Automation-owned developer-node sources.
  • Restores the full saved aggregate: graph JSON plus required developer.python sources.
  • Reuses AutomationProjectService.saveDefinition for locking, validation, persistence, MCP synchronization, and revision calculation.
  • Writes restores as new forward commits with operation-specific messages; it does not reset or rewrite project history.
  • Makes Automation asset commit failures visible to the caller instead of reporting a successful save without durable history.
  • Corrects JGit timestamp conversion from epoch seconds to epoch milliseconds.
  • Returns the restored revision, globals, node sources, and scope-variable catalog expected by the editor refresh path.

Authorization and correctness

  • Authentication is required for both reactors.
  • Version listing uses the existing Automation project view-access boundary.
  • Restore uses the existing Automation project edit-access boundary.
  • Restore accepts only a full SHA reachable from the current project HEAD that actually changed Automation-owned assets.
  • expectedRevision provides optimistic concurrency so a stale dialog cannot overwrite newer edits.
  • Historical definitions are revalidated before saving.
  • Audit events are written only after a successful restore.
  • Git operations remain scoped to Automation-owned project paths.

Tests

Focused unit coverage includes:

  • Automation-only history filtering, full identifiers, limits, and timestamps.
  • Graph and developer-source restoration.
  • Missing source, unrelated commit, invalid revision, and unreachable revision rejection.
  • View/edit authorization and required inputs.
  • Optimistic-concurrency forwarding and success-only audit behavior.
  • Project-Git commit messages and surfaced commit failures.

Manual integration validation after an Eclipse rebuild confirmed:

  • Version history returned ten saved revisions with correct 2026 timestamps.
  • ListAutomationVersions completed successfully through Pixel.
  • Restore confirmation could be opened and canceled without modifying the Automation.

Reviewer test

  1. Build/restart the backend through Eclipse.
  2. Open an Automation project with several saved edits.
  3. Call ListAutomationVersions(project=["<project-id>"], limit=["100"]); and confirm newest-first Automation revisions.
  4. From the companion UI, select an older revision on a disposable Automation and confirm restore.
  5. Verify the restored graph reloads and a new restore commit appears at the top of history.
  6. Open the same Automation in two sessions, save in one, and verify the stale restore in the other is rejected.

Out of scope

  • Git history for non-Automation project assets.
  • Branch creation, hard reset, or history rewriting.
  • Run-history rollback or restoration of runtime data.
  • BPMN, FEEL, and unrelated Automation execution changes.

@snyk-io

snyk-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant