Skip to content

Fixture tests compare the published baseline with a candidate - #123

Merged
Marius Storhaug (MariusStorhaug) merged 13 commits into
mainfrom
baseline-first-comparison-driver
Dec 2, 2026
Merged

Marius Storhaug (MariusStorhaug) merged 13 commits into
mainfrom
baseline-first-comparison-driver

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Maintainers can run one comparison from the action repository's main branch. It verifies a release with published v2.0.3 before it opens a fixture case for the exact candidate SHA. This change affects only the fixture test harness.

Internal: Fixture tests compare the published baseline with a candidate

The pair uses one initially empty fixture repository. It tests the same one-step scenario with release:patch twice. The first release must be v0.0.1. The candidate must add one patch, and each tag must point to its own squash commit. The comparison does not cover the staged handoff or the intentional CI failure case.

Run the pair once before the candidate action pull request merges. Keep the two fixture releases as evidence. Use the ordinary Fixture Test workflow for later integration cases.

Migration guide

Merge this pull request first. Open Fixture Pair Test in PSModule/Release-GHRepository. Select Run workflow and branch main for each step. The workflow runs only on producer main.

Make sure the fixture has no releases, tags, or open fixture cases. Make sure Shelly has access to the fixture and the release:patch label exists. Do not update the case branches or merge other fixture pull requests during the comparison.

  1. Dispatch start-legacy with no pull request numbers. Find the fixture pull request in the job summary. Use normal independent review and squash merge.
  2. Wait for the successful legacy report. Dispatch start-candidate with the open producer pull request number (candidate_pr) and the merged legacy fixture pull request number (legacy_pr). For the first comparison, keep Release-GHRepository requires a release label or a configured bump #109 open.
  3. Wait for the start-candidate run to verify the open fixture case. Use normal independent review and squash merge on that fixture pull request.
  4. Dispatch compare with legacy_pr and candidate_fixture_pr. Check the job summary for the exact action SHAs, run links, squash commits, and tag results.

If a start run fails at the label step, find the open fixture pull request in the job summary. Close it without a merge before you retry the start step.

Technical details
  • The producer checks out its trusted workflow commit. It resolves the open same-repository candidate pull request without checking out or running candidate code.
  • The driver verifies the fixture repository name, ID, and default branch. Each start job requests a write token for the fixture repository only. compare uses a read-only token.
  • The candidate gate requires the exact v2.0.3 report and a stable v0.0.1 tag at the legacy squash. The original case and its squash must have the same parent. The fixture main and inventory must still match the legacy result.
  • The final comparison binds both reports to their exact sources. It checks the tag targets, the patch increment, and that the candidate squash directly follows the legacy squash.
  • All 66 credential-free driver tests pass locally. The added tests cover a legacy squash on a changed base and an open pull request left by a failed label request. The fixture's v2.0.3 baseline check passed without publication. No live pair has run.
  • The producer Release workflow only processes changes to action.yml or src/. This PR changes neither path. The scope check found no other open issue that this PR closes.
Changed surface Standards checked Framework docs checked Result
Driver and regression tests PowerShell, Testing GitHub REST Git commits Detects drift before the legacy squash
Fixture workflows GitHub Actions, YAML GitHub manual dispatch Runs only from producer main
Operator guide Technical Writing Guide The merged fixture contract Gives the three dispatches in order
Related links

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two unresolved issues allow legacy writes despite an open candidate fixture PR and cause release-target mismatches to abort comparison before the promised summary is written.

2 open issues
What changed in this PR

Adds a baseline-first comparison to the existing fixture driver: run one explicit patch case against published v2.0.3, then against an exact producer PR SHA, and compare the release evidence.

Changes:

  • Adds a dispatch-only workflow with separate legacy, candidate, and comparison steps using repository-scoped tokens.
  • Extends the driver with lane-aware validation, baseline publication checks, and comparison summaries.
  • Adds credential-free pair tests and documents setup, manual merge steps, and limitations.
File Description
tests/​ReleaseFixturePair.Tests.ps1 Tests pair prerequisites, token routing, evidence checks, and comparisons.
docs/​Fixture-Test.md Documents pair setup, operation, and limitations.
.github/​workflows/​Fixture-Pair-Test.yml Adds the three-step manual pair workflow.
.github/​workflows/​Fixture-Driver-Test.yml Includes pair tests in the existing test job.
.github/​scripts/​ReleaseFixture.psm1 Adds lane-aware operations and baseline-first comparison helpers.
.github/​scripts/​Invoke-ReleaseFixture.ps1 Adds pair execution modes and job summaries.

Review effort: Balanced

Comment thread .github/scripts/ReleaseFixture.psm1 Resolved
Comment thread .github/scripts/ReleaseFixture.psm1 Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The missing check for open candidate fixture PRs before legacy writes can consume the one-shot baseline setup and prevent completion of the comparison pair.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Low severity Clarify that tag validation failures do not produce comparison summaries

docs/​Fixture-Test.md:63

A release-target mismatch cannot appear in this summary: Assert-ReleaseFixtureStableRelease throws when the tag does not point to the squash, and both evidence loaders call it before ComparePair writes any summary. The synthetic comparison test bypasses those loaders. Please distinguish validation failures from comparison mismatches here so maintainers do not expect a comparison table when a tag points to the wrong commit.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

External fixture-harness dependencies and unverified live Shelly permissions and publication behavior require maintainers to confirm merge order, the patch/tag/report contract, and a baseline-before-candidate run.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The PR description and deployment hold point require two repositories and a fail-closed guard that the single-repository implementation does not provide, leaving misleading guidance for the write-enabled run.

1 open issue

Review effort: Balanced

Comment thread docs/Fixture-Test.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Mocked tests cannot validate live cross-repository publication, so a maintainer must verify merge order, permissions, and empty-inventory/isolation hold points and supervise the first credentialed, baseline-first pair.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Marius Storhaug (MariusStorhaug) added a commit that referenced this pull request Dec 2, 2026
Maintainers can start and verify release integration cases at an exact
producer commit. The driver rejects incompatible action metadata before
it requests a fixture write token. It leaves review and squash merge to
fixture reviewers.

<!-- ANNOUNCEMENT STOP -->

## Internal: Drive release cases from producer main

The driver checks the candidate's declared inputs and outputs without
running candidate code. An unrelated pull request does not stop a
fixture case. The driver verifies the fixture report for the exact pull
request event or squash commit. It does not publish a producer release.

<details>
<summary>Migration guide</summary>

1. The fixture harness landed in
[PSModule/Release-GHRepository-Test#3](PSModule/Release-GHRepository-Test#3),
then
[PSModule/Release-GHRepository-Test#4](PSModule/Release-GHRepository-Test#4).
Merge this driver next. Do not start a fixture case yet.
2. Merge the [baseline comparison
driver](#123).
Follow its procedure to verify the published action before you test the
candidate with the same case.
3. Wait until both comparison runs pass verification before you start an
ordinary fixture case. This keeps the fixture release inventory
available for the comparison.
4. For an ordinary case, set `candidate_pr` to an open, compatible pull
request from this repository to `main`. Omit `candidate_pr` only after
producer `main` supports the fixture contract. After an independent
squash merge, verify the push with `fixture_pr`.

</details>

<details>
<summary>Technical details</summary>

- The driver tests reproduced both review findings before the fix. All
35 tests pass with Pester 5.7.1 and 6.1.0 without credentials. A
metadata check rejected producer `main` at
`0fbca9f0c422d1d8f79e97b3b9fe1d50e106feab` and accepted
#109 at
`3f22cf227aee5709f430eeb79885a2121807a629`.
- The driver accepted fixture-generated pull request and squash reports
in a local contract test. It rejected a report for a different squash
commit.
- The current head is `4d34fc6f3530475a28e7cd87ecc35581d0d03c92`. It
merges cleanly with #109. The updated
comparison PR includes this head and passes all 64 credential-free tests
at `69a92bd5fd21b546f61c57ca417847ba5aa95bc2`.
- All 18 hosted checks passed on the current head. See [driver
tests](https://github.com/PSModule/Release-GHRepository/actions/runs/46546713504),
[action
tests](https://github.com/PSModule/Release-GHRepository/actions/runs/46546713453),
[linters](https://github.com/PSModule/Release-GHRepository/actions/runs/46546713510),
and the [clean automated
review](#122 (review)).
- The scoped task plan is complete. The issue convergence search covered
open fixture, integration, and release-workflow issues in this
repository. No other issue is fully resolved by this diff.
- The live workflow has not run. The first credentialed comparison
requires both producer changes on `main`. This PR does not change
`action.yml`, `src`, or the existing release workflow. It changes no
versioned action or consumer template.

| Changed surface | Standards checked | Framework docs checked | Result
|
| --- | --- | --- | --- |
| `.github/scripts/*.ps1`, `.github/scripts/ReleaseFixture.psm1` |
[PowerShell](https://github.com/MSXOrg/docs/blob/main/src/docs/Coding-Standards/PowerShell/index.md)
| [GitHub REST
contents](https://docs.github.com/en/rest/repos/contents#get-repository-content)
and [fixture
workflow](https://github.com/PSModule/Release-GHRepository-Test/blob/d1a37576ffdb4be89cc183df6a5700d3e2769d9c/.github/workflows/Release-Test.yml)
| Fixed in this PR |
| `.github/workflows/Fixture-Test.yml` | [GitHub
Actions](https://github.com/MSXOrg/docs/blob/main/src/docs/Coding-Standards/GitHub-Actions.md),
YAML | [App token
scope](https://github.com/actions/create-github-app-token#inputs) and
[Ubuntu 24.04
tools](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md)
| Aligned. The scoped Checkov exception applies to case selection, not
producer build inputs. |
| `.github/workflows/Fixture-Driver-Test.yml`,
`tests/ReleaseFixture.Tests.ps1` |
[Testing](https://github.com/MSXOrg/docs/blob/main/src/docs/Coding-Standards/Testing.md),
GitHub Actions, YAML, PowerShell | [Pester
commands](https://pester.dev/docs/commands/Invoke-Pester) and the
schema-2 fixture report contract | Aligned |
| `docs/Fixture-Test.md` | [Technical Writing
Guide](https://github.com/MSXOrg/docs/blob/main/src/docs/Coding-Standards/Writing-Guide.md),
Markdown | Driver dispatch inputs and fixture contract | Fixed in this
PR |

</details>

<details>
<summary>Related links</summary>

- Resolves #124
- Depends on PSModule/Release-GHRepository-Test#3 and
PSModule/Release-GHRepository-Test#4 for the fixture contract.
- Followed by #123 for the baseline
comparison.
- References #109 as the first action
candidate.

</details>
Base automatically changed from shelly-fixture-driver to main December 2, 2026 00:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The one-shot, write-enabled comparison depends on live fixtures, App permissions, and cross-workflow ordering that mocked tests cannot verify, requiring maintainer confirmation of merge hold points and credentialed baseline-before-candidate evidence.

No open issues 🎉

Review effort: Balanced

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Add baseline-first pair comparison driver for fixture tests Fixture tests compare the published baseline with a candidate Dec 2, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) added the release:skip Validate this change without publishing a release. label Dec 2, 2026
Copilot AI balanced review requested due to automatic review settings December 2, 2026 00:44
@MariusStorhaug Marius Storhaug (MariusStorhaug) removed the release:skip Validate this change without publishing a release. label Dec 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because a labeling failure can leave a created fixture PR unreported and block retries.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 00:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Maintainer validation is needed because the comparison publishes persistent releases through external workflows, but mocked tests and a dry run do not verify hosted permissions, event routing, publication, or manual handoffs.

No open issues 🎉

Review effort: Balanced

@MariusStorhaug
Marius Storhaug (MariusStorhaug) merged commit c7300f9 into main Dec 2, 2026
19 checks passed
@MariusStorhaug
Marius Storhaug (MariusStorhaug) deleted the baseline-first-comparison-driver branch December 2, 2026 07:55
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.

2 participants