Skip to content

Commit 66006d4

Browse files
authored
Revert "feat: reduce clone/fetch size when building docs PRs (#3094)" (#3098)
This reverts commit 3de8dad.
1 parent 3de8dad commit 66006d4

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

.buildkite/scripts/build_pr.sh

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then
4848
echo "Cloning the ${GITHUB_PR_BASE_REPO} PR locally"
4949

5050
git clone --reference /opt/git-mirrors/elastic-$GITHUB_PR_BASE_REPO \
51-
--filter=tree:0 --no-checkout --no-tags --depth 1 -v --branch "$GITHUB_PR_TARGET_BRANCH" \
5251
[email protected]:elastic/$GITHUB_PR_BASE_REPO.git ./product-repo
5352

5453
cd ./product-repo &&
55-
git fetch --no-tags origin pull/$GITHUB_PR_NUMBER/head:pr_$GITHUB_PR_NUMBER &&
54+
git fetch origin pull/$GITHUB_PR_NUMBER/head:pr_$GITHUB_PR_NUMBER &&
5655
git switch pr_$GITHUB_PR_NUMBER
5756

5857
# Some repositories allow the documentation build to exit early if there are no doc-related changes
@@ -62,114 +61,114 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then
6261

6362
# repositories with a docs dir and changelog
6463
"apm-aws-lambda" | "apm-agent-android" | "apm-agent-nodejs" | "apm-agent-python" | "apm-agent-ruby" | "apm-agent-rum-js" | "apm-agent-go" | "apm-agent-java" | "apm-agent-dotnet" | "apm-agent-php" | "apm-agent-ios")
65-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
64+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
6665
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs CHANGELOG.asciidoc)
6766
;;
6867

6968
# repositories with a docs dir
7069
"apm-k8s-attacher" | "cloud" | "cloud-assets" | "cloud-on-k8s" | "ecctl" | "ecs" | "ecs-dotnet" | "ecs-logging" | "ecs-logging-go-logrus" | "ecs-logging-go-zap" | "ecs-logging-go-zerolog" | "ecs-logging-java" | "ecs-logging-nodejs" | "ecs-logging-php" | "ecs-logging-python" | "ecs-logging-ruby" | "elasticsearch-js" | "elasticsearch-js-legacy" | "elasticsearch-ruby" | "elasticsearch-php" | "elasticsearch-perl" | "elasticsearch-rs" | "kibana-cn" | "logstash" | "logstash-docs" | "security-docs" | "sense" | "swiftype")
71-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
70+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
7271
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs)
7372
;;
7473

7574
# repositories with a docs dir, changelogs dir, and changelog
7675
"apm-server")
77-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
76+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
7877
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./changelogs CHANGELOG.asciidoc)
7978
;;
8079

8180
"beats")
82-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
81+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
8382
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./auditbeat ./CHANGELOG.asciidoc ./docs ./filebeat ./heartbeat ./journalbeat ./libbeat/docs ./libbeat/outputs/*/docs/* ./libbeat/processors/*/docs/* ./metricbeat ./packetbeat ./topbeat/docs ./winlogbeat ./x-pack/auditbeat ./x-pack/dockerlogbeat/docs ./x-pack/filebeat/docs ./x-pack/filebeat/processors/*/docs/* ./x-pack/functionbeat ./x-pack/libbeat/docs ./x-pack/libbeat/processors/*/docs/* ./x-pack/metricbeat/module)
8483
;;
8584

8685
"clients-team")
87-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
86+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
8887
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/examples/elastic-cloud)
8988
;;
9089

9190
"curator")
92-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
91+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
9392
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/asciidoc)
9493
;;
9594

9695
"eland" | "enterprise-search-php" | "enterprise-search-python" | "enterprise-search-ruby")
97-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
96+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
9897
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide)
9998
;;
10099

101100
"elasticsearch")
102-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
101+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
103102
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client ./docs ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql)
104103
;;
105104

106105
"elasticsearch-hadoop")
107-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
106+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
108107
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/src/reference/asciidoc)
109108
;;
110109

111110
"elasticsearch-java")
112-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
111+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
113112
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./java-client/src/test/java/co/elastic/clients/documentation)
114113
;;
115114

116115
"elasticsearch-net")
117-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
116+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
118117
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./tests/Tests/Documentation)
119118
;;
120119

121120
"elasticsearch-py")
122-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
121+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
123122
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide ./docs/examples)
124123
;;
125124

126125
"go-elasticsearch")
127-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
126+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
128127
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./.doc)
129128
;;
130129

131130
"enterprise-search-pubs")
132-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
131+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
133132
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./enterprise-search-docs ./workplace-search-docs ./app-search-docs ./esre-docs ./client-docs/app-search-javascript ./client-docs/app-search-node ./client-docs/workplace-search-node)
134133
;;
135134

136135
"enterprise-search-js")
137-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
136+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
138137
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./packages/enterprise-search/docs)
139138
;;
140139

141140
"esf" | "ingest-docs" | "observability-docs" | "stack-docs" | "x-pack-logstash")
142-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
141+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
143142
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en)
144143
;;
145144

146145
"packagespec")
147-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
146+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
148147
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./versions ./spec)
149148
;;
150149

151150
"tech-content")
152-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
151+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
153152
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./welcome-to-elastic)
154153
;;
155154

156155
"terraform-provider-ec")
157-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
156+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
158157
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs-elastic)
159158
;;
160159

161160
"x-pack")
162-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
161+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
163162
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/public/graph ./docs/public/marvel ./docs/public/reporting ./docs/public/shield ./docs/public/watcher ./docs/en ./docs/kr ./docs/jp)
164163
;;
165164

166165
"x-pack-elasticsearch")
167-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
166+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
168167
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en ./docs/kr ./docs/jp ./qa/sql)
169168
;;
170169

171170
"x-pack-kibana")
172-
git fetch --no-tags --unshallow origin "$GITHUB_PR_TARGET_BRANCH"
171+
git fetch origin "$GITHUB_PR_TARGET_BRANCH"
173172
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en ./docs/kr ./docs/jp)
174173
;;
175174

0 commit comments

Comments
 (0)