Repository navigation
Leave the workflow's checkout alone when comparing with the base branch - #120
Merged
Merged
Conversation
The base step fetched the commits it compares with into the workflow's own checkout with --depth=1. In a checkout that was already complete, that cut the history of the commits it had, and a step after it that reads the version from tags, such as MinVer, found none. The commits are fetched into a repository of their own. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Mpdreamz
added a commit
to elastic/elastic-transport-net
that referenced
this pull request
Nov 25, 2026
… makes (#234) The API check now fails a pull request only for a breaking change the pull request itself makes, not for one that `main`, or a pull request below it in a stack, already has. **Prompt summary:** The API comments on the stacked 2.0 pull requests listed breaking changes that the pull requests did not touch, and would turn every pull request red whenever `main` has an unreleased breaking change. The owner asked for the check to follow only what a pull request itself changes, and for the pull requests that introduced the changes to be listed. ## Why Since #232 the action compared each build with the latest release on nuget.org. A pull request in the middle of a stack therefore showed everything below it: #227 changes nothing in the public API and still listed 32 breaking changes and failed the check. ## What #### assembly-differ 1.5.0 The pinned action, the `version:` input and the tool in `dotnet-tools.json` go from 1.4.0 to 1.5.1 ([nullean/assembly-differ#119](nullean/assembly-differ#119), and the fix of 1.5.0 in [#120](nullean/assembly-differ#120)). 1.5.0 fetched the base branch into the workflow's own checkout with `--depth=1`, which cut the history that MinVer reads in `validatepackages`; 1.5.1 fetches into a repository of its own. With `api-files: api`, the action now compares a pull request's committed `api/` with its base branch's, target framework by target framework, and the check, the release label and `--fail-on` follow that. The comparison with the latest release stays in the comment, collapsed and marked as information, with a table of the pull requests below this one that introduced the changes. A change that is the same in every framework is listed once. No workflow change is needed: the new step reads the base branch and the open pull requests of a stack with the token the job already has. **Out of scope:** the 2.0 stack picks this up once it is rebased onto `main`: a pull request runs the workflow of its base branch, so until then the stack pull requests run the old one. ## Verify ```bash dotnet tool restore ./build.sh verifyapi ``` On this pull request the comment compares with `main` and lists both libraries as having no changes. I ran the steps of the new action on the real stack beforehand: #227 gets `None` and passes, and #220, which does break the API, gets the `breaking` label and fails. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The base-branch step of the action no longer changes the workflow's checkout: the commits it compares with are fetched into a repository of its own, so a step after it that reads a version from tags still finds the tags.
Prompt summary: Move the Elastic.Transport repository to assembly-differ 1.5.0. Its pull request failed
validatepackageswith a version of0.1.0-canaryinstead of1.1.1-canary, and the owner asked to open the pull request, merge it and rebase the stack after.Why
The step added in 1.5.0 runs
git fetch --depth=1 origin <sha>in the workflow's checkout to read the committed API of the base branch. In a checkout that was already complete, which is whatfetch-depth: 0, or thegit fetch --unshallow --tagsthat elastic-transport-net runs, gives, that fetch cuts the history behind the commit: it becomes a shallow boundary and its parents are gone. MinVer, which runs in a later step, then sees the base branch tip as the first commit of the repository and no tag: elastic-transport-net's pull request gotCommit: 3913365, Height: 1, Version: 0.0.0-canaryandvalidatepackagesfailed on the version.What
A repository of its own
The step makes a bare repository under the runner's temp directory and fetches and archives the commits there, with the same token header as before, from the checkout's
origin. The workflow's checkout is not touched, and the comparison is the same.Verify
In a full clone of elastic/elastic-transport-net, at the tip of elastic/elastic-transport-net#227, I ran the base step of
mainand the base step of this branch, with the real GitHub API, and compared the clone before and after:Nothing in the repository can test the step, which runs on a runner, so this is the check; it fails for the old step, as the failed
validatepackagesdid.🤖 Generated with Claude Code