Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Deterministic line endings across platforms
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.ps1 text eol=lf
*.psm1 text eol=lf
*.psd1 text eol=lf
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,77 @@ jobs:
with:
name: test-results-${{ matrix.os }}
path: artifacts/test-results.xml

docs-cmdlet-reference:
name: Verify cmdlet reference is up to date
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install platyPS
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

# Ensure PSGallery does not prompt (non-interactive CI)
if (Get-Command -Name Set-PSRepository -ErrorAction SilentlyContinue) {
try {
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -ErrorAction Stop
} catch {
# Ignore if not supported in this environment
}
}

Install-Module -Name platyPS -RequiredVersion 0.14.2 -Scope CurrentUser -Force -AllowClobber -ErrorAction Stop

- name: Debug platyPS version
shell: pwsh
run: |
Get-Module -ListAvailable platyPS | Sort-Object Version -Descending | Select-Object -First 1 | Format-List Name,Version,Path

- name: Generate cmdlet reference
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
pwsh -NoProfile -File ./tools/Generate-IdleCmdletReference.ps1

- name: Verify working tree clean
shell: bash
run: |
set -euo pipefail
echo "== git status =="
git status --porcelain || true

echo "== git diff (first 200 lines) =="
git diff | sed -n '1,200p' || true

git diff --exit-code

docs-step-reference:
name: Verify step reference is up to date
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Generate step reference
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
pwsh -NoProfile -File ./tools/Generate-IdleStepReference.ps1

- name: Verify working tree clean
shell: bash
run: |
set -euo pipefail
echo "== git status =="
git status --porcelain || true

echo "== git diff (first 200 lines) =="
git diff | sed -n '1,200p' || true

git diff --exit-code
125 changes: 125 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,131 @@ A contribution is complete when:

---

## Generated cmdlet reference (platyPS)

IdLE maintains a generated cmdlet reference under:

- `docs/reference/cmdlets.md` (index page)
- `docs/reference/cmdlets/*.md` (one file per cmdlet)

These files are generated from comment-based help in the PowerShell source. **Do not edit the generated files by hand.**
Instead, update the comment-based help of the relevant public function/cmdlet and regenerate the reference.

### platyPS version pinning

The cmdlet reference is generated using **platyPS**.

To ensure deterministic output across platforms and CI environments, the CI pipeline
**pins a specific platyPS version**.

Do not upgrade platyPS casually.

If you intentionally want to upgrade platyPS:

1. Update the pinned version in the CI workflow.
2. Regenerate the cmdlet reference locally using the same version.
3. Commit the regenerated files under `docs/reference/cmdlets/`.
4. Verify that CI passes without diffs.

This avoids documentation drift caused by formatting or template changes between platyPS versions.

### When to regenerate

Regenerate the cmdlet reference when you change any of the following for exported/public commands:

- Add/remove/rename a public cmdlet/function
- Add/remove/rename parameters (including parameter sets)
- Change comment-based help: synopsis/description/parameters/examples

### How to regenerate locally

From the repository root:

```powershell
pwsh ./tools/Generate-IdleCmdletReference.ps1
```

If `platyPS` is not installed yet, you can install it automatically (requires internet access):

```powershell
pwsh ./tools/Generate-IdleCmdletReference.ps1 -InstallPlatyPS
```

Commit the changed files under `docs/reference/` as part of the same PR that introduced the cmdlet/help changes.

### CI enforcement (required status check)

The CI pipeline verifies that the generated cmdlet reference is up to date. If you change public cmdlets or their
comment-based help and forget to regenerate the docs, the workflow **"Verify cmdlet reference is up to date"** will fail.

To fix a failing PR:

1. Run the generator locally from the repo root:

```powershell
pwsh ./tools/Generate-IdleCmdletReference.ps1
```

If needed (first time only):

```powershell
pwsh ./tools/Generate-IdleCmdletReference.ps1 -InstallPlatyPS
```

2. Commit the updated files under `docs/reference/` and push to your branch.

Repository maintainers should configure branch protection so that required status checks include this workflow. This ensures
generated docs cannot drift from the exported cmdlets.

## Generated step reference

IdLE maintains a generated step reference under:

- `docs/reference/steps.md`

The file is generated from step implementations in `IdLE.Steps.*` and their comment-based help.
**Do not edit the generated file by hand.** Update the step help/source and regenerate the reference.

### When to regenerate

Regenerate the step reference when you change any of the following:

- Add/remove/rename a step implementation (`Invoke-IdleStep*`)
- Change step behavior that affects documented inputs (With.* keys), contracts, idempotency, or emitted events
- Update comment-based help of step implementations

### How to regenerate locally

From the repository root:

```powershell
pwsh ./tools/Generate-IdleStepReference.ps1
```

Commit the updated `docs/reference/steps.md` as part of the same PR that introduced the step changes.

### CI enforcement (required status check)

The CI pipeline verifies that the generated step reference is up to date. If you change steps and forget to regenerate the docs,
the workflow **"Verify step reference is up to date"** will fail.

To fix a failing PR:

1. Run the generator locally:

```powershell
pwsh ./tools/Generate-IdleStepReference.ps1
```

2. Commit the updated `docs/reference/steps.md` and push to your branch.

Repository maintainers should configure branch protection so that required status checks include this workflow.






## Documentation

Keep docs short and linkable:
Expand Down
4 changes: 4 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- [Steps](usage/steps.md)
- [Providers](usage/providers.md)

### Reference
- [Cmdlet Reference](docs/reference/cmdlets.md)
- [Step Catalog](docs/reference/steps.md)

### Advanced
- [Architecture](advanced/architecture.md)
- [Security](advanced/security.md)
Expand Down
13 changes: 9 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ for identity and account processes (Joiner / Mover / Leaver) built for **PowerSh
- [Getting started: Installation](getting-started/installation.md)
- [Getting started: Quickstart](getting-started/quickstart.md)

## Topics
## Usage

- [Usage: Workflows](usage/workflows.md)
- [Usage: Steps](usage/steps.md)
- [Usage: Providers](usage/providers.md)
- [Workflows](usage/workflows.md)
- [Steps](usage/steps.md)
- [Providers](usage/providers.md)

## Reference

- [Cmdlet Reference](docs/reference/cmdlets.md)
- [Step Catalog](docs/reference/steps.md)

## Advanced

Expand Down
13 changes: 13 additions & 0 deletions docs/reference/cmdlets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cmdlet Reference

> Generated file. Do not edit by hand.
> Source: tools/Generate-IdleCmdletReference.ps1

This page links the generated per-cmdlet reference pages and includes their synopsis.

| Cmdlet | Synopsis |
| --- | --- |
| [Invoke-IdlePlan](cmdlets/Invoke-IdlePlan.md) | Executes an IdLE plan. |
| [New-IdleLifecycleRequest](cmdlets/New-IdleLifecycleRequest.md) | Creates a lifecycle request object. |
| [New-IdlePlan](cmdlets/New-IdlePlan.md) | Creates a deterministic plan from a lifecycle request and a workflow definition. |
| [Test-IdleWorkflow](cmdlets/Test-IdleWorkflow.md) | Validates an IdLE workflow definition file. |
Loading