Skip to content

Fix Dependabot nuget scan timeout with exclude-paths - #68171

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/dependabot-nuget-exclude-paths
Aug 3, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/dependabot-nuget-exclude-paths

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description

The Dependabot nuget-updater job (GitHub's dynamic dependabot/dependabot-updates workflow) has been timing out on every run since #68012 merged, e.g. https://github.com/dotnet/aspnetcore/actions/runs/30814186376. It hits an internal ~55 minute job cap enforced by GitHub's Dependabot service (not configurable via workflow/dependabot.yml).

Root cause

Dependabot performs an individual "single restore" per discovered .csproj file under the scanned directories (/ and /eng/tools/DependabotDiscovery), at ~11.8s/project. The repo has 600+ .csproj files, but only 26 of them contain any explicit PackageReference ... Version="..." attribute -- the rest resolve versions indirectly via Directory.Build.props/Dependencies.props (LatestPackageReference) or reference in-repo shared-framework assemblies. Scanning those adds restore time without adding anything Dependabot can actually act on.

Fix

Add exclude-paths (GA since Aug 2025) to skip manifest parsing/restoring for test/tests/*.Tests/*.FunctionalTests/sample/samples/testassets/perf/benchmark* trees, which account for the bulk of low-value scans. This brings the scanned project count from 618 down to ~219 (~43 min estimated restore time, comfortably under the ~55 min cap).

The handful of excluded .csproj files that do have explicit package versions (e.g. src/Mvc/perf/benchmarkapps/BasicApi, IIS.NewHandler.FunctionalTests, InProcessNewShimWebSite) are intentionally pinned to old versions for legacy/back-compat testing and shouldn't be bumped by Dependabot anyway.

Testing

Validated the resulting YAML parses correctly. Modeled the exclude patterns against the full list of 618 .csproj paths in the repo to confirm the impact and estimate the new restore-time budget.

The dynamic Dependabot nuget-updater job (dynamic/dependabot/dependabot-updates)
has been timing out/getting cancelled on every run since dotnet#68012 merged
(e.g. https://github.com/dotnet/aspnetcore/actions/runs/30814186376), hitting
an internal ~55 minute job cap enforced by GitHub's Dependabot service.

The job performs an individual "single restore" per discovered .csproj file
under the scanned directories (~11.8s/project observed). The repo has 600+
.csproj files, but only 26 of them have any explicit PackageReference
Version="..." attribute - the rest resolve versions indirectly via
Directory.Build.props/Dependencies.props (LatestPackageReference) or
reference in-repo shared-framework assemblies, so scanning them adds restore
time without adding anything Dependabot can act on.

Exclude test/sample/benchmark/perf trees, which account for the bulk of the
low-value scans, bringing the scanned project count from 618 down to ~219
(~43 min estimated restore time, comfortably under the cap). The excluded
csproj files that do have explicit package versions
(e.g. src/Mvc/perf/benchmarkapps/BasicApi, IIS.NewHandler.FunctionalTests,
InProcessNewShimWebSite) are intentionally pinned to old versions for
legacy/back-compat testing and shouldn't be bumped by Dependabot anyway.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings August 3, 2026 18:05
@wtgodbe
wtgodbe requested a review from a team as a code owner August 3, 2026 18:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repository’s Dependabot NuGet configuration to avoid GitHub Dependabot job timeouts by excluding low-value project trees from NuGet discovery/restores, keeping Dependabot runs within the service’s fixed time cap.

Changes:

  • Added exclude-paths to the NuGet Dependabot update entry to skip scanning/restoring projects under common test/sample/perf/benchmark directories.
  • Documented (in-file) why the exclusions are necessary and what problem they address.

@wtgodbe
wtgodbe merged commit 99fa485 into dotnet:main Aug 3, 2026
12 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 4, 2026
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