Skip to content

Commit b8f9893

Browse files
authored
Consolidate builder sources (#733)
Use the GitHub source; it should work like Git. Inline GIT_KWDS and GIT_URL, now that they're only used in one place.
1 parent 0d5f68e commit b8f9893

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

master/master.cfg

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,24 +128,8 @@ c["caches"] = {
128128
# workers are set up in workers.py
129129
c["workers"] = [w.bb_worker for w in WORKERS]
130130

131-
GIT_URL = str(settings.git_url)
132-
133131
# git_branches used to be here; moved to branches.py
134132

135-
# common Git() and GitHub() keyword arguments
136-
GIT_KWDS = {
137-
"timeout": 3600,
138-
# "git clean -fdx": remove all files which are not tracked by Git,
139-
# ignoring the .gitignore rules (ex: remove also ".o" files).
140-
"mode": "full",
141-
"method": "fresh",
142-
# Partial (blobless) clone: only fetch commit and tree objects,
143-
# blobs are fetched on demand during checkout.
144-
"filters": ["blob:none"],
145-
# If fetch fails, wipe and re-clone instead of failing the build.
146-
"clobberOnFailure": True,
147-
}
148-
149133
c["builders"] = []
150134
c["schedulers"] = []
151135

@@ -221,9 +205,24 @@ for branch in BRANCHES:
221205
buildername = name + " " + branch.name
222206

223207
if branch.is_pr:
224-
source = GitHub(repourl=GIT_URL, **GIT_KWDS)
208+
branch_args = {}
225209
else:
226-
source = Git(repourl=GIT_URL, branch=branch.git_branch, **GIT_KWDS)
210+
branch_args = {'branch': branch.git_branch}
211+
212+
source = GitHub(
213+
repourl=str(settings.git_url),
214+
timeout=3600,
215+
**branch_args,
216+
# "git clean -fdx": remove all files which are not tracked by Git,
217+
# ignoring the .gitignore rules (ex: remove also ".o" files).
218+
mode="full",
219+
method="fresh",
220+
# Partial (blobless) clone: only fetch commit and tree objects,
221+
# blobs are fetched on demand during checkout.
222+
filters=["blob:none"],
223+
# If fetch fails, wipe and re-clone instead of failing the build.
224+
clobberOnFailure=True,
225+
)
227226

228227
f = buildfactory(
229228
source,

0 commit comments

Comments
 (0)