Skip to content

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 #62

Closed

Description

@matt-edmondson

What's wrong

#57 fixed #41 by adding a Validate Package step to .github/workflows/dotnet.yml. On pull_request it packs the projects ktsubuild release would pack, so a change that breaks ApiCompat package validation fails its PR instead of being auto-merged.

ci-shared.yml sends private .NET repositories to .github/workflows/dotnet-private.yml instead (dotnet-private: job, line ~169), and that pipeline has no equivalent step. On a pull request it runs ktsubuild ci (dotnet-private.yml, "Run KtsuBuild CI Pipeline"). KtsuBuild only packs inside the release, and BuildConfigurationProvider sets ShouldRelease = isMain && !isTagged && isOfficial (KtsuBuild/Configuration/BuildConfigurationProvider.cs:49). A PR ref is never refs/heads/main, so a PR run in a private repository never packs and never runs package validation. This is the gap #41 describes, still open on the private path.

Concrete case

ktsu-dev/PkmnDB is private and routes through dotnet-private.yml. Its PkmnDB/PkmnDB.csproj is a ktsu.Sdk library, so it is packed and validated at release, and Pkmn/Pkmn.csproj references Polyfill with PrivateAssets="all". A Dependabot Polyfill bump like the one that broke ~19 public repos (CP0014/CP0015 on Polyfill shim types) would build and test green on its PR. dependabot-merge.yml would then merge it, and the next main run would fail at pack, leaving the repository unreleasable until someone notices. That is the sequence #41 lists for the public repos.

Suggested fix

Add the same pack-only step to dotnet-private.yml after "Run KtsuBuild CI Pipeline":

  • gated on github.event_name == 'pull_request'
  • also gated on the pipeline step not having been skipped
  • the same project selection: no tests, benchmarks, samples, examples or demos, and no iOS-only projects
  • dotnet pack --configuration Release --no-build --output $RUNNER_TEMP/pr-pack with the solution context

Better still, move the step's script into one shared place both pipelines call, so the two copies can't drift apart. scripts/tests/dotnet-pr-pack.tests.ps1 already exercises the dotnet.yml copy and can be pointed at both.

Note that the fix only reaches callers once the release tag moves (#49), as with the dotnet.yml change.

Acceptance criteria

  • A pull request in a private repository whose change makes dotnet pack -c Release fail package validation shows a failed check, so the Dependabot auto-merge does not merge it.
  • No package is pushed and no tag is created from a private PR run.
  • A held repository (KTSU_RELEASE_HOLD=true) either packs the same way on PRs or documents why it doesn't.
  • scripts/tests/ covers the private pipeline's step, as dotnet-pr-pack.tests.ps1 covers the public one.

Activity

  1. added
    bug
    on Nov 11, 2026
  2. matt-edmondson commented on Nov 11, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions