headroomlabs-ai/headroom · error · ValueError

Unsupported bump level: {level}

Error message

Unsupported bump level: {level}

What it means

Raised by SemVer.bump() when the level argument is anything other than 'major', 'minor', or 'patch'. The bump helper only implements the three standard increment strategies; anything else (including abbreviations or conventional-commit types like 'fix') is a programming error and fails fast.

Source

Thrown at headroom/release_version.py:68

    major: int
    minor: int
    patch: int

    @classmethod
    def parse(cls, value: str) -> SemVer:
        match = SEMVER_RE.match(value)
        if not match:
            raise ValueError(f"Invalid semantic version: {value}")
        return cls(*(int(part) for part in match.groups()))

    def bump(self, level: str) -> SemVer:
        if level == "major":
            return SemVer(self.major + 1, 0, 0)
        if level == "minor":
            return SemVer(self.major, self.minor + 1, 0)
        if level == "patch":
            return SemVer(self.major, self.minor, self.patch + 1)
        raise ValueError(f"Unsupported bump level: {level}")

    def __str__(self) -> str:
        return f"{self.major}.{self.minor}.{self.patch}"


@dataclass(frozen=True)
class ReleaseVersionInfo:
    """Workflow outputs for release version calculation."""

    version: str
    npm_version: str
    canonical: str
    height: str
    bump: str
    previous_tag: str

    def as_outputs(self) -> dict[str, str]:
        return {

View on GitHub (pinned to 322425c43b)

Solutions

  1. Translate conventional-commit types to bump levels: 'feat' -> 'minor', 'fix' -> 'patch', breaking change -> 'major'.
  2. Use exactly the lowercase strings 'major', 'minor', or 'patch'.
  3. Default unset CI inputs to 'patch' before calling bump().

Example fix

# before
level = 'feat'
new_version = version.bump(level)

# after
level = {'feat': 'minor', 'fix': 'patch', 'break': 'major'}[commit_type]
new_version = version.bump(level)
Defensive patterns

Strategy: validation

Validate before calling

BUMP_LEVELS = {'major', 'minor', 'patch'}
COMMIT_TO_BUMP = {'feat': 'minor', 'fix': 'patch', 'break': 'major'}
level = COMMIT_TO_BUMP.get(commit_type, 'patch')
assert level in BUMP_LEVELS

Type guard

def is_bump_level(level: str) -> bool:
    return level in ('major', 'minor', 'patch')

Try / catch

try:
    new_version = version.bump(level)
except ValueError:
    level = 'patch'  # or fail the release job explicitly
    new_version = version.bump(level)

Prevention

When it happens

Trigger: Calling version.bump('fix'), version.bump('MAJOR'), version.bump('pre'), or passing a conventional-commit type straight from a commit message into bump().

Common situations: Mapping conventional commit labels (feat/fix) directly to bump levels without translating to minor/patch; case sensitivity ('Major' fails); passing None or an empty string from an unset CI input.

Related errors


AI-assisted analysis of headroomlabs-ai/headroom@322425c43b (2026-08-15). Data as JSON: /api/errors/677c59a1d641d42d. Report an issue: GitHub.