Make pipelines checkout faster with fetchDepth: 1 and fetchTags: false#27342
Make pipelines checkout faster with fetchDepth: 1 and fetchTags: false#27342CraigMacomber wants to merge 7 commits into
Conversation
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (159 lines, 17 files), I've queued these reviewers:
How this works
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Speeds up Azure Pipelines checkout by adding fetchDepth: 1 and fetchTags: false to all checkout steps across the pipeline YAMLs, reducing checkout time significantly (e.g., 63s→7s on small agents). A unit test that depended on real git tags being present is refactored to mock the git client.
Changes:
- Add
fetchDepth: 1andfetchTags: falseto everycheckoutstep in the pipeline YAMLs. - Refactor
fromTag.test.tsto mocksimpleGitso the test no longer relies on real tags being checked out. - Keep the real-git variant of the test as a manually-enabled (skipped-by-default) path.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/pipelines/test-perf-benchmarks.yml | Shallow checkout for self and ff_pipeline_host. |
| tools/pipelines/templates/upload-telemetry/include-stage-upload-telemetry.yml | Shallow checkout for ff_pipeline_host. |
| tools/pipelines/templates/upload-server-manifest.yml | Shallow checkout for self. |
| tools/pipelines/templates/upload-dev-manifest.yml | Shallow checkout for self. |
| tools/pipelines/templates/include-test-real-service.yml | Shallow checkout for ff_pipeline_host and self. |
| tools/pipelines/templates/include-publish-npm-package-deployment.yml | Shallow checkout for self. |
| tools/pipelines/templates/include-publish-docker-service-steps.yml | Shallow checkout for self. |
| tools/pipelines/templates/include-policy-check.yml | Shallow checkout for self. |
| tools/pipelines/templates/build-npm-package.yml | Shallow checkout for build job. |
| tools/pipelines/templates/build-npm-client-package.yml | Shallow checkout in three build jobs. |
| tools/pipelines/templates/build-docker-service.yml | Shallow checkout for build job. |
| tools/pipelines/repo-policy-check.yml | Shallow checkout for self. |
| tools/pipelines/publish-api-model-artifact.yml | Shallow checkout in two stages. |
| tools/pipelines/deploy-website.yml | Shallow checkout across four stages. |
| tools/pipelines/build-performance-observability.yml | Shallow checkout for self. |
| tools/pipelines/build-docs.yml | Shallow checkout across five stages. |
| build-tools/packages/build-cli/src/test/commands/release/fromTag.test.ts | Mock simpleGit.tags/show so the test no longer depends on local tags; gate real-git path behind this.skip(). |
| } else { | ||
| // Skip real git test by default, as it requires specific tags to be present in the local repo, which may not be the case in all environments. | ||
| // Disable this skip if you want to test against the actual git repo and tags. | ||
| this.skip(); | ||
| const { stdout } = await runCommand(["release:fromTag", tag, "--json"], { | ||
| root: import.meta.url, | ||
| }); | ||
| output = JSON.parse(stdout); | ||
| } |
There was a problem hiding this comment.
This is intended and documented.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| fetchDepth: 1 | ||
| fetchTags: false |
There was a problem hiding this comment.
This one would be my main concern, together with the corresponding one in include-publish-docker-service-steps.yml. As I mentioned in Teams, I think flub does need the tags to be available at some point during the release/publish process, but I can't recall where exactly. @tylerbutler might remember.
|
Besides the two referenced the comment above, I think all the other shallow clones are probably safe and worth it. |
|
Some interesting cases are called out in a previous attempt at this in #26193 : I need to review those and accommodate them. |
Description
For small agents, the checkout step took:
Repo policy check also showed the same change.
This also removes some console spam from all the tags and branches.
This seems like a nice win for pipeline performance, saving around a minute. Other pipelines on larger agents might benefit less.
Large agents, like used for client build show less of a gain:
One test was found (and fixed) which depended on having tags present in the repo when the test ran.
Reviewer Guidance
The review process is outlined on this wiki page.