Skip to content

🚀 [Feature]: Settings-driven workflow control #232

@MariusStorhaug

Description

@MariusStorhaug

Primary User Story

As a workflow maintainer, I want a single, centralized configuration source that defines all workflow settings and parameters, so that the workflow structure is simplified and the complexity of conditional if: statements is significantly reduced. This central configuration should eliminate scattered hardcoded values and make the workflow logic more maintainable and easier to understand.

Acceptance Scenarios

  1. Given a workflow with multiple conditional branches based on hardcoded values, When configuration is centralized in a single source, Then the number of if: statements decreases by at least 50% and logic becomes more readable
  2. Given configuration changes are needed, When I update the central configuration file, Then all dependent workflow steps automatically use the new values without individual modifications
  3. Given a new workflow parameter is introduced, When I add it to the central configuration, Then it becomes immediately available to all workflow steps without code changes
  4. Given environment-specific settings are required, When I define them in the central configuration, Then the workflow can access them through simple variable references instead of complex conditionals

Edge Cases

  • What happens when the central configuration file is missing or invalid? (Workflow should fail fast with clear error message)
  • How does the system handle conflicting configuration values across different sections? (Validation should catch conflicts during configuration loading)
  • What happens when a workflow step references a configuration key that doesn't exist? (Should provide default values or fail with descriptive error)
  • How does the system handle configuration updates during workflow execution? (Configuration should be immutable once loaded)

Requirements (mandatory)

Functional Requirements

ID Requirement
FR-001 System MUST provide a single configuration file as the authoritative source for all workflow settings
FR-002 System MUST validate configuration file syntax and required fields on workflow startup
FR-003 System MUST make configuration values available as environment variables or step inputs throughout the workflow
FR-004 System MUST support hierarchical configuration with environment-specific overrides
FR-005 System MUST reduce workflow conditional logic by replacing hardcoded values with configuration references
FR-006 System MUST provide clear error messages when configuration is invalid or missing required values
FR-007 System MUST support configuration inheritance and composition for complex scenarios
FR-008 System MUST allow configuration to be sourced from repository files, secrets, or external sources
FR-009 System MUST document all available configuration options and their effects on workflow behavior
FR-010 System MUST maintain backward compatibility with existing workflow structures during migration

Non-Functional Requirements

ID Requirement
NFR-001 Configuration loading MUST complete within 10 seconds to avoid workflow delays
NFR-002 Configuration validation MUST provide actionable error messages for troubleshooting
NFR-003 System MUST maintain configuration security by not exposing sensitive values in logs
NFR-004 Configuration changes MUST not require workflow file modifications for routine updates
NFR-005 System MUST support configuration versioning and rollback capabilities

Quality Attributes Addressed

Attribute Target Metric
Maintainability Reduce conditional complexity by 60%; single source of truth for all configuration
Reliability Configuration validation prevents runtime failures; consistent behavior across environments
Usability Clear configuration structure reduces cognitive load for workflow maintainers
Security Centralized configuration management with proper secret handling
Efficiency Faster workflow updates through configuration changes rather than code modifications

Constraints (include if applicable)

Constraint Description
GitHub Actions Environment Must work within GitHub Actions workflow syntax and execution model
Configuration Format Must support YAML, JSON, or PowerShell data file formats commonly used in workflows
Backward Compatibility Must allow gradual migration from existing hardcoded configurations
Repository Structure Must integrate with existing PSModule repository conventions

Key Entities (include if feature involves data)

Entity Description
Configuration File Central YAML/JSON/PSData file containing all workflow settings and parameters
Configuration Schema Validation rules defining required and optional configuration properties
Environment Overrides Environment-specific configuration values that extend or replace base settings
Configuration Context Runtime information (branch, environment, trigger) used to select appropriate configuration
Workflow Parameters Derived values from configuration that are passed to workflow steps and jobs

Feature Branch: 001-settings-driven-workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions