Skip to content

Make Merge-Upstreams -DryRun exact and skip every workflow job in private repositories - #109

Merged
IvanPavlak merged 1 commit into
masterfrom
merge-upstreams-exact-dry-run
Oct 28, 2026
Merged

IvanPavlak merged 1 commit into
masterfrom
merge-upstreams-exact-dry-run

Conversation

@IvanPavlak

Copy link
Copy Markdown
Owner

Description

WinuX 2.0.1, two fixes that showed up on the first real merge of WinuX 2.0.0 into a fork of WinuX and Foundation.

  • Merge-Upstreams -DryRun lists exactly what the merge would do. It listed everything the upstream changed since the last merge. A fork that already had the change was shown 622 paths "taken" and 560 "declined" that the real run never touched, and the dry run could not say which conflicts the real run would stop on. It now has git merge-tree (git 2.38 or newer) compute the same merge, with the same attributes and merge drivers, into a tree of its own, touching neither the index nor the working tree:

    tree      = git merge-tree --write-tree --name-only --no-messages HEAD REF
    changes   = git diff --name-status HEAD tree  +  conflicted paths as U
    for each change: the ownership rule decides take / put back
    U in a taken path    -> "would stop on this conflict"
    U in a declined path -> put back (that resolves it)
    mirror whose merged copy != the upstream's -> mirror drift
    

    The real run is unchanged.

  • No workflow job runs in a private repository. A private fork that merges WinuX carries WinuX's workflows. Every push to it ran the Pester suite on a Windows runner (6.5 minutes, plus a failure the public run does not have), the lint, and the release checks. Every job of winux.yml, lint.yml, release.yml and winux-release.yml now carries if: ${{ !github.event.repository.private }}, the guard Foundation's macOS job already had. WinuX is public, so nothing changes here.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature / function (non-breaking change that adds functionality)
  • Deprecation (a new shape replaces an old one that keeps working and names its replacement - a ### Deprecated changelog entry with the migration, and a record in the Deprecated map of Modules/Tests/ContractBaseline.json with the version it ships in, see VERSIONING.md)
  • Breaking change (removes a deprecated shape, or cannot keep the old one working - a MAJOR under VERSIONING.md's deprecation policy)
  • Documentation only
  • Tests only
  • Refactor / chore (no behavior change)

Quality bar

  • The change is minimal and focused (one logical change; reuses existing helpers, no duplication / DRY).
  • I understand and have tested this change myself (not unreviewed AI output).
  • No machine-specific values (paths, hostnames, usernames, emails) are hardcoded in functions.
  • Any new user-facing setting is driven by Configuration.psd1 using placeholder paths ({Dev}, {User}, {MachineType}, {RepoRoot}, {AppData}).

Tests

Run-Tests -UpdateContractBaseline
Run-Tests -TestName "Merge-Upstreams"
Run-Tests -TestName "Infrastructure"

All pass.

  • I added/updated tests under Windows/PowerShell/Modules/Tests/Modules/<Module>/.
  • All relevant tests pass locally (Run-Tests) and the Pester Tests check is green.
  • Tests cover behavior/side effects/branching, not just output text.
  • N/A - no testable behavior changed (docs/chore only).

The dry-run cases now check the prediction against the real run on the same repository:

  • what it stages and what it puts back;
  • that it lists nothing the branch already has;
  • a conflict predicted in a taken path, without starting a merge;
  • mirror drift only when the merged copy differs from the upstream's.

Documentation & manifests

  • I updated docs/winux/modules/<Module>.md for any added/renamed/removed/changed function.
  • I updated the module .psd1 FunctionsToExport.
  • I added/updated the configuration guide under docs/winux/configuration/guides/<module>/ for every added/renamed/removed function or changed Configuration.psd1 key (stub upgraded to full if the function now reads configuration), and its module README.md index.
  • I updated docs/winux/docs_overview.md (and docs/winux/_sidebar.md if a page was added/removed).
  • List-Functions -ListDiscrepancies reports no discrepancies and manifest completeness holds.
  • N/A - no exported function changed.

No function, parameter or configuration key was added, renamed or removed. The Fork Model describes the exact dry run and says a private fork runs no workflow.

Tested on

Windows version: Windows 11 Pro 26H2 (Version 10.0.26300 Build 26300)
PowerShell version: 7.6.9
Machine type(s): PC via a private fork

Checklist

  • My commit messages follow the project style (imperative, sentence case, no trailing period, no Conventional-Commits prefix).
  • My branch is up to date with master.
  • I read and agree to the Code of Conduct.
  • This PR contains no secrets or personal data (tokens, real paths/hostnames/emails).

Additional notes / screenshots

The Foundation side (0.2.1) lands in IvanPavlak/Foundation under the same branch name. On the same throwaway repository, both implementations predict and then stage the identical result:

  • a declined conflict and a new hallway file put back;
  • a taken conflict left to resolve;
  • mirror drift flagged.

@IvanPavlak
IvanPavlak merged commit 58830e0 into master Oct 28, 2026
3 checks passed
@IvanPavlak
IvanPavlak deleted the merge-upstreams-exact-dry-run branch October 28, 2026 09:26
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.

1 participant