Skip to content

Action Versioning

Mantis uses semantic versioning for actions, ensuring controlled updates and reproducible deployments.

Actions follow Semantic Versioning 2.0:

MAJOR.MINOR.PATCH
│ │ │
│ │ └── Bug fixes (backward compatible)
│ └──────── New features (backward compatible)
└────────────── Breaking changes
Version ChangeTypeDescription
1.0.01.0.1PatchBug fix in script
1.0.01.1.0MinorAdded optional argument
1.0.02.0.0MajorChanged required arguments

Same version = same behavior:

If a new version causes issues:

  1. Identify the working previous version
  2. Update sequence to require that version
  3. Deploy with confidence

Every deployment records exactly which action version was used.

ScenarioVersion Bump
Fix a bug in the scriptPatch (x.x.1)
Add a new optional argumentMinor (x.1.x)
Optimize performancePatch (x.x.1)
Add new functionalityMinor (x.1.x)
Change existing argument namesMajor (1.x.x)
Remove an argumentMajor (1.x.x)
Change script behaviorMajor (1.x.x)
  1. Navigate to the action detail page
  2. Click Add Version
  3. Enter the new version number
  4. Modify the payload or arguments
  5. Click Create Version
┌─────────────────────────────────────────────────────────┐
│ Action: deploy-webapp │
├─────────────────────────────────────────────────────────┤
│ │
│ Versions: │
│ ┌─────────┬──────────┬───────────┬────────────────┐ │
│ │ Version │ Type │ Executor │ Created │ │
│ ├─────────┼──────────┼───────────┼────────────────┤ │
│ │ 2.0.0 │ script │ bash │ Today │ │
│ │ 1.1.0 │ script │ bash │ 2 weeks ago │ │
│ │ 1.0.0 │ command │ │ 1 month ago │ │
│ └─────────┴──────────┴───────────┴────────────────┘ │
│ │
│ [+ Add Version] │
│ │
└─────────────────────────────────────────────────────────┘

This ensures:

  • Deployments using v1.0.0 always get the same behavior
  • Audit trails are accurate
  • Rollbacks are reliable
  • Payload content
  • Argument definitions
  • Environment variables
  • Executor type
  • Add new versions (versions themselves are fully immutable once created)

When adding actions to sequences, you specify a version requirement:

RequirementMeaningMatches
^1.0.0Compatible with 1.x.x1.0.0, 1.5.3, 1.9.9
~1.5.0Patch updates only1.5.0, 1.5.1, 1.5.99
>=1.2.0This version or higher1.2.0, 2.0.0, 3.1.0
=1.2.3Exact version only1.2.3
>=1.0.0,<2.0.0Range1.0.0 through 1.x.x

Use caret (^) requirements for most cases:

^1.0.0 # Get bug fixes and minor updates automatically

Use exact (=) requirements when:

  • Regulatory compliance requires pinning
  • Testing a specific version before upgrade
  • Working around a known issue

When a deployment runs, Mantis resolves version requirements:

  1. Find all versions matching the requirement
  2. Select the highest matching version
  3. Record the resolved version in deployment logs

Don’t start at 0.x.x for production actions:

Good: 1.0.0 → 1.0.1 → 1.1.0 → 2.0.0
Bad: 0.0.1 → 0.0.2 → 0.1.0 → 1.0.0

Test new versions in lower environments:

Design actions for forward compatibility:

Instead of:

v1.0.0: Required args: [name]
v2.0.0: Required args: [name, region] # Breaking!

Do:

v1.0.0: Required args: [name]
v1.1.0: Optional args: [name, region] # Non-breaking

Action names should be stable across versions:

Good: deploy-webapp (versions 1.0.0, 1.1.0, 2.0.0)
Bad: deploy-webapp-v1, deploy-webapp-v2, deploy-webapp-new

The action detail page shows:

  • All versions with version number, payload type, executor, and creation date