Skip to content

One shared altConfigs selection, failing loudly on an empty selection - #4

Merged
sakanni merged 2 commits into
developfrom
refactor/shared-altconfigs-selection
Aug 20, 2026
Merged

One shared altConfigs selection, failing loudly on an empty selection#4
sakanni merged 2 commits into
developfrom
refactor/shared-altconfigs-selection

Conversation

@sakanni

@sakanni sakanni commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

altConfigs selection was implemented twice and about to be implemented a third time. ci-build used Select-AltConfigs.ps1, resolve-dependencies carried its own inline copy, and a draft for ci-versioning added a third that filtered entries on their org/repo segments against github.repository.

That third filter is why this is a refactor and not a tidy-up. It selects nothing on any fork, because github.repository is the fork's path while altConfigs.txt names the upstream. Observed on a sandbox run: the step executed, found the file, selected zero configurations, printed nothing and reported success. It would also select nothing on Revit_ModelQA_Tool, whose file names a different repository on all ten lines. The shared implementation ignores org/repo deliberately, which is correct for both cases and is now the only implementation.

Changes:

  • Select-AltConfigs.ps1 and Build-AltConfigs.ps1 move to .github/scripts/, alongside the Pester tests that already live there
  • ci-build and resolve-dependencies consume them; the inline parse in Build-Dependencies.ps1 is deleted
  • ci-versioning gains an alt-config build using the same script, which closes a measured gap: resolve-dependencies already builds every dependency's Release* configurations, but nothing builds the caller's own. On sandbox Revit_Toolkit, 0 year-suffixed assemblies after dependencies and 2 after its Release-only build, against 10 lines in its altConfigs.txt. Cost measured over three runs on windows-2025-vs2026: 76s against a 47s baseline, 1.6x, because the first configuration carries the warm-up and each further one takes 4 to 8 seconds.

The new assertion is the point of the change. A non-empty altConfigs.txt that selects nothing now fails with the entries it saw, instead of exiting 0 in silence. The absence of a signal was the damage; the filter was only how the silence arose.

Failing is safe because the alternative shape does not exist. Across the fleet, 14 repositories carry altConfigs.txt and every one is exactly 10 lines, 5 Release and 5 Debug. None is Debug-only. A test records that a Debug-only file would fail, so the choice is visible rather than accidental.

Six new Pester tests, 22 in the file. Three mutations, each caught by the intended test: always-silent, which is the old behaviour, plus dropping either guard.

Cross-action script references use $GITHUB_ACTION_PATH/../../scripts, the same derivation prepare-runner already uses to find the repository root. Confirmed against a real runner log that the action checkout carries the whole repository layout, so .github/scripts is present.

@sakanni
sakanni merged commit 0bb724d into develop Aug 20, 2026
3 checks passed
@sakanni
sakanni deleted the refactor/shared-altconfigs-selection branch August 20, 2026 02:09
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