Navigation: Documentation Index · Configuration Reference · CLI Reference · Failure Matrix
This guide covers upgrading Versionings across major feature phases. Each section describes what changed, lists new configuration fields and exit codes, and provides step-by-step migration instructions.
P1 introduced a structured CLI with subcommands and a multi-source configuration system.
- Subcommands: The CLI now exposes dedicated subcommands:
init,validate,plan,release,rollback, anddoctor. Each subcommand has its own set of parameters and behavior. - Configuration hierarchy: Configuration is loaded from 6 sources in order of ascending priority:
- Built-in defaults
version.json- RC files (
.versioningsrc,.versioningsrc.json,.versioningsrc.yml,.versioningsrc.yaml) "versionings"key inpackage.json- Environment variables with
VERSIONINGS_prefix - CLI flags
- New exit codes:
8(NO_OPERATION) — the requested operation had nothing to do (e.g., version already at target)9(USER_CANCELLED) — the user cancelled an interactive prompt
- Update any scripts that call
versioningsdirectly. The bare invocationversionings --semver=<type> --branch=<name>still works (it maps torelease), but prefer explicit subcommands:
# Before (P0)
versionings --semver=patch --branch=my-feature
# After (P1) — explicit subcommand
versionings release --semver=patch --branch=my-feature- Review configuration sources. If you have settings in multiple places (e.g.,
version.jsonand environment variables), verify the precedence order produces the expected result:
versionings validate --json-
Update CI scripts to handle new exit codes
8and9in addition to0–7. See the Failure Matrix for details on each code. -
Use
versionings doctorto verify your environment is correctly configured:
versionings doctorP2 added support for multiple SCM platforms and automated PR/MR creation via platform APIs.
- New platforms: In addition to
githubandbitbucket, Versionings now supportsgithub-enterprise,bitbucket-server,gitlab, andazure-devops. - PR/MR creation via API: The
--pr-modeflag controls how pull requests are created:auto— API call with fallback to browser URLapi— API only, fails if unavailableurl— Opens browser with pre-filled PR URL
- New configuration fields:
git.apiUrl— API endpoint for self-hosted platformsgit.auth.token— authentication tokengit.auth.method— authentication method (tokenorbearer)git.api.timeout— API request timeout in milliseconds (default:30000)git.pr.reviewers— array of reviewer usernamesgit.pr.labels— array of labels to applygit.pr.draft— create PR as draft (default:false)git.pr.template— path to PR body template filegit.pr.milestone— milestone to assigngit.pr.linkedIssues— array of issue identifiers to link
- Set
git.platformto match your SCM provider. For example, to switch from the default GitHub Cloud to GitLab:
{
"git": {
"platform": "gitlab",
"url": "https://gitlab.com/my-org/my-repo.git",
"apiUrl": "https://gitlab.com/api/v4"
}
}- Configure authentication. Provide a token via config, environment variable, or platform-specific variable:
# Option 1: Environment variable (recommended for CI)
export VERSIONINGS_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"
# Option 2: Platform-specific variable
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"- If you use PR automation, configure the desired PR parameters:
{
"git": {
"platform": "gitlab",
"url": "https://gitlab.com/my-org/my-repo.git",
"pr": {
"target": "main",
"reviewers": ["alice", "bob"],
"labels": ["release"],
"draft": false
}
}
}- Validate the new configuration:
versionings validate --jsonSee the SCM Provider Guide for platform-specific setup instructions.
P3 introduced pluggable branching strategies and a Policy Checker that validates branch names against strategy rules.
- 6 branching strategies:
default,trunk-based,git-flow,release-branch,hotfix,maintenance. Each strategy defines its own branch naming, tag naming, and allowed semver types. - New configuration section
git.branching:git.branching.strategy— one of the 6 strategies (default:default)git.branching.branchTemplate— custom branch name templategit.branching.tagTemplate— custom tag name templategit.branching.mainBranch— primary branch name (default:master)git.branching.developBranch— development branch name (default:develop)
- Policy Checker: Validates that branch and tag names conform to the selected strategy before any mutation occurs.
- New exit code:
10(POLICY_VIOLATION) — a branch or tag name violates the active strategy's naming policy
-
Choose a branching strategy that matches your team's workflow. See the Branch Strategy Cookbook for a comparison and examples.
-
Add the
git.branchingsection to your configuration:
{
"git": {
"platform": "github",
"url": "https://github.com/my-org/my-repo.git",
"branching": {
"strategy": "git-flow",
"mainBranch": "main",
"developBranch": "develop"
}
}
}Equivalent YAML (.versioningsrc.yml):
git:
platform: github
url: https://github.com/my-org/my-repo.git
branching:
strategy: git-flow
mainBranch: main
developBranch: develop- Run a dry-run to verify branch and tag naming under the new strategy:
versionings plan --semver=minor --branch=my-feature- Update CI scripts to handle exit code
10(POLICY_VIOLATION). See the Failure Matrix for troubleshooting.
P4 added Conventional Commits parsing, automatic semver bump detection, and changelog generation.
- New subcommand:
changelog— generates a changelog from commit history. - Conventional Commits parsing: Commit messages following the
<type>[(<scope>)][!]: <description>format are parsed to determine the semver bump level automatically. --semver=auto: Analyzes commit history since the last tag and determines the appropriate bump (major,minor, orpatch) based on conventional commit types and breaking change indicators.- New configuration sections:
conventionalCommits.enabled— enable/disable parsing (default:true)conventionalCommits.types— custom mapping of commit types to bump levelsconventionalCommits.fallbackBump— bump level when no conventional commits are found (default:patch)changelog.template— changelog entry templatechangelog.groupTitles— custom group headings by commit typechangelog.excludeTypes— commit types to exclude from changelogchangelog.includeNonConventional— include non-conventional commits (default:false)changelog.file— path to changelog file for automatic updates on release
- New exit code:
11(NO_CONVENTIONAL_COMMITS) —--semver=autowas used but no conventional commits were found andfallbackBumpisnull
- Enable Conventional Commits support (enabled by default). To customize the type-to-bump mapping:
{
"conventionalCommits": {
"enabled": true,
"types": {
"feat": "minor",
"fix": "patch",
"perf": "patch",
"refactor": "patch"
},
"fallbackBump": "patch"
}
}- Configure changelog generation if desired:
{
"changelog": {
"file": "CHANGELOG.md",
"groupTitles": {
"feat": "Features",
"fix": "Bug Fixes",
"perf": "Performance"
},
"excludeTypes": ["chore", "docs", "style"],
"includeNonConventional": false
}
}- Try automatic bump detection with a dry-run:
versionings plan --semver=auto --branch=my-feature- Generate a changelog preview:
versionings changelog --from=v1.0.0 --to=HEAD- Update CI scripts to handle exit code
11(NO_CONVENTIONAL_COMMITS). See the Failure Matrix for details.
See the Changelog Format Guide for full configuration options.
P5 added structured logging, operation IDs, actor metadata, action trace, and concurrency lock.
- Structured logging: All log output is now JSON-formatted and directed to stderr. The
--verboseflag enablesdebug-level logging. A configurablelogLevelfield controls the minimum level. - Operation ID: Every CLI invocation generates a UUID v4 that appears in all log messages and audit entries.
- Actor metadata: Git user name, email, hostname, and CI actor are captured and stored in the audit log.
- Action trace: Each pipeline step is timed. Trace data is stored in the audit log and
totalDurationMsis included in JSON output. - Audit log v2: Operation log entries now use
schemaVersion: 2with additional fields:operationId,actor,trace,environment,command. Entries withschemaVersion: 1are read without errors. - Concurrency lock: A lock file (
.versionings/lock) prevents parallel releases. Stale locks are auto-detected via PID check (local) or timeout (CI). - New configuration fields:
logLevel— log verbosity:debug,info,warn(default),errorlockTimeoutMs— lock timeout in milliseconds (default:300000)
-
No breaking changes. Existing configurations work without modification.
-
To enable structured logging, set
logLevelin your configuration:
{
"logLevel": "info"
}- To adjust lock timeout for long-running CI pipelines:
{
"lockTimeoutMs": 600000
}- Add
.versionings/to your.gitignoreif not already present:
.versionings/
- Validate the updated configuration:
versionings validate --jsonSee the Operational Hardening Guide for full details.
P6 reorganized the source code from a flat root structure into src/ with domain subdirectories. This is a developer-facing change only — CLI behavior is unchanged.
- Source structure: All TypeScript source files moved from the project root into
src/with 7 domain directories:cli/,core/,config/,scm/,branching/,versioning/,utils/. - Test structure: Unit and property tests reorganized into mirrored domain subdirectories within
__tests__/unit/and__tests__/properties/. - Build output: Changed from
dist/version.jstoout/dist/index.js. Thebinentry inpackage.jsonupdated accordingly. - TypeScript config:
rootDirchanged tosrc,includechanged tosrc/**/*.ts.
-
Update any local scripts that reference source files by path.
-
If you have custom IDE configurations pointing to root-level
.tsfiles, update them tosrc/. -
Pull the latest changes and run:
npm install
npm run build
npm testNo action required. The CLI binary, configuration format, and all commands remain identical.
Versionings maintains backward compatibility across all phase transitions:
The legacy invocation without a subcommand continues to work and is treated as release:
# Legacy syntax (still supported)
versionings --semver=patch --branch=my-feature
# Equivalent explicit syntax
versionings release --semver=patch --branch=my-featureA version.json file that only contains P0-era fields (e.g., git.platform and git.url) passes validation and works with default behavior. New configuration sections are optional:
- Without
git.branching— thedefaultstrategy is used - Without
conventionalCommits— conventional commit parsing is enabled with default type mappings - Without
changelog— no changelog file is written on release
Exit codes are additive. Codes 0–7 from P0 retain their original meaning across all phases:
| Phase | Exit Codes | New Codes Added |
|---|---|---|
| P0 | 0–7 | — |
| P1 | 0–9 | 8 (NO_OPERATION), 9 (USER_CANCELLED) |
| P3 | 0–10 | 10 (POLICY_VIOLATION) |
| P4 | 0–11 | 11 (NO_CONVENTIONAL_COMMITS) |
| P5 | 0–11 | — (no new exit codes) |
| P6 | 0–11 | — (no new exit codes) |
CI scripts that only check for exit code 0 (success) vs non-zero (failure) continue to work without changes.
After upgrading Versionings, run the following checks to verify everything works correctly:
versionings doctorConfirms that Node.js, npm, Git, and the remote are properly configured.
versionings validate --jsonVerifies that your configuration file is valid against the current schema and all required fields are present.
versionings plan --semver=patch --branch=test-migrationRuns the full release workflow without making any changes. Confirms that branching strategy, naming templates, and artifact checks work as expected.
| Check | Command | Expected Outcome |
|---|---|---|
| Environment health | versionings doctor |
All checks pass |
| Config validity | versionings validate --json |
Exit code 0, no errors |
| Dry-run workflow | versionings plan --semver=patch --branch=test |
Exit code 0, plan output shown |
| Branch naming | Review plan output |
Names match selected strategy |
| SCM authentication | versionings validate --json |
No auth warnings |
If any check fails, consult the Failure Matrix for the corresponding exit code and resolution steps.