Skip to content

Conversation

@richardkiene
Copy link
Contributor

@richardkiene richardkiene commented Aug 23, 2025

Summary

This PR significantly improves our CI/CD pipeline by implementing a unified workflow system with proper semantic versioning support and enhanced testing capabilities.

Key Improvements

Unified Workflow: Consolidated separate build-image.yml and publish-templates.yml into a single build-and-publish.yml workflow that handles both Docker images and OCI templates efficiently

Semantic Versioning Compliance: Implemented proper semantic versioning following the Dev Container specification, ensuring consistent version management across templates and images

PR Testing Support: Added pr-<number> tag generation for pull requests, enabling thorough testing of changes before they reach the main branch

Multi-Template Architecture: Built-in support for multiple templates using matrix builds, preparing the repository for future template additions

Comprehensive Documentation: Added VERSIONING.md with clear guidelines for version management and release processes

Technical Changes

  • Removed redundant workflow files (build-image.yml, publish-templates.yml)
  • Created unified build-and-publish.yml with matrix build support
  • Updated template version from 1.0.0 to 1.0.1 following semantic versioning
  • Implemented automatic tagging strategy for releases and PR testing
  • Added proper semantic version parsing and validation

Benefits

  • Streamlined Operations: Single workflow reduces maintenance overhead and complexity
  • Better Testing: PR builds allow validation before merging to main
  • Standards Compliance: Follows Dev Container specification versioning requirements
  • Scalability: Matrix builds support future multi-template scenarios
  • Clarity: Clear documentation improves contributor experience

Test Plan

  • Verify workflow syntax is valid
  • Confirm matrix build configuration works for current template
  • Test semantic version parsing logic
  • Validate PR tagging functionality
  • Test actual workflow execution on merge to main
  • Verify published templates maintain proper versioning

This enhancement positions our CI/CD pipeline for better maintainability, testing, and compliance with Dev Container standards.

Major refactoring to improve code organization and maintainability:

Structure improvements:
- Split monolithic script into 26 focused functions
- Organized into logical sections with clear headers
- Added comprehensive documentation and comments
- Moved all configuration to the top as readonly arrays

Code quality improvements:
- Created reusable functions to eliminate duplication
- Consistent error handling with logging functions
- Better separation of concerns
- Clear main() function showing high-level flow
- Proper use of local variables and return codes

Maintained functionality:
- All existing features preserved
- Bug fixes retained (array-based 1Password domain handling)
- Docker DNS preservation intact
- All domain resolutions and firewall rules unchanged

This refactoring makes the script easier to understand, test, debug,
and extend while maintaining 100% feature parity.
- Remove root .devcontainer directory (not needed for template repository)
- Move image sources from docker-image/ to image-sources/ directory structure
- Restructure to follow Dev Container template spec with self-contained templates in src/
- Update GitHub Actions workflow to build from image-sources/
- Update documentation to reflect new architecture
- Remove interactive create-limited-git-setup.sh script for cleaner automation

This restructuring separates concerns properly: templates are self-contained
in src/ and use pre-built images, while image sources are maintained
separately for CI/CD pipeline consumption.
- Replace separate build-image.yml and publish-templates.yml with unified build-and-publish.yml
- Implement Dev Container spec-compliant semantic versioning for templates and images
- Add PR build support with pr-<number> tags for testing changes before merge
- Support multi-template builds with matrix strategy for scalability
- Add comprehensive VERSIONING.md documentation for release process
- Bump template version to 1.0.1 following semantic versioning standards

The unified workflow streamlines CI/CD operations while maintaining proper versioning
and enabling thorough testing of changes through PR builds.
- Fix GitHub Actions output format for multi-line JSON
- Fix devcontainer CLI namespace argument (use --namespace instead of --registry-namespace)
@richardkiene richardkiene merged commit 203fd61 into main Aug 23, 2025
4 checks passed
@richardkiene richardkiene deleted the feature/refactor-scripts-and-structure branch August 23, 2025 18:50
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.

2 participants