Skip to content

CI - Measure the repository size on development and the pull request only - #10865

Merged
potatoqualitee merged 2 commits into
developmentfrom
ci-reposize-single-branch
Nov 22, 2026
Merged

potatoqualitee merged 2 commits into
developmentfrom
ci-reposize-single-branch

Conversation

@andreasjordan

@andreasjordan andreasjordan commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

"Check repo size" fails on every pull request since 2026-11-19, also on #10862 from a fork, whatever the pull request changes. The step clones every branch of dataplat/dbatools and then checks out the pull request, so branches that have nothing to do with the pull request count as well. The branch native-release (pushed 2026-11-19, 15 commits of its own with about 7.6 MB of assemblies such as msodbcsql17.dll and the Replication, RMO and DTS libraries) moved the measured size over the limit:

Run Pull request Repo size (KiB)
2026-11-16 21:12 #10852 101,402
2026-11-20 08:00 #10862 110,375
2026-11-22 16:44 #10852 110,456
2026-11-22 17:11 #10864 110,478

development did not change between the first two runs.

Change

  • The clone takes development only (--single-branch --branch development).
  • In a clone of one branch, gh pr checkout cannot track the branch of a pull request from this repository ("cannot set up tracking information; starting point 'origin/...' is not a branch"), because the fetch refspec covers development only. The refspec is widened before the checkout. gh pr checkout still fetches just the branch of the pull request (git fetch origin +refs/heads/<branch>:refs/remotes/origin/<branch> --no-tags, seen with GIT_TRACE).
  • A failed checkout now fails the step. Before, the step went on and measured development alone, and a pwsh step ends with the exit code of its last command, so it passed.

The limit of 105,000 KiB and its comments are unchanged. A pull request from an outdated clone carries the old history in its own commits, which the checkout fetches, so the check still catches it.

Tests

The script of the step, run locally with the wrapper of shell: pwsh ($ErrorActionPreference = "stop" before, exit $LASTEXITCODE after) and a fresh clone each time:

The run of "Check repo size" on this pull request uses the changed workflow: it checked out ci-reposize-single-branch at 7542525d6 and measured 100,302 KiB.

Suggestion: one line ending in the file

reposize.yml mixes line endings: 32 of its 51 lines end in CRLF and 19 in LF (24 and 19 before this pull request). .gitattributes sets * -text, so Git keeps them as they were committed. This pull request leaves them alone, so that its diff shows only the change; the new lines end in CRLF like the lines around them.

If you agree, an additional commit converts the whole file to LF, which 14 of the 19 workflows use (xplat-import.yml is CRLF). That commit touches every line of the file, which is why it would come as a commit of its own and not inside the fix. gallery.yml, integration-tests.yml, integration-tests-s3.yml and .gitignore mix line endings as well; they could get the same in a pull request of their own.

🤖 Generated with Claude Code

…only

Check repo size cloned every branch of dataplat/dbatools before it
checked out the pull request, so a branch that has nothing to do with
the pull request counted as well. Since the branch native-release was
pushed on 2026-11-19 with about 7.6 MB of assemblies, the measured size
went from 101,402 KiB (2026-11-16) to 110,375 KiB, and the check fails
on every pull request, also on #10862 from a fork.

The clone now takes development only. gh pr checkout fetches only the
branch of the pull request, but in a clone of one branch it cannot
track that branch ("starting point ... is not a branch"), because the
fetch refspec covers development only; the refspec is widened before
the checkout, which still fetches just that one branch. A failed
checkout now fails the step: before, it measured development alone and
passed.

The script of the step, run locally with the wrapper of shell: pwsh:
100,326 to 100,335 KiB for #10863 and #10864 (branches in this
repository) and for #10862 (fork), and a failure for a pull request
that does not exist. A pull request from an outdated clone carries the
old history in its own commits, which the checkout fetches, so the
check still catches it.

(do Get-DbaManagementObject)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andreasjordan
andreasjordan marked this pull request as ready for review November 22, 2026 17:46
@potatoqualitee

Copy link
Copy Markdown
Member

Ahh I just fixed this on dev. We should be set.

@potatoqualitee

Copy link
Copy Markdown
Member

Wait what it's complex like this? I thought it was just the size that grew over time.

@andreasjordan

Copy link
Copy Markdown
Collaborator Author

Not over time: development itself grows slowly, a clone of only that branch is 100,302 KiB today. The jump came from gh repo clone, which fetches every branch of the repository. Between the run of 11-16 (101,402 KiB) and the one of 11-20 (110,375 KiB) development did not change, but native-release was pushed on 11-19, with about 7.6 MB of assemblies of its own, and every full clone carries them.

Your raise to 125,480 KiB makes the check green again. What this pull request would add:

  • The check measures development plus the pull request, so a branch with binaries in this repository does not count against every pull request again.
  • A failed gh pr checkout fails the step. Before, the step measured development alone and passed.
  • The comment in the step names 110,299 KiB as the size of an outdated clone. With the limit at 125,480, a clone of that size passes now. Measured on one branch, the limit could stay at 105,000, which still catches it.

The remote.origin.fetch line is the only extra complexity: in a clone of one branch, gh pr checkout cannot track the branch of a pull request without it.

If the raise is enough for you, I'll close this pull request.


This text was created by Claude and reviewed by Andreas Jordan.

@potatoqualitee
potatoqualitee merged commit 9d10108 into development Nov 22, 2026
27 checks passed
@potatoqualitee
potatoqualitee deleted the ci-reposize-single-branch branch November 22, 2026 18:32
@potatoqualitee

Copy link
Copy Markdown
Member

deal 👍🏼

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.

2 participants