Skip to content

ci: pack on pull requests in the private pipeline too (#62) - #63

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/optimistic-clarke-xjgt6u
Nov 13, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/optimistic-clarke-xjgt6u

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #62

What was wrong

#57 added a Validate Package step to dotnet.yml, so a PR that breaks dotnet pack package validation fails instead of being auto-merged (#41). ci-shared.yml sends private .NET repositories to dotnet-private.yml, which had no such step. There, a PR runs ktsubuild ci, and KtsuBuild packs only inside a release, which a PR ref never reaches. So a private repository's Dependabot PR that broke ApiCompat would build green, be merged, and leave main unable to release.

Change

  • dotnet-private.yml: a Validate Package step after Run KtsuBuild CI Pipeline in the build job. It has the same gates as the public one (pull_request only, and not when the build was skipped) and the same script. That script packs the projects a release would, with --no-build in Release, into RUNNER_TEMP. Nothing is pushed or tagged.
  • Held repositories (KTSU_RELEASE_HOLD=true) pack on PRs too. Validating a package publishes nothing. I checked that ktsubuild build defaults to the Release configuration, as ci does (KtsuBuild.Tool/Commands/GlobalOptions.cs), so the --no-build pack finds its output.
  • One script, two copies, kept identical by a test. A reusable workflow runs in the caller's checkout, so it can't read a script from this repository without a second checkout of ktsu-dev/.github at the right ref. So the private step holds a byte-for-byte copy of dotnet.yml's script, and comments in both files point at each other.
  • scripts/tests/dotnet-pr-pack.tests.ps1 now runs every case against both pipelines. It checks placement (after the build step and in the same job, before Release where there is one), gating, the "no publishing" rule, and the stub-dotnet pack behaviour. A new case fails if the two copies differ.
  • docs/shared-ci.md and CLAUDE.md describe the private step.

As with #57, callers pick this up only once the release tag moves (#49).

Tests

  • dotnet-pr-pack.tests.ps1: 11/11 pass.
  • With dotnet-private.yml reverted to main: 2 of 7 cases fail ("no Validate Package step" and "no step in both pipelines to compare").
  • With one line of the private copy changed: the drift case fails, 1 of 11.
  • Every scripts/tests/*.tests.ps1 passes locally under pwsh (14 files). Both workflows parse as YAML.

Generated by Claude Code

dotnet-private.yml had no Validate Package step, and `ktsubuild ci` packs
only inside a release, which a pull request never reaches. A private
repository's PR that broke package validation went green, was auto-merged,
and left main unreleasable: the gap #41 closed for dotnet.yml only.

Add the same pull_request-only, pack-only step after the KtsuBuild step.
Held repositories pack too; nothing is pushed or tagged. The script is a
copy of dotnet.yml's, since a reusable workflow cannot read this
repository's scripts, and dotnet-pr-pack.tests.ps1 now runs both copies
and fails if they differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW3u8Ga41rqFWd6Sy25
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 694df53 into main Nov 13, 2026
7 checks passed
@matt-edmondson
matt-edmondson deleted the claude/optimistic-clarke-xjgt6u branch November 13, 2026 21:43
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.

Private repositories still auto-merge PRs that break dotnet pack: #41's Validate Package step was added to dotnet.yml only, not dotnet-private.yml

2 participants