From e701a6aeedf4ea8e8b74f1d7a2d775d4e83bd1d4 Mon Sep 17 00:00:00 2001 From: Wei Hu Date: Mon, 3 Aug 2026 07:07:00 +0000 Subject: [PATCH 1/2] Use shallow checkout for SDK regeneration jobs The regeneration jobs do not read repository history. Fetch only the checked-out commit and skip tags to reduce checkout time and aggregate agent consumption. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../pipelines/templates/archetype-typespec-emitter.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/common/pipelines/templates/archetype-typespec-emitter.yml b/eng/common/pipelines/templates/archetype-typespec-emitter.yml index d3770c797e37..4777ebf4f895 100644 --- a/eng/common/pipelines/templates/archetype-typespec-emitter.yml +++ b/eng/common/pipelines/templates/archetype-typespec-emitter.yml @@ -303,7 +303,11 @@ extends: jobs: - job: Initialize steps: + # Regeneration does not read repository history. Avoid fetching the full + # history and tags for this large repository. - checkout: self + fetchDepth: 1 + fetchTags: false - template: /eng/common/pipelines/templates/steps/login-to-github.yml parameters: @@ -399,6 +403,8 @@ extends: emitterNpmrcPath: $(Agent.TempDirectory)/${{ parameters.EmitterPackagePath }}/.npmrc steps: - checkout: self + fetchDepth: 1 + fetchTags: false - template: /eng/common/pipelines/templates/steps/login-to-github.yml parameters: From 27855556deedf5de00dcd863a9befc025ab9a356 Mon Sep 17 00:00:00 2001 From: Wei Hu Date: Tue, 4 Aug 2026 06:11:27 +0000 Subject: [PATCH 2/2] Clarify shallow checkout constraint Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../pipelines/templates/archetype-typespec-emitter.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/archetype-typespec-emitter.yml b/eng/common/pipelines/templates/archetype-typespec-emitter.yml index 4777ebf4f895..8f25eeb8ba3e 100644 --- a/eng/common/pipelines/templates/archetype-typespec-emitter.yml +++ b/eng/common/pipelines/templates/archetype-typespec-emitter.yml @@ -303,8 +303,9 @@ extends: jobs: - job: Initialize steps: - # Regeneration does not read repository history. Avoid fetching the full - # history and tags for this large repository. + # Regeneration does not read repository history, so fetch only the + # checked-out commit. git-branch-push.ps1's retry path diffs the branch + # tip against its parent, which stays inside the depth-1 boundary. - checkout: self fetchDepth: 1 fetchTags: false