Skip to content

Implement enhanced multi-component version separation system#38

Merged
DutchmanNL merged 5 commits intomainfrom
copilot/fix-33
Sep 19, 2025
Merged

Implement enhanced multi-component version separation system#38
DutchmanNL merged 5 commits intomainfrom
copilot/fix-33

Conversation

Copy link
Contributor

Copilot AI commented Sep 19, 2025

This PR implements a comprehensive version separation system that allows different components (GitHub Actions, templates, snippets) to have independent versioning while maintaining strict governance for the main package version.

Key Changes

Enhanced Metadata Structure

The config/metadata.json file now includes a complete component registry with individual version tracking:

{
  "version": "0.4.0",
  "warning": "⚠️  CHANGING THE MAIN VERSION ABOVE WILL TRIGGER AUTOMATED PACKAGE UPDATE DEPLOYMENT",
  "components": {
    "github_actions": {
      "weekly_version_check": {
        "version": "0.2.1",
        "file": "templates/weekly-version-check-action.yml",
        "description": "GitHub Action for automated template version monitoring"
      }
    }
  },
  "version_policy": {
    "main_version_source": "template.version",
    "increment_policy": "must_be_higher_than_previous",
    "deployment_trigger": "main_version_change"
  }
}

Enhanced Version Management

New commands added to scripts/manage-versions.sh:

# List all components with their versions
./scripts/manage-versions.sh list-components

# Update individual component versions independently
./scripts/manage-versions.sh update-component github_actions.weekly_version_check 0.2.2

# Validate version increments (prevents downgrades)
./scripts/manage-versions.sh validate-increment main 0.4.0 0.5.0

Automated Deployment Pipeline

New workflow .github/workflows/deploy-on-version-change.yml automatically triggers when the main version changes, including:

  • Version increment validation
  • Metadata consistency checks
  • Complete test suite execution
  • Automatic git tagging
  • Deployment summary generation

Version Policy Enforcement

  • Main package version always matches template version (enforced)
  • All version changes must be incremental (no downgrades)
  • Component versions operate independently of main version
  • Prominent warnings when changing main version (triggers deployment)

Comprehensive Testing

Added tests/test-version-separation.sh with 25+ test cases covering:

  • Multi-component versioning functionality
  • Version increment validation
  • Deployment workflow testing
  • Backwards compatibility verification
  • Integration testing with existing systems

Updated Documentation

Enhanced GitHub Copilot instructions with specific review guidelines for version changes:

  • Verify main version matches template version
  • Check version increments are higher than previous
  • Validate component version changes follow semantic versioning
  • Confirm CHANGELOG.md updates for all changes

Demonstration

The system now allows independent component versioning while maintaining governance:

# Component update (doesn't affect main version)
$ ./scripts/manage-versions.sh update-component snippets.version_check_command 0.1.1
✅ Component snippets.version_check_command updated to 0.1.1

# Main version still 0.4.0, component now 0.1.1
$ ./scripts/manage-versions.sh show
Main version: 0.4.0
Template version: 0.4.0
Component version_check_command: 0.1.1

# Downgrade prevention works
$ ./scripts/manage-versions.sh update-component snippets.version_check_command 0.1.0
❌ New version (0.1.0) must be higher than current version (0.1.1)

Benefits

  1. Component Independence: Templates, GitHub Actions, and snippets can evolve at their own pace
  2. Main Version Governance: Package version remains tied to template version with strict controls
  3. Automated Deployment: Version changes trigger comprehensive validation and deployment
  4. Downgrade Prevention: Built-in safeguards prevent accidental version downgrades
  5. Backwards Compatibility: All existing functionality preserved
  6. Enhanced Testing: Comprehensive validation ensures system reliability

The implementation provides complete version separation while maintaining the stability and governance required for a template repository used by multiple ioBroker adapter developers.

Fixes #33.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 19, 2025 02:40
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Copilot AI changed the title [WIP] ensure separation of versioning Implement enhanced multi-component version separation system Sep 19, 2025
Copilot AI requested a review from DutchmanNL September 19, 2025 02:42
@DutchmanNL DutchmanNL marked this pull request as ready for review September 19, 2025 02:45
Copilot AI review requested due to automatic review settings September 19, 2025 02:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a comprehensive multi-component version separation system that enables independent versioning for GitHub Actions, templates, and snippets while maintaining strict governance for the main package version. The system introduces automated deployment pipelines triggered by main version changes and comprehensive validation to prevent version downgrades.

Key Changes:

  • Enhanced metadata structure with component registry and version policies
  • Multi-component version management with independent versioning capabilities
  • Automated deployment workflow triggered by main version changes
  • Comprehensive testing framework for version separation functionality

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test-version-separation.sh New comprehensive test suite for multi-component versioning system with 25+ test cases
scripts/shared-utils.sh Enhanced with component version management functions and validation
scripts/manage-versions.sh Major expansion with component versioning commands and policy enforcement
config/metadata.json Enhanced structure with component registry, version policies, and deployment configuration
.github/workflows/deploy-on-version-change.yml New automated deployment workflow with version validation and testing
.github/copilot-instructions.md Updated with specific review guidelines for version changes and component management
Comments suppressed due to low confidence (1)

scripts/manage-versions.sh:1

  • The component path is directly interpolated into the jq expression without validation, which could allow command injection if malicious input is provided. Validate the component path format before using it in the jq command.
#!/bin/bash

DutchmanNL and others added 2 commits September 19, 2025 04:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DutchmanNL DutchmanNL merged commit 57ccec0 into main Sep 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ensure separation of versioning

3 participants