Skip to content

Fix examples: separate Mock/Live workflows, add CI validation, fix import-idle script#104

Merged
blindzero merged 7 commits intomainfrom
copilot/fix-examples-separating-workflows
Jan 24, 2026
Merged

Fix examples: separate Mock/Live workflows, add CI validation, fix import-idle script#104
blindzero merged 7 commits intomainfrom
copilot/fix-examples-separating-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 24, 2026

Summary

Restructures examples to prevent broken demo experiences and enable CI validation as a release gate for v0.8.0. Separates workflows into Mock (runnable out-of-the-box), Live (executable with real providers), and Templates (starting points). Fixes import-idle.ps1 helper script to work with the new directory structure.

Motivation

Demo script enumerated all workflows including those requiring AD/Entra infrastructure. Default execution selected alphabetically-first workflow (often non-runnable), breaking out-of-the-box experience. No CI validation allowed example drift after breaking changes. Additionally, the import-idle.ps1 helper script was broken after directory restructuring.

Type of Change

  • Refactoring / internal improvement

Changes

Directory structure:

  • examples/workflows/mock/ - 5 workflows runnable with IdLE.Provider.Mock (CI smoke tested)
  • examples/workflows/live/ - 7 workflows requiring real providers (executable but requires infrastructure)
  • examples/workflows/templates/ - reserved for future use (includes .gitkeep to ensure Git tracking)

Demo script (Invoke-IdleDemo.ps1):

  • Added -Category Mock|Live|Templates|All parameter (default: Mock)
  • Updated Get-DemoWorkflows() to filter by category
  • List output displays category column
  • Mock workflows work out-of-the-box with provided mock providers
  • Live workflows can be executed but will fail naturally if real providers not available (engine provides clear error messages)
  • Users can modify script (lines 246-248) to provide real providers for Live workflows

CI validation (WorkflowSamples.Tests.ps1):

  • Mock: validate + plan + execute (release gate)
  • Live/Templates: validate only (structural integrity)

Developer tools (tools/import-idle.ps1):

  • Updated workflow discovery to recursively search subdirectories
  • Changed from glob pattern (*.psd1) to directory-based recursive search
  • Now compatible with new directory structure (mock/, live/, templates/)

Test coverage:

  • Added ImportIdLE.Tests.ps1 to validate import-idle script functionality
  • Tests verify workflow discovery and script execution
  • Prevents future regressions when directory structure changes

Documentation:

  • examples/README.md: category descriptions, prerequisites, workflow matrix
  • README.md: clarified Mock vs Live distinction in Quickstart
  • Clear guidance on how to run Live workflows with real providers

Category semantics:

  • Mock: Works out-of-the-box, no prerequisites
  • Live: Executable but requires real providers/infrastructure (users modify script to provide them)
  • Templates: Generic starting points, may require customization

Usage:

# Default: deterministic, runs out-of-the-box
./examples/Invoke-IdleDemo.ps1 -List

# List Live workflows
./examples/Invoke-IdleDemo.ps1 -List -Category Live

# Run all Mock workflows (works immediately)
./examples/Invoke-IdleDemo.ps1 -All

# Run Live workflows (requires modifying script to provide real providers)
./examples/Invoke-IdleDemo.ps1 -All -Category Live
# Will fail with clear engine error if providers not available

# Import IdLE modules and validate all workflows (developer helper)
./tools/import-idle.ps1

Testing

  • Unit tests
  • Contract tests
  • Manual testing

How to test & review

# Verify Mock workflows execute successfully
./examples/Invoke-IdleDemo.ps1 -All

# Verify category filtering for listing
./examples/Invoke-IdleDemo.ps1 -List -Category Live

# Verify Live workflows can be attempted (will fail with clear engine error)
./examples/Invoke-IdleDemo.ps1 -Example ad-joiner-complete -Category Live

# Verify import-idle script works with new structure
./tools/import-idle.ps1

# Run example workflow tests
Invoke-Pester -Path ./tests/WorkflowSamples.Tests.ps1

# Run import-idle tests
Invoke-Pester -Path ./tests/ImportIdLE.Tests.ps1

Test Results:

  • ✅ All 251 Pester tests pass (1 skipped for empty templates directory)
  • ✅ All Mock workflow smoke tests pass
  • ✅ All Live workflow validation tests pass
  • ✅ Template directory validation test passes
  • ✅ Import-idle script test passes and validates workflow discovery
  • ✅ Live workflows can be attempted; engine provides clear error messages about missing capabilities

Checklist

  • Code follows STYLEGUIDE.md
  • Tests added or updated
  • Documentation updated
  • No UI/auth logic added to IdLE.Core
  • No breaking changes without discussion

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…te demo script

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix examples by separating Mock and Live workflows with CI validation Fix examples: separate Mock/Live workflows, add CI validation Jan 24, 2026
Copilot AI requested a review from blindzero January 24, 2026 12:53
@blindzero
Copy link
Copy Markdown
Owner

@copilot pester tests are red. please fix.

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot pester tests are red. please fix.

Fixed in commit 1b3ba90. The issue was that Git doesn't track empty directories, so the examples/workflows/templates/ directory wasn't being committed. Added a .gitkeep file to ensure the directory is tracked. All tests now pass (248 passed, 1 skipped).

@blindzero blindzero marked this pull request as ready for review January 24, 2026 14:16
Copilot AI review requested due to automatic review settings January 24, 2026 14:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b3ba901fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
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 restructures the examples directory to separate mock workflows (runnable out-of-the-box) from live workflows (requiring real infrastructure), and adds CI validation for mock workflows to serve as a release gate.

Changes:

  • Reorganized examples into three categories: mock/ (5 workflows), live/ (7 workflows), and templates/ (reserved for future use)
  • Enhanced demo script with -Category parameter for filtering workflow types (defaults to 'Mock' for deterministic execution)
  • Added comprehensive CI tests that validate + plan + execute mock workflows, while live workflows are validation-only

Reviewed changes

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

Show a summary per file
File Description
tests/WorkflowSamples.Tests.ps1 Replaced single test block with three category-specific blocks (Mock, Live, Templates); added execution tests for mock workflows
examples/workflows/templates/.gitkeep Added placeholder file to ensure Git tracks the empty templates directory
examples/workflows/mock/*.psd1 Five new mock workflow files demonstrating various IdLE features with Mock provider
examples/workflows/live/*.psd1 Seven new live workflow files demonstrating real-world AD/EntraID scenarios
examples/README.md Added category descriptions, prerequisites matrix, and comprehensive workflow documentation
examples/Invoke-IdleDemo.ps1 Added -Category parameter with filtering logic; updated workflow discovery to support subdirectories
README.md Updated quickstart to clarify Mock vs Live workflow distinction

- Add validation to prevent execution of Live/Templates workflows
- Live workflows require real providers (DirectorySync, Cloud) which are not available in the demo script
- Users can still list Live workflows with -List -Category Live
- Update README to remove misleading instruction about running Live workflows
- Provide clear error message when attempting to run non-Mock workflows

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title Fix examples: separate Mock/Live workflows, add CI validation Fix examples: separate Mock/Live workflows, add CI validation, restrict execution to Mock Jan 24, 2026
Copilot AI requested a review from blindzero January 24, 2026 14:38
- Remove validation that blocked Live/Templates workflow execution
- Live workflows can now be attempted but will fail naturally if providers are missing
- This preserves the distinction: Mock (works out-of-the-box), Live (requires real providers), Templates (starting points)
- Engine provides clear error messages about missing provider capabilities
- Update README to clarify behavior and how to run Live workflows
- Default remains Mock for safe out-of-the-box experience

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title Fix examples: separate Mock/Live workflows, add CI validation, restrict execution to Mock Fix examples: separate Mock/Live workflows, add CI validation Jan 24, 2026
@blindzero
Copy link
Copy Markdown
Owner

@copilot now runing .\tools\Import-IdLE.ps1 fails:

IdLE public API is available.
Exception: C:\Users\matth\repos\IdentityLifecycleEngine\tools\Import-IdLE.ps1:41:5
Line |
  41 |      throw "No workflow definition files found at: $workflowGlob"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | No workflow definition files found at: C:\Users\matth\repos\IdentityLifecycleEngine\examples\workflows\*.psd1

However, all tests are green. Please have a look, check and fix the issue and make sure a tests covers this for future prevention.

- Update workflow discovery to recursively search subdirectories
- Change from specific glob pattern to directory-based recursive search
- Add test coverage for import-idle.ps1 to prevent future regressions
- New test validates workflow discovery and script execution
- All tests pass (251 passed, 1 skipped)

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot now runing .\tools\Import-IdLE.ps1 fails:

...

Fixed in commit 3543bf9. The import-idle.ps1 script was using examples/workflows/*.psd1 which doesn't work with the new subdirectory structure. Updated it to recursively search for workflows using Get-ChildItem -Recurse. Also added comprehensive test coverage (tests/ImportIdLE.Tests.ps1) to validate workflow discovery and script execution, preventing future regressions. All tests pass (251 passed, 1 skipped).

Copilot AI changed the title Fix examples: separate Mock/Live workflows, add CI validation Fix examples: separate Mock/Live workflows, add CI validation, fix import-idle script Jan 24, 2026
@blindzero blindzero requested a review from Copilot January 24, 2026 15:16
@blindzero blindzero linked an issue Jan 24, 2026 that may be closed by this pull request
9 tasks
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 19 changed files in this pull request and generated 1 comment.

@blindzero blindzero merged commit 61f1178 into main Jan 24, 2026
5 checks passed
@blindzero blindzero deleted the copilot/fix-examples-separating-workflows branch January 24, 2026 23:06
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.

Fix examples by separating Mock vs Live workflows and adding CI validation

3 participants