Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Oct 2, 2025

This PR consolidates the separate CI (CI.yml) and release (workflow.yml) workflows into a single unified workflow that intelligently handles both continuous integration testing and automated release publishing based on trigger context.

Key Changes for Users:

  • Single workflow.yml file replaces the need for separate CI.yml and workflow.yml
  • Automatic detection of CI-only mode (unmerged PRs, manual triggers) vs CI+Release mode (merged PRs, main branch pushes)
  • CI.yml marked as deprecated with graceful migration path
  • Complete backward compatibility for repositories already using workflow.yml
  • Comprehensive migration guide provided for repositories using CI.yml

Why This Matters:

  • Reduces maintenance burden across all PSModule repositories (~10-20 repos)
  • Eliminates configuration drift between separate workflow files
  • Provides single source of truth for entire CI/CD pipeline
  • Simplifies onboarding new repositories to the framework

How It Works:
The unified workflow uses conditional execution logic to intelligently determine which jobs to run based on the trigger context. CI tests always run, but publish operations only execute when changes are merged to the main branch or pushed directly to main. This prevents accidental releases while maintaining full testing coverage on all events.

Migration Impact:

  • Repositories using workflow.yml: No changes required; existing behavior preserved
  • Repositories using CI.yml: Migration recommended during v5.x; CI.yml will be removed in v6.0.0
  • Breaking Change: This is a Major version bump (v4 → v5) due to CI.yml deprecation

See the comprehensive migration guide for detailed migration instructions and validation procedures.

Implementation Tasks

Phase 3.1: Setup

  • T001 Validate current workflow structure in .github/workflows/
  • T002 Create migration documentation directory docs/migration/
  • T003 Add deprecation notice to .github/workflows/CI.yml header

Phase 3.2: Tests First (TDD) ⚠️ MUST COMPLETE BEFORE 3.3

  • T004 [P] Create test workflow for CI-only mode (unmerged PR) in .github/workflows/Test-Workflow-CI-Only.yml
  • T005 [P] Create test workflow for CI+Release mode (merged PR) in .github/workflows/Test-Workflow-Release.yml
  • T006 [P] Create test workflow for manual trigger behavior in .github/workflows/Test-Workflow-Manual.yml
  • T007 [P] Update .github/workflows/Workflow-Test-Default.yml to test unified workflow
  • T008 [P] Update .github/workflows/Workflow-Test-WithManifest.yml to test unified workflow
  • T009 Create validation script to verify conditional job execution in tests/Validate-ConditionalExecution.Tests.ps1

Phase 3.3: Core Implementation (ONLY after tests are failing)

  • T010 Add conditional execution logic to Publish-Module job in .github/workflows/workflow.yml
  • T011 Add conditional execution logic to Publish-Site job in .github/workflows/workflow.yml
  • T012 Update workflow triggers in .github/workflows/workflow.yml to handle all events
  • T013 Update workflow permissions in .github/workflows/workflow.yml for both modes
  • T014 Add workflow comments documenting CI-Only vs CI+Release execution paths in .github/workflows/workflow.yml
  • T015 Verify all job dependencies correctly chain CI before Release jobs in .github/workflows/workflow.yml

Phase 3.4: Integration

  • T016 Add deprecation warning to .github/workflows/CI.yml with migration instructions
  • T017 [P] Remove .github/workflows/Publish-Module.yml (logic now in workflow.yml)
  • T018 [P] Remove .github/workflows/Publish-Site.yml (logic now in workflow.yml)
  • T019 [P] Mark .github/workflows/Workflow-Test-Default-CI.yml as deprecated
  • T020 [P] Mark .github/workflows/Workflow-Test-WithManifest-CI.yml as deprecated
  • T021 Update workflow version references from v4 to v5 in test workflows

Phase 3.5: Polish

  • T022 [P] Create migration guide docs/migration/v5-unified-workflow.md with all three scenarios
  • T023 [P] Update README.md with unified workflow documentation and breaking change notice
  • T024 [P] Update .github/copilot-instructions.md with unified workflow as active technology
  • T025 [P] Create manual test checklist docs/migration/manual-testing.md for consuming repositories
  • T026 Run manual validation of all three migration scenarios from quickstart.md
  • T027 Verify workflow execution time has no regression compared to separate workflows
  • T028 [P] Add CHANGELOG.md entry for v5.0.0 breaking change

- Analyzed existing workflow.yml and CI.yml to understand differences
- Designed conditional execution logic for intelligent CI/Release mode switching
- Created comprehensive data model for workflow state transitions
- Documented workflow API contract maintaining backward compatibility
- Created migration guide (quickstart.md) for consuming repositories
- Updated copilot instructions with recent changes

Constitutional compliance:
- Workflow-First Design: Enhances existing reusable workflow
- TDD: Test scenarios documented before implementation
- Platform Independence: No platform-specific changes
- Quality Gates: Existing gates preserved
- Semantic Versioning: Breaking change requires v5.0.0

Breaking Change: CI.yml deprecated; unified workflow.yml handles both CI and release
- Added Clarifications session 2025-10-02 with 5 resolved questions
- Updated FR-008: Publishing target is PowerShell Gallery
- Updated FR-009: Semantic versioning with PR labels
- Updated FR-011: Manual triggers execute tests only
- Updated FR-012: Authentication via APIKEY and GITHUB_TOKEN
- Updated NFR-001: GitHub Actions default timeouts
- Marked requirement completeness checklist complete
- All [NEEDS CLARIFICATION] markers removed
- Created 28 tasks across 5 phases (Setup, Tests, Core, Integration, Polish)
- Phase 3.2: 6 test tasks covering CI-only, CI+Release, and manual trigger modes
- Phase 3.3: 6 core tasks for conditional execution logic in workflow.yml
- Phase 3.4: 6 integration tasks for deprecation and file removal
- Phase 3.5: 7 polish tasks for documentation and validation
- Marked 15 tasks as parallel [P] (different files, no dependencies)
- Sequential tasks for workflow.yml modifications (T010-T015)
- All test tasks before implementation (TDD red-green-refactor)
- Added validation checklist (all items passed)
- Updated PR #199 description with task checkboxes
…remove T017-T018

- Added T010: PR status check validation test (resolves H2 - FR-006 coverage gap)
- Enhanced T016: Added fail-fast behavior validation (resolves H3 - FR-007 insufficient validation)
- Removed T017-T018: Publish-Module.yml and Publish-Site.yml don't exist (resolves H5 - non-existent file removal)
- Renumbered all subsequent tasks (T019-T028 → T017-T024)
- Updated dependencies section with correct task numbers
- Updated parallel execution examples with all 7 test tasks
- Task count: 28 → 24 tasks (removed 4 obsolete tasks)

Analysis findings addressed: H2, H3, H5
Remaining high priority: H1 (edge cases), H4 (file reference)
@MariusStorhaug MariusStorhaug marked this pull request as ready for review October 2, 2025 12:08
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner October 2, 2025 12:08
Copilot AI review requested due to automatic review settings October 2, 2025 12:08
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 the complete specification and design documents for the unified CI and Release Workflow feature, consolidating separate CI.yml and workflow.yml files into a single intelligent workflow that conditionally executes release operations based on trigger context.

Key Changes:

  • Complete feature specification with functional requirements and user scenarios
  • Comprehensive implementation plan with constitutional compliance validation
  • Detailed data model defining workflow execution modes and conditional logic
  • Migration guide covering all repository scenarios and validation procedures

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
specs/001-merge-ci-release-workflows/spec.md Feature specification defining user scenarios, functional requirements, and quality attributes for unified workflow
specs/001-merge-ci-release-workflows/plan.md Implementation plan with technical context, constitutional compliance checks, and phase execution strategy
specs/001-merge-ci-release-workflows/research.md Research analysis of current workflow architecture and consolidation strategy decisions
specs/001-merge-ci-release-workflows/data-model.md Workflow state model defining CI-only vs CI+Release execution modes and conditional logic entities
specs/001-merge-ci-release-workflows/contracts/workflow-api.md API contract specification maintaining backward compatibility while adding conditional execution
specs/001-merge-ci-release-workflows/quickstart.md Migration guide with validation procedures for three repository scenarios
specs/001-merge-ci-release-workflows/tasks.md Task breakdown with TDD approach, parallel execution markers, and dependency management
.github/copilot-instructions.md Updated active technologies and recent changes to reflect unified workflow implementation

@MariusStorhaug MariusStorhaug self-assigned this Oct 2, 2025
@MariusStorhaug MariusStorhaug deleted the 001-merge-ci-release-workflows branch October 2, 2025 12:54
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.

🌟 [Breaking change]: Unified CI and Release Workflow

2 participants