Fix test failures from mailbox step template variable dependencies#171
Fix test failures from mailbox step template variable dependencies#171
Conversation
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
… attributes Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
blindzero
left a comment
There was a problem hiding this comment.
@copilot we do not want any alias; the only step is the new way, that should stick to existing step naming schemas (IdLE.Step.[Domain].VerbNoun), so e.g. IdLE.Step.Mailbox.EnsureOutOfOffice or IdLE.Step.Mailbox.EnsureType.
We do NOT keep any legacy / backward compatibiltiy stuff.
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Done! Removed all alias logic and renamed mailbox steps to follow the VerbNoun pattern:
All code, tests, examples, and documentation updated to use only the new naming. Commit: 5eeaa5b |
blindzero
left a comment
There was a problem hiding this comment.
@copilot please check additionally if there is any way to have a formatted way for OOO messages not just simple plain text?
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c031ddbd00
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR updates IdLE’s mailbox step types to a VerbNoun naming pattern (breaking change) and expands documentation/examples to show how to use {{Request.DesiredState.*}} templates for dynamic Out of Office messages (e.g., manager contact info). It also extends step-reference generation to auto-discover step modules and adds mailbox steps into the built-in step registry.
Changes:
- Renames mailbox step types to
IdLE.Step.Mailbox.EnsureOutOfOfficeandIdLE.Step.Mailbox.EnsureType, and registers them inGet-IdleStepRegistry. - Adds template-focused documentation and runnable examples showing host-side request enrichment for manager attributes.
- Updates step reference generation to auto-discover
IdLE.Steps.*modules and includes newly generated mailbox step reference pages.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Generate-IdleStepReference.ps1 | Adds auto-discovery of step modules and changes -StepModules default behavior (currently has a parameter validation issue). |
| tests/Core/Invoke-IdlePlan.MailboxTemplates.Tests.ps1 | Adds tests validating template resolution for mailbox OOF configuration. |
| src/IdLE.Steps.Mailbox/Public/Invoke-IdleStepMailboxTypeEnsure.ps1 | Updates help example to the new IdLE.Step.Mailbox.EnsureType step type. |
| src/IdLE.Steps.Mailbox/Public/Invoke-IdleStepMailboxOutOfOfficeEnsure.ps1 | Updates help examples to IdLE.Step.Mailbox.EnsureOutOfOffice and adds a template/manager enrichment example. |
| src/IdLE.Steps.Mailbox/Public/Get-IdleStepMetadataCatalog.ps1 | Updates metadata catalog keys to the new mailbox step type names. |
| src/IdLE.Core/Private/Get-IdleStepRegistry.ps1 | Registers mailbox step types in the built-in step registry (when the mailbox step pack is loaded). |
| examples/workflows/templates/exo-leaver-mailbox-offboarding.psd1 | Updates workflow template to new mailbox step type names and uses manager templates in OOF messages. |
| examples/Invoke-LeaverWithManagerOOF.ps1 | Adds host example script demonstrating request enrichment for manager attributes. |
| docs/reference/steps/step-mailbox-type-ensure.md | Generated step reference page for mailbox type ensure (currently documents an incorrect Step.Type). |
| docs/reference/steps/step-mailbox-out-of-office-ensure.md | Generated step reference page for mailbox OOF ensure (currently documents an incorrect Step.Type). |
| docs/reference/steps/step-mailbox-get-info.md | Generated step reference page for mailbox get-info (currently documents an incorrect Step.Type). |
| docs/reference/steps.md | Generated step index updated to include mailbox steps (currently lists incorrect step type names). |
| docs/reference/providers/provider-exchangeonline.md | Updates mailbox-type example and adds a new section documenting OOF templates + host enrichment (needs null-manager-safe example). |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
…ability Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
I've addressed the test compatibility issues caused by PR #172's changes to AuthSessionBroker in commit b1fc8fe. Changes made:
Issue: The tests are currently timing out during execution. This appears to be a new issue introduced by the merge from main (PR #172). The security exemption is working correctly, but there may be an issue with provider method invocation or broker interaction that needs further investigation. The core functionality (step renaming, documentation generation fixes, template support) is complete and validated. |
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…ort optional Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
blindzero
left a comment
There was a problem hiding this comment.
@copilot the generator now creates bad new filenames step-id-le-step-create-identity.md as an example. make sure that it uses the old filenames, e.g. step-create-identity.md
…step-id-le-step-X.md) Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Fixed in commit 41d7b80. The generator now correctly removes the
All duplicate files removed and regenerated with correct names. |
✅ All Tests Passing - Acceptance Criteria Met
Test Results Summary
ALL TESTS ARE GREEN! ✅
Latest Fix: Step Reference Generator Filenames
Issue: Generator was creating duplicate files with incorrect prefix
step-id-le-step-*.mdinstead ofstep-*.mdRoot Cause: The slug generation was converting
IdLE.Step.Xto kebab-caseid-le-step-x, but the regex only removedidle-step-(notid-le-step-), causing the prefix logic to addstep-and createstep-id-le-step-x.mdSolution: Updated
ConvertTo-IdleStepSlug(lines 366-377) to remove both:id-le-step-(kebab-case version)idle-step-(original lowercase)id-le-(shortened kebab-case)idle-(shortened original)Result: Clean filenames:
step-create-identity.md(wasstep-id-le-step-create-identity.md)step-mailbox-ensure-type.md(wasstep-id-le-step-mailbox-ensure-type.md)step-mailbox-ensure-out-of-office.mdstep-mailbox-get-info.mdIssues Fixed
1. Redaction Infinite Loop (src/IdLE.Core/Private/Copy-IdleRedactedObject.ps1)
Root Cause:
AuthSessionBrokercontains aValidateAuthSessionscriptblock property. When redacting providers for output, the redaction code tried to recursively process this scriptblock's complex nested structures, causing an infinite loop or hang.Solution: Added ScriptBlock as a redactable type (lines 110-113). ScriptBlocks are now replaced with
[REDACTED]marker instead of being recursively processed.2. AuthSessionBroker Security Validation (src/IdLE.Core/Private/Assert-IdleNoScriptBlock.ps1)
Root Cause: The security validation rejected
AuthSessionBrokerobjects because they contain aValidateAuthSessionscriptblock for internal validation.Solution: Added exemption for
IdLE.AuthSessionBrokertype (lines 45-48). These objects are trusted IdLE types that legitimately contain scriptblocks.3. OAuth Mock Auth Session Format (tests/Core/Invoke-IdlePlan.MailboxTemplates.Tests.ps1)
Root Cause: Test was providing
[pscustomobject]@{ Token = 'mock-token' }but OAuth validation requires: string, PSCredential, object withAccessTokenproperty, or object withGetAccessToken()method.Solution: Changed to simple string
'mock-token-string'which is a valid OAuth session format.4. Missing Manager Data in Tests (tests/Core/CapabilityDeprecation.Tests.ps1)
Root Cause: Example workflow uses template variables
{{Request.DesiredState.Manager.*}}but tests didn't provide manager data in the lifecycle request.Solution: Added fallback manager contact info to test requests (lines 38-42, 73-77).
5. Module Import Test Isolation (tests/_testHelpers.ps1, tests/Packaging/ModuleSurface.Tests.ps1)
Root Cause:
IdLE.Steps.Mailboxwas being imported byImport-IdleTestModulecausing it to appear in all tests, including the ModuleSurface test that verifies optional modules aren't auto-imported.Solution:
Import-IdleTestMailboxModulefunction6. Step Reference Generator Filenames (tools/Generate-IdleStepReference.ps1)
Root Cause: Slug generation didn't handle kebab-case
id-le-step-prefix correctly.Solution: Updated regex patterns to remove both kebab-case and original prefixes before adding
step-.Complete Feature Set Delivered
Acceptance criteria achieved: All tests are green! ✅
Original prompt
This section details on the original issue you should resolve
<issue_title>Add Mailbox Out of Office step alias + template docs with dynamic user attributes</issue_title>
<issue_description>## Problem Statement
Users want to configure Exchange Online automatic replies (Out of Office / OOF) as part of Leaver and handover workflows. While IdLE already exposes a mailbox OOF step (
IdLE.Step.Mailbox.OutOfOffice.Ensure) and the ExchangeOnline provider advertises the corresponding capability, the current documentation/examples do not clearly show:{{...}}) in OOF messages.IdLE.Step.Mailbox.EnsureOutOfOffice) for better discoverability/consistency for some users.Proposed Solution
A) Documentation + Examples: Template usage + dynamic manager attributes (host enrichment)
{{Request.DesiredState.Manager.*}}to render message.Host enrichment example (AD → DesiredState.Manager):
Workflow step example:
B) Step type alias (optional, non-breaking)
Add a step type alias that maps to the existing handler:
IdLE.Step.Mailbox.OutOfOffice.EnsureIdLE.Step.Mailbox.EnsureOutOfOfficeAlias should resolve to the same handler currently used for OOF:
Invoke-IdleStepMailboxOutOfOfficeEnsureImplementation outline:
RequiredCapabilitiesC) Validation / Idempotency verification
Verify or add step validation rules (if missing):
Statemust beDisabled|Enabled|ScheduledScheduled:StartTimeandEndTimerequired andStartTime < EndTimeAuthSessionOptions(existing security rule)Ensure idempotent behavior:
Changed = $false.D) Deliverables (docs/tests/examples)
InternalMessage/ExternalMessageAlternatives Considered
Impact
<agent_instructions>No backward compatibility notes, aliases or docs needed. Full ahead even for breaking changes. Only new behavior must be ensured to be documented.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.