Skip to content

Conversation

@adityamandaleeka
Copy link
Member

This PR optimizes the git checkout step across all CI jobs by using shallow clones (fetchDepth: 1) and disabling tag fetching (fetchTags: false).

The current default checkout fetches all branches, tags, and full history on all ~17 jobs we run. This takes a while (on some jobs well over a minute).

Since the jobs run in parallel we won't actually reduce wall clock time per PR by 17 minutes but this should help make our infrastructure more efficient.

@github-actions github-actions bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Dec 5, 2025
@adityamandaleeka
Copy link
Member Author

Looks like after this change, all the non-Windows checkout steps are 10 seconds and the Windows ones are 15 seconds. Before they varied a lot but were 30-90+ seconds each.

@adityamandaleeka adityamandaleeka marked this pull request as ready for review December 5, 2025 02:48
Copilot AI review requested due to automatic review settings December 5, 2025 02:48
@adityamandaleeka adityamandaleeka requested a review from a team as a code owner December 5, 2025 02:48
Copilot finished reviewing on behalf of adityamandaleeka December 5, 2025 02:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes CI performance by implementing shallow git clones (fetchDepth: 1) and disabling tag fetching (fetchTags: false) across all build jobs. The optimization is correctly applied to the shared build template, with an appropriate exception for the Code_check job in ci-public.yml which requires full git history for diff and log comparisons.

Key Changes

  • Added fetchDepth and fetchTags as configurable parameters in default-build.yml with optimized defaults
  • Added explicit checkout steps using these parameters in both job definitions (public and internal)
  • Overrode the default with fetchDepth: 0 for the Code_check job which requires full git history

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.azure/pipelines/jobs/default-build.yml Adds fetchDepth and fetchTags parameters with defaults (1 and false), and adds explicit checkout steps to both public and internal job templates
.azure/pipelines/ci-public.yml Overrides fetchDepth to 0 for Code_check job that needs full history for git log/diff operations

@adityamandaleeka adityamandaleeka merged commit 65916c5 into dotnet:main Dec 5, 2025
30 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview1 milestone Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants