Skip to content

LIB-982: Implement versioning workflows and clean up GitHub Actions in operator fork#14

Merged
KevinKlaesRackspace2 merged 4 commits into
mainfrom
LIB-982-implement-versioning-workflows-and-clean
Jul 13, 2026
Merged

LIB-982: Implement versioning workflows and clean up GitHub Actions in operator fork#14
KevinKlaesRackspace2 merged 4 commits into
mainfrom
LIB-982-implement-versioning-workflows-and-clean

Conversation

@KevinKlaesRackspace2

@KevinKlaesRackspace2 KevinKlaesRackspace2 commented Jul 13, 2026

Copy link
Copy Markdown

Description

Implements label-driven semver versioning for the percona-server-mongodb-operator fork, mirroring the pattern established in liberty-temporal-platform. This replaces manual version bumps with automated, PR-label-gated version management and removes irrelevant upstream Percona workflows.

What this does

New workflows:

  • auto-version-bump.yaml — On PR events with bump:patch/minor/major labels, automatically bumps pkg/version/version.txt and commits to the PR branch. Includes merge-conflict auto-resolution for the version file and skip logic when the version is already ahead of base.
  • label-check.yaml — Required status check that blocks merge on PRs with code changes unless a version label or skip-release is present.

Removed upstream cruft:

  • scan.yml (pushes to Percona's Docker Hub — not ours), stale.yml and labeler.yml (community PR management — not applicable), renovate.yaml (redundant with existing dependabot.yml), plus their config files (.github/labeler.yml, .github/pr-badge.yml).

Updated:

  • reviewdog.yml — Added github.com/objectrocket as company prefix for goimports-reviser; removed release-* branch conditional on the manifests check since we only use main.
  • pkg/version/version.txt — Updated from 1.22.0 to 1.22.0-1 to bootstrap the subversion scheme.
  • pkg/version/version.go — Added SubVersion() helper that parses the -N suffix from the version string.

Subversion scheme

Since 1.22.0 tracks the upstream Percona release we forked from, we can't meaningfully bump patch/minor/major in the traditional sense for our own changes. Instead, bump:patch increments a -N suffix (1.22.0-1 → 1.22.0-2 → ...). bump:minor and bump:major are reserved for upstream rebases (e.g., moving to 1.23.0-1). Image tags use this directly: 1.22.0-1-objectrocket.

Reviewer notes

  • The conflict-resolution step in auto-version-bump.yaml merges base into the PR branch when the only conflict is the version file, then immediately overwrites it with the computed bump. If non-version conflicts exist, it aborts. This matches the liberty-temporal-platform behavior.
  • label-check.yaml uses dorny/paths-filter@v4 pinned to v4 (not v3 like some other repos). This is intentional — v4 handles the pull_request event correctly without needing a checkout step.
  • The build-operator.yml workflow is unchanged. It already reads pkg/version/version.txt and its workflow_dispatch manual tag override continues to work as a fallback.
  • CRD patches and deploy manifests have minor diffs because make generate manifests regenerated them with the updated version string.

CHANGE DESCRIPTION

Problem:
Short explanation of the problem.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

CHECKLIST

Jira

  • LIB-982
  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

Add auto-version-bump.yaml that bumps pkg/version/version.txt based on
PR labels (bump:patch, bump:minor, bump:major). Implements subversioned
format X.Y.Z-N where bump:patch increments the -N suffix.

Add label-check.yaml that blocks merge when a PR with code changes
lacks a version label or skip-release label.

Both workflows use path filters scoped to operator code directories:
pkg/, cmd/, build/, config/, deploy/.
Remove workflows not applicable to our fork:
- scan.yml: builds to upstream Percona Docker Hub registry
- stale.yml: community PR management
- labeler.yml: community fork detection
- renovate.yaml: redundant with existing dependabot.yml

Remove associated config files:
- .github/labeler.yml: labeler workflow config
- .github/pr-badge.yml: upstream PR badge config
- Add github.com/objectrocket to goimports-reviser company prefixes
  alongside github.com/percona
- Remove release-* branch conditionals from manifests check since we
  only use the main branch. Always generate with VERSION=main.
Update pkg/version/version.txt to 1.22.0-1 as starting point for our
subversioned bumps. The -N suffix distinguishes our builds from
upstream Percona releases that use the same base version.

Update pkg/version/version.go:
- Version() now strips the -N suffix and returns base semver (1.22.0)
  for CRVersion feature-gating comparisons (hashicorp/go-version
  treats hyphens as prerelease identifiers)
- Add FullVersion() that returns the complete version string including
  subversion suffix, used for image tagging and CRD labels

Update version_test.go to use FullVersion() for CRD label validation.

Update CRD patches and generated deploy manifests to reflect v1.22.0-1.
@KevinKlaesRackspace2
KevinKlaesRackspace2 marked this pull request as ready for review July 13, 2026 19:50
@KevinKlaesRackspace2
KevinKlaesRackspace2 merged commit 93f11b3 into main Jul 13, 2026
13 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant