Skip to content

Centralize version type handling in the build system - #6237

Merged
makr-code merged 1 commit into
developfrom
copilot/define-version-types
Sep 1, 2026
Merged

Centralize version type handling in the build system#6237
makr-code merged 1 commit into
developfrom
copilot/define-version-types

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Pull Request

For EPIC-branch workflow PRs, use .github/PULL_REQUEST_TEMPLATE/epic-branch-flow.md.
This applies to both feature/* -> epic/* and epic/* -> develop integration PRs.

Target Version (Required)

Target Version: [Unreleased]

This is a build-system and metadata change that should land on the next unreleased development line rather than a patch release.


Description

The build system now derives a normalized version type from the repository VERSION file alongside the numeric version, so prerelease identifiers such as alpha, beta, rc1, nightly, and unstable are handled consistently.

  • Centralized version parsing in cmake/Versions.cmake so both the numeric version and the version type are resolved from one source of truth.
  • Exposed THEMIS_VERSION_TYPE (and the numeric version) through CMake cache values and compile definitions for broader build-time consumers.
  • Propagated the version type into generated build-info metadata so build provenance and runtime-facing version strings can use the same classification.

Linked Issues

  • N/A

Type of Change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Refactoring (non-breaking)
  • Documentation
  • Breaking change (requires MAJOR version bump — see VERSIONING.md)
  • Security fix
  • Other:

Breaking Change Checklist

  • MAJOR version bump planned in VERSION and CMakeLists.txt
  • Migration guide added in docs/migration/
  • Announcement prepared for GitHub Discussions (≥ 2 weeks before release)
  • CHANGELOG ### Removed / ### Changed section updated

Testing

  • Manual testing performed
    • Validated the updated version parsing and build metadata flow through CMake configure for prerelease-style version inputs.

Security Tiering Impact (Required for Runtime Changes)

  • Impacted tier(s):

    • T0 Trusted Core
    • T1 Security & Platform Services
    • T2 Data Plane Engines
    • T3 Interface & Protocol Edge
    • T4 Managed Extension Runtime
    • T5 Plugin Boundary
    • N/A (docs-only / non-runtime)
  • Trust-boundary crossings documented in PR description (example: T3 -> T2, T5 -> T4 brokered call)

  • Boundary controls validated for affected T3/T4/T5 paths (AuthN/AuthZ, validation, rate limits, audit)

  • Boundary-focused tests added/updated or explicit N/A rationale provided

  • If trust level/privilege increased, security maintainer approval is attached

📚 Research & Knowledge (wenn applicable)

  • Diese PR basiert auf wissenschaftlichen Paper(s) oder Best Practices?
    • Falls JA: Research-Dateien in /docs/research/ angelegt?
    • Falls JA: Im Modul-README unter "Wissenschaftliche Grundlagen" verlinkt?
    • Falls JA: In /docs/research/implementation_influence/ eingetragen?

Relevante Quellen:

  • Paper:
  • Best Practice:
  • Architecture Decision:

AI-Generated Code (KI-generierter Code)

  • Symbol-Referenzen mit GetSymbolReferences_CppTools geprüft (siehe .github/instructions/cpp-language-service-tools.instructions.md)
  • Keine rohen Pointer und kein new/delete ohne explizites Review eingeführt
  • RAII und Exception-Safety für neue/angepasste Pfade geprüft
  • Keine unnötig komplexen KI-Abstraktionen eingeführt
  • Performance-Metriken geprüft, falls Hotpath betroffen

AI Review Workflow (Required for AI-assisted PRs)

  • Findings-first review performed with .github/prompts/pr-diff-findings-review.prompt.md
  • Security hardening review performed for security-sensitive/runtime changes with .github/prompts/security-hardening-review.prompt.md (or N/A documented)
  • API impact review performed for API/contract changes with .github/prompts/api-change-impact-review.prompt.md (or N/A documented)
  • All Critical/High findings are resolved or explicitly accepted with rationale in PR description
  • Residual risks and follow-up actions documented in PR description
  • Severity policy applied according to .github/copilot/REVIEW_SEVERITY_POLICY.md

High-Finding Exception Record (only if High is accepted)

  • High-finding exception claimed in this PR

  • Finding reference:

  • Maintainer approver:

  • Mitigation in current release:

  • Target fix milestone:

  • Tracking issue:

  • Validation evidence:

Release Readiness Gate (Required for release-scoped changes)

  • Release readiness reviewed with .github/prompts/release-readiness-check.prompt.md for branch transition scope
  • Branch governance validated against BRANCHING_STRATEGY.md and RELEASE_STRATEGY.md
  • Versioning/changelog impact validated against VERSIONING.md and CHANGELOG.md

Checklist

  • Code follows project style guidelines (clang-format / clang-tidy)
  • Self-review completed
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased]
  • No new warnings introduced
  • Security-sensitive paths reviewed by security maintainer (if applicable)

Scanner and IntelliSense Gates

  • IntelliSense/Compiler: no new errors in changed files
  • clang-tidy/cppcheck: no new high-risk findings in changed files
  • Gap Scanner: no new critical findings in categories security, input_validation, query_correctness, distributed_consistency, concurrency, memory
  • Gap Scanner: no new high findings in the same categories (or explicitly approved)
  • Gap Scanner delta report attached (baseline vs current), not only absolute totals
  • New unknown scanner findings triaged (fixed, re-categorized, or justified)

Co-authored-by: makr-code <150588092+makr-code@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 15:52
@makr-code
makr-code marked this pull request as ready for review September 1, 2026 15:54
@makr-code
makr-code self-requested a review as a code owner September 1, 2026 15:54
@github-actions github-actions Bot added type:ci CI/CD or build system change type:build Build system or dependency change labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Wave C Policy Gate: Hash & SBOM Integrity

Result: ✅ Hash & SBOM Integrity PASSED
Workflow run: #33528418137
Triggered by: @Copilot

Checks

  • ✅ Dependency hash integrity check
  • ✅ SBOM generation and registry consistency
  • ✅ Edition-correct SBOM composition
  • ✅ Private plugin variance detection
  • ℹ️ Approved SBOM registry: docs/governance/SBOM_APPROVED_VERSIONS.md

See .github/workflows/gate-pr-hash-sbom.yml for details.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Wave C Policy Gate: Edition & License Validation

Result: ✅ Edition & License Validation PASSED
Workflow run: #33528418137
Triggered by: @Copilot

Checks

  • ✅ Edition matrix consistency check
  • ✅ License feature gate validation
  • ✅ Enterprise/military marker detection
  • ℹ️ Target branch: develop

See .github/workflows/gate-pr-edition-license.yml for details.

@makr-code
makr-code merged commit 67c4168 into develop Sep 1, 2026
35 of 40 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

As written, it can break configuration/packaging flows (undefined _ver_numeric and unstable VERSION resolution via CMAKE_SOURCE_DIR) and the BuildInfo propagation does not match the stated “generated build-info metadata” behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR centralizes semantic version parsing in the CMake build system by deriving both the numeric MAJOR.MINOR.PATCH and a normalized prerelease “version type” from the repository VERSION file, then exposing these values to the build via cache variables and compile definitions.

Changes:

  • Move version parsing to cmake/Versions.cmake and switch project(VERSION ...) to use THEMIS_VERSION_NUMERIC.
  • Introduce and expose THEMIS_VERSION_TYPE (normalized from prerelease identifiers) as a cache value and compile definition.
  • Propagate version type into build-info compile definitions and configure-time status output.
File summaries
File Description
CMakeLists.txt Switches top-level version resolution to cmake/Versions.cmake and uses THEMIS_VERSION_NUMERIC for project().
cmake/Versions.cmake Adds parsing/normalization for THEMIS_VERSION_TYPE and exports version data via cache + compile defs.
cmake/CMakeLists.txt Replaces inline VERSION parsing with Versions.cmake and forwards the new version variables to compile defs.
cmake/BuildInfo.cmake Adds THEMIS_VERSION_TYPE to build-info compile definitions and prints it in the BuildInfo banner.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakeLists.txt
Comment on lines 35 to 39
# Read VERSION first (before project())
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
message(FATAL_ERROR "VERSION file not found at ${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
include(cmake/Versions.cmake)
if(NOT DEFINED THEMIS_VERSION_NUMERIC OR "${THEMIS_VERSION_NUMERIC}" STREQUAL "")
message(FATAL_ERROR "Version metadata could not be resolved from ${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
endif()
Comment thread cmake/Versions.cmake
Comment on lines 5 to 11
# Read VERSION from project root
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/VERSION")
message(FATAL_ERROR "VERSION file not found at ${CMAKE_SOURCE_DIR}/VERSION")
endif()

file(READ "${CMAKE_SOURCE_DIR}/VERSION" THEMIS_VERSION_STRING)
string(STRIP "${THEMIS_VERSION_STRING}" THEMIS_VERSION_STRING)
Comment thread cmake/BuildInfo.cmake
Comment on lines 64 to 68
list(APPEND THEMIS_GLOBAL_COMPILE_DEFINITIONS
THEMIS_BUILD_UUID="${THEMIS_BUILD_UUID}"
THEMIS_BUILD_VERSION_STRING="${THEMIS_BUILD_VERSION_STRING}"
THEMIS_VERSION_TYPE="${THEMIS_VERSION_TYPE}"
)

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Checkout repository

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Wave C Policy Gate: Community Fail-Closed Validation

Result: ✅ Community Fail-Closed Validation PASSED
Workflow run: #33528418137
Triggered by: @Copilot

Checks

  • ✅ No silent fallback patterns
  • ✅ License disclaimers present
  • ✅ No unguarded telemetry/tracking
  • ✅ No private plugin references in community/minimal scope
  • ✅ Community-only build config validation
  • ✅ No enterprise secrets leakage

See .github/workflows/gate-pr-community-failclosed.yml for details.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Wave C Policy Gate: Private Plugin Boundary Enforcement

Result: ✅ Private Plugin Boundary Enforcement PASSED
Workflow run: #33528418137
Triggered by: @Copilot

Checks

  • ✅ Private plugin leakage detection
  • ✅ Plugin manifest visibility validation
  • ✅ Submodule commit-pin enforcement (no branch refs for private)

See .github/workflows/gate-pr-plugin-boundary.yml for details.

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

Labels

type:build Build system or dependency change type:ci CI/CD or build system change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants