This repository has been archived by the owner on Jun 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
release.py
1563 lines (1438 loc) · 69.5 KB
/
release.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# The absolute_import directive looks firstly at what packages are available
# on sys.path to avoid name collisions when we import release.* from elsewhere
from __future__ import absolute_import
import os
from buildbot.process.buildstep import regex_log_evaluator
from buildbot.scheduler import Scheduler, Dependent, Triggerable
from buildbot.status.tinderbox import TinderboxMailNotifier
from buildbot.status.mail import MailNotifier
from buildbot.steps.trigger import Trigger
from buildbot.steps.shell import WithProperties
import release.platforms
import release.paths
import buildbotcustom.changes.ftppoller
import buildbotcustom.common
import build.paths
import release.info
reload(release.platforms)
reload(release.paths)
reload(buildbotcustom.changes.ftppoller)
reload(build.paths)
reload(release.info)
from buildbotcustom.status.mail import ChangeNotifier
from buildbotcustom.misc import get_l10n_repositories, isHgPollerTriggered, \
generateTestBuilderNames, generateTestBuilder, _nextFastReservedSlave, \
makeLogUploadCommand, changeContainsProduct
from buildbotcustom.common import reallyShort
from buildbotcustom.process.factory import StagingRepositorySetupFactory, \
ScriptFactory, SingleSourceFactory, ReleaseBuildFactory, \
ReleaseUpdatesFactory, ReleaseFinalVerification, L10nVerifyFactory, \
PartnerRepackFactory, MajorUpdateFactory, XulrunnerReleaseBuildFactory, \
TuxedoEntrySubmitterFactory, makeDummyBuilder
from buildbotcustom.changes.ftppoller import UrlPoller, LocalesFtpPoller
from release.platforms import buildbot2ftp, sl_platform_map
from release.paths import makeCandidatesDir
from buildbotcustom.scheduler import TriggerBouncerCheck, makePropertiesScheduler
from buildbotcustom.misc_scheduler import buildIDSchedFunc, buildUIDSchedFunc
from buildbotcustom.status.log_handlers import SubprocessLogHandler
from buildbotcustom.status.errors import update_verify_error
from build.paths import getRealpath
from release.info import getRuntimeTag
import BuildSlaves
DEFAULT_PARALLELIZATION = 10
def generateReleaseBranchObjects(releaseConfig, branchConfig,
releaseConfigFile, sourceRepoKey="mozilla"):
# This variable is one thing that forces us into reconfiging prior to a
# release. It should be removed as soon as nothing depends on it.
sourceRepoInfo = releaseConfig['sourceRepositories'][sourceRepoKey]
releaseTag = '%s_RELEASE' % releaseConfig['baseTag']
# This tag is created post-signing, when we do some additional
# config file bumps
runtimeTag = getRuntimeTag(releaseTag)
l10nChunks = releaseConfig.get('l10nChunks', DEFAULT_PARALLELIZATION)
updateVerifyChunks = releaseConfig.get('updateVerifyChunks', DEFAULT_PARALLELIZATION)
tools_repo_path = releaseConfig.get('build_tools_repo_path',
branchConfig['build_tools_repo_path'])
tools_repo = '%s%s' % (branchConfig['hgurl'], tools_repo_path)
config_repo = '%s%s' % (branchConfig['hgurl'],
branchConfig['config_repo_path'])
branchConfigFile = getRealpath('localconfig.py')
unix_slaves = []
all_slaves = []
for p in branchConfig['platforms']:
platform_slaves = branchConfig['platforms'][p].get('slaves', [])
all_slaves.extend(platform_slaves)
if 'win' not in p:
unix_slaves.extend(platform_slaves)
signedPlatforms = releaseConfig.get('signedPlatforms', ('win32',))
def builderPrefix(s, platform=None):
if platform:
return "release-%s-%s_%s" % (sourceRepoInfo['name'], platform, s)
else:
return "release-%s-%s" % (sourceRepoInfo['name'], s)
def releasePrefix():
"""Construct a standard format product release name from the
product name, version and build number stored in release_config.py
"""
return "%s %s build%s" % (
releaseConfig['productName'].title(),
releaseConfig['version'],
releaseConfig['buildNumber'], )
def majorReleasePrefix():
return "%s %s build%s" % (
releaseConfig['productName'].title(),
releaseConfig['majorUpdateToVersion'],
releaseConfig['majorUpdateBuildNumber'], )
def genericFtpUrl():
""" Generate an FTP URL pointing to the uploaded release builds for
sticking into release notification messages """
return makeCandidatesDir(
releaseConfig['productName'],
releaseConfig['version'],
releaseConfig['buildNumber'],
protocol='ftp',
server=releaseConfig['ftpServer'])
def genericHttpsUrl():
""" Generate an HTTPS URL pointing to the uploaded release builds for
sticking into release notification messages """
return makeCandidatesDir(
releaseConfig['productName'],
releaseConfig['version'],
releaseConfig['buildNumber'],
protocol='https',
server=releaseConfig['ftpServer'])
def createReleaseMessage(mode, name, build, results, master_status):
"""Construct a standard email to send to release@/release-drivers@
whenever a major step of the release finishes
"""
msgdict = {}
releaseName = releasePrefix()
job_status = "failed" if results else "success"
allplatforms = list(releaseConfig['enUSPlatforms'])
xrplatforms = list(releaseConfig.get('xulrunnerPlatforms', []))
stage = name.replace(builderPrefix(""), "")
# Detect platform from builder name by tokenizing by '_', and matching
# the first token after the prefix
if stage.startswith("xulrunner"):
platform = ["xulrunner_%s" % p for p in xrplatforms
if stage.replace("xulrunner_", "").split('_')[0] == p]
else:
platform = [p for p in allplatforms if stage.split('_')[0] == p]
if releaseConfig.get('majorUpdateRepoPath'):
majorReleaseName = majorReleasePrefix()
platform = platform[0] if len(platform) >= 1 else ''
bare_platform = platform.replace('xulrunner_', '')
message_tag = releaseConfig.get('messagePrefix', '[release] ')
buildbot_url = ''
if master_status.getURLForThing(build):
buildbot_url = "Full details are available at:\n %s\n" % master_status.getURLForThing(build)
# Use a generic ftp URL non-specific to any locale
ftpURL = genericFtpUrl()
if 'xulrunner' in platform:
ftpURL = ftpURL.replace(releaseConfig['productName'], 'xulrunner')
if platform:
platformDir = branchConfig['platforms'].get(bare_platform, {}).get(
'stage_platform', buildbot2ftp(bare_platform))
if 'xulrunner' in platform:
platformDir = ''
if bare_platform in signedPlatforms:
platformDir = 'unsigned/%s' % platformDir
ftpURL = '/'.join([
ftpURL.strip('/'),
platformDir])
stage = stage.replace("%s_" % platform, "") if platform else stage
#try to load a unique message template for the platform(if defined, step and results
#if none exists, fall back to the default template
possible_templates = ("%s/%s_%s_%s" % (releaseConfig['releaseTemplates'], platform, stage, job_status),
"%s/%s_%s" % (releaseConfig['releaseTemplates'], stage, job_status),
"%s/%s_default_%s" % (releaseConfig['releaseTemplates'], platform, job_status),
"%s/default_%s" % (releaseConfig['releaseTemplates'], job_status))
template = None
for t in possible_templates:
if os.access(t, os.R_OK):
template = open(t, "r", True)
break
if template:
subject = message_tag + template.readline().strip() % locals()
body = ''.join(template.readlines())
template.close()
else:
raise IOError("Cannot find a template file to use")
msgdict['subject'] = subject % locals()
msgdict['body'] = body % locals() + "\n"
msgdict['type'] = 'plain'
return msgdict
def createReleaseChangeMessage(change):
"""Construct a standard email to send to release@/release-drivers@
whenever a change is pushed to a release-related branch being
listened on"""
msgdict = {}
releaseName = releasePrefix()
message_tag = releaseConfig.get('messagePrefix', '[release] ')
step = None
ftpURL = genericFtpUrl()
if change.branch.endswith('signing'):
step = "signing"
else:
step = "tag"
#try to load a unique message template for the change
#if none exists, fall back to the default template
possible_templates = ("%s/%s_change" % (releaseConfig['releaseTemplates'], step),
"%s/default_change" % releaseConfig['releaseTemplates'])
template = None
for t in possible_templates:
if os.access(t, os.R_OK):
template = open(t, "r", True)
break
if template:
subject = message_tag + template.readline().strip() % locals()
body = ''.join(template.readlines()) + "\n"
template.close()
else:
raise IOError("Cannot find a template file to use")
msgdict['subject'] = subject % locals()
msgdict['body'] = body % locals()
msgdict['type'] = 'plain'
return msgdict
def createReleaseAVVendorsMessage(mode, name, build, results, master_status):
"""Construct the release notification email to send to the AV Vendors.
"""
template_name = "%s/updates_avvendors" % releaseConfig['releaseTemplates']
if not os.access(template_name, os.R_OK):
raise IOError("Cannot find a template file to use")
template = open(template_name, "r", True)
subject = '%(productName)s %(version)s release'
body = ''.join(template.readlines())
template.close()
productName = releaseConfig['productName'].title()
version = releaseConfig['version']
buildsURL = genericHttpsUrl()
msgdict = {}
msgdict['subject'] = subject % locals()
msgdict['body'] = body % locals() + "\n"
msgdict['type'] = 'plain'
return msgdict
def parallelizeBuilders(base_name, platform, chunks):
builders = {}
for n in range(1, chunks+1):
builders[n] = builderPrefix("%s_%s/%s" % (base_name, n,
str(chunks)),
platform)
return builders
def l10nBuilders(platform):
return parallelizeBuilders("repack", platform, l10nChunks)
def updateVerifyBuilders(platform):
return parallelizeBuilders("update_verify", platform,
updateVerifyChunks)
def majorUpdateVerifyBuilders(platform):
return parallelizeBuilders("major_update_verify", platform,
updateVerifyChunks)
builders = []
test_builders = []
schedulers = []
change_source = []
notify_builders = []
status = []
##### Change sources and Schedulers
if releaseConfig['doPartnerRepacks'] and \
releaseConfig['productName'] == 'firefox':
for p in releaseConfig['l10nPlatforms']:
ftpPlatform = branchConfig['platforms'].get(p, {}).get(
'stage_platform', buildbot2ftp(p))
candidatesDir = makeCandidatesDir(
releaseConfig['productName'],
releaseConfig['version'],
releaseConfig['buildNumber'],
protocol='http',
server=releaseConfig['ftpServer'])
ftpURL = '%s%s' % (candidatesDir, ftpPlatform)
if p in signedPlatforms:
ftpURL = '%sunsigned/%s' % (candidatesDir, ftpPlatform)
shippedLocalesFile = "%s/%s/raw-file/%s/%s" % (
branchConfig['hgurl'], sourceRepoInfo['path'], releaseTag,
releaseConfig['shippedLocalesPath'])
change_source.append(LocalesFtpPoller(
branch=builderPrefix("post_%s_l10n" % p),
ftpURLs=[ftpURL],
pollInterval=60*5, # 5 minutes
platform=p,
localesFile=shippedLocalesFile,
sl_platform_map=sl_platform_map,
))
if releaseConfig['productName'] == 'firefox':
change_source.append(UrlPoller(
branch=builderPrefix("post_signing"),
url='%s/win32_signing_build%s.log' % (
makeCandidatesDir(
releaseConfig['productName'],
releaseConfig['version'],
releaseConfig['buildNumber'],
protocol='http',
server=releaseConfig['ftpServer']),
releaseConfig['buildNumber']),
pollInterval=60*10,
))
if releaseConfig['productName'] == 'fennec':
locale = 'en-US'
candidatesDir = makeCandidatesDir(
releaseConfig['productName'],
releaseConfig['version'],
releaseConfig['buildNumber'],
protocol='http',
server=releaseConfig['ftpServer'])
signed_apk_url = '%s%s/%s/%s-%s.%s.eabi-arm.apk' % \
(candidatesDir,
branchConfig['platforms']['linux-android']['stage_platform'],
locale, releaseConfig['productName'], releaseConfig['version'],
locale)
change_source.append(UrlPoller(
branch=builderPrefix('android_post_signing'),
url=signed_apk_url,
pollInterval=60*10
))
if branchConfig['platforms']['linux-android'].get('multi_locale'):
locale = 'multi'
signed_apk_url = '%s%s/%s/%s-%s.%s.eabi-arm.apk' % \
(candidatesDir,
branchConfig['platforms']['linux-android'].get(
'stage_platform'),
locale,
releaseConfig['productName'],
releaseConfig['version'],
locale)
change_source.append(UrlPoller(
branch=builderPrefix('android_post_signing'),
url=signed_apk_url,
pollInterval=60*10
))
if releaseConfig.get('enable_repo_setup'):
repo_setup_scheduler = Scheduler(
name=builderPrefix('%s_repo_setup' % releaseConfig['productName']),
branch=sourceRepoInfo['path'],
treeStableTimer=None,
builderNames=[builderPrefix(
'%s_repo_setup' % releaseConfig['productName'])],
fileIsImportant=lambda c: not isHgPollerTriggered(c,
branchConfig['hgurl'])
)
schedulers.append(repo_setup_scheduler)
tag_scheduler = Dependent(
name=builderPrefix('%s_tag' % releaseConfig['productName']),
upstream=repo_setup_scheduler,
builderNames=[builderPrefix(
'%s_tag' % releaseConfig['productName'])],
)
if not releaseConfig.get('skip_release_download'):
release_downloader_scheduler = Scheduler(
name=builderPrefix(
'%s_release_downloader' % releaseConfig['productName']),
branch=sourceRepoInfo['path'],
treeStableTimer=None,
builderNames=[builderPrefix(
'%s_release_downloader' % releaseConfig['productName'])],
fileIsImportant=lambda c: changeContainsProduct(c,
releaseConfig['productName'])
)
schedulers.append(release_downloader_scheduler)
else:
tag_scheduler = Scheduler(
name=builderPrefix('%s_tag' % releaseConfig['productName']),
branch=sourceRepoInfo['path'],
treeStableTimer=None,
builderNames=[builderPrefix(
'%s_tag' % releaseConfig['productName'])],
fileIsImportant=lambda c: \
changeContainsProduct(c, releaseConfig['productName'])
)
schedulers.append(tag_scheduler)
tag_downstream = [builderPrefix('%s_source' % releaseConfig['productName'])]
if releaseConfig['buildNumber'] == 1 \
and not releaseConfig.get('disableBouncerEntries'):
tag_downstream.append(builderPrefix('bouncer_submitter'))
if releaseConfig['doPartnerRepacks']:
tag_downstream.append(builderPrefix('euballot_bouncer_submitter'))
if releaseConfig.get('xulrunnerPlatforms'):
tag_downstream.append(builderPrefix('xulrunner_source'))
for platform in releaseConfig['enUSPlatforms']:
tag_downstream.append(builderPrefix('%s_build' % platform))
notify_builders.append(builderPrefix('%s_build' % platform))
if platform in releaseConfig['l10nPlatforms']:
repack_scheduler = Triggerable(
name=builderPrefix('%s_repack' % platform),
builderNames=l10nBuilders(platform).values(),
)
schedulers.append(repack_scheduler)
repack_complete_scheduler = Dependent(
name=builderPrefix('%s_repack_complete' % platform),
upstream=repack_scheduler,
builderNames=[builderPrefix('repack_complete', platform),]
)
schedulers.append(repack_complete_scheduler)
notify_builders.append(builderPrefix('repack_complete', platform))
for platform in releaseConfig.get('xulrunnerPlatforms', []):
tag_downstream.append(builderPrefix('xulrunner_%s_build' % platform))
DependentID = makePropertiesScheduler(Dependent, [buildIDSchedFunc, buildUIDSchedFunc])
schedulers.append(
DependentID(
name=builderPrefix('%s_build' % releaseConfig['productName']),
upstream=tag_scheduler,
builderNames=tag_downstream,
))
if releaseConfig['doPartnerRepacks']:
for platform in releaseConfig.get('partnerRepackPlatforms',
releaseConfig['l10nPlatforms']):
partner_scheduler = Scheduler(
name=builderPrefix('partner_repacks', platform),
treeStableTimer=0,
branch=builderPrefix('post_%s_l10n' % platform),
builderNames=[builderPrefix('partner_repack', platform)],
)
schedulers.append(partner_scheduler)
if releaseConfig.get('verifyConfigs'):
for platform in releaseConfig['l10nPlatforms']:
l10n_verify_scheduler = Scheduler(
name=builderPrefix('l10n_verification', platform),
treeStableTimer=0,
branch=builderPrefix('post_signing'),
builderNames=[builderPrefix('l10n_verification', platform)]
)
schedulers.append(l10n_verify_scheduler)
updates_scheduler = Scheduler(
name=builderPrefix('updates'),
treeStableTimer=0,
branch=builderPrefix('post_signing'),
builderNames=[builderPrefix('updates')]
)
schedulers.append(updates_scheduler)
notify_builders.append(builderPrefix('updates'))
updateBuilderNames = []
for platform in sorted(releaseConfig.get('verifyConfigs', {}).keys()):
updateBuilderNames.extend(updateVerifyBuilders(platform).values())
update_verify_scheduler = Dependent(
name=builderPrefix('update_verify'),
upstream=updates_scheduler,
builderNames=updateBuilderNames
)
schedulers.append(update_verify_scheduler)
if not releaseConfig.get('disablePermissionCheck'):
check_permissions_scheduler = Dependent(
name=builderPrefix('check_permissions'),
upstream=updates_scheduler,
builderNames=[builderPrefix('check_permissions')]
)
schedulers.append(check_permissions_scheduler)
if not releaseConfig.get('disableVirusCheck'):
antivirus_scheduler = Dependent(
name=builderPrefix('antivirus'),
upstream=updates_scheduler,
builderNames=[builderPrefix('antivirus')]
)
schedulers.append(antivirus_scheduler)
if releaseConfig.get('majorUpdateRepoPath'):
majorUpdateBuilderNames = []
for platform in sorted(releaseConfig['majorUpdateVerifyConfigs'].keys()):
majorUpdateBuilderNames.extend(
majorUpdateVerifyBuilders(platform).values())
major_update_verify_scheduler = Triggerable(
name=builderPrefix('major_update_verify'),
builderNames=majorUpdateBuilderNames
)
schedulers.append(major_update_verify_scheduler)
for platform in releaseConfig['unittestPlatforms']:
platform_test_builders = []
for suites_name, suites in branchConfig['unittest_suites']:
platform_test_builders.extend(
generateTestBuilderNames(
builderPrefix('%s_test' % platform),
suites_name, suites))
s = Scheduler(
name=builderPrefix('%s-opt-unittest' % platform),
treeStableTimer=0,
branch=builderPrefix('%s-opt-unittest' % platform),
builderNames=platform_test_builders,
)
schedulers.append(s)
if not releaseConfig.get('disableBouncerEntries'):
mirror_scheduler1 = TriggerBouncerCheck(
name=builderPrefix('ready-for-rel-test'),
configRepo=config_repo,
minUptake=10000,
builderNames=[builderPrefix('ready_for_releasetest_testing')] + \
[builderPrefix('final_verification', platform)
for platform in releaseConfig.get('verifyConfigs', {}).keys()],
username=BuildSlaves.tuxedoUsername,
password=BuildSlaves.tuxedoPassword)
schedulers.append(mirror_scheduler1)
mirror_scheduler2 = TriggerBouncerCheck(
name=builderPrefix('ready-for-release'),
configRepo=config_repo,
minUptake=45000,
builderNames=[builderPrefix('ready_for_release')],
username=BuildSlaves.tuxedoUsername,
password=BuildSlaves.tuxedoPassword)
schedulers.append(mirror_scheduler2)
if releaseConfig['productName'] == 'fennec':
android_signature_verification_scheduler = Scheduler(
name=builderPrefix('android_signature_verification_scheduler'),
branch=builderPrefix('android_post_signing'),
treeStableTimer=None,
builderNames=[builderPrefix('android_signature_verification')],
)
schedulers.append(android_signature_verification_scheduler)
# Purposely, there is not a Scheduler for ReleaseFinalVerification
# This is a step run very shortly before release, and is triggered manually
# from the waterfall
##### Builders
builder_env = {
'BUILDBOT_CONFIGS': '%s%s' % (branchConfig['hgurl'],
branchConfig['config_repo_path']),
'BUILDBOTCUSTOM': '%s%s' % (branchConfig['hgurl'],
branchConfig['buildbotcustom_repo_path']),
'CLOBBERER_URL': branchConfig['base_clobber_url']
}
if releaseConfig.get('enable_repo_setup'):
if not releaseConfig.get('skip_repo_setup'):
clone_repositories = dict()
# The repo_setup builder only needs to the repoPath, so we only
# give it that
for sr in releaseConfig['sourceRepositories'].values():
clone_repositories.update({sr['clonePath']: {}})
# get_l10n_repositories spits out more than just the repoPath
# It's easier to just pass it along rather than strip it out
if len(releaseConfig['l10nPlatforms']) > 0:
l10n_clone_repos = get_l10n_repositories(
releaseConfig['l10nRevisionFile'],
releaseConfig['l10nRepoClonePath'],
sourceRepoInfo['relbranch'])
clone_repositories.update(l10n_clone_repos)
repository_setup_factory = StagingRepositorySetupFactory(
hgHost=branchConfig['hghost'],
buildToolsRepoPath=tools_repo_path,
username=releaseConfig['hgUsername'],
sshKey=releaseConfig['hgSshKey'],
repositories=clone_repositories,
clobberURL=branchConfig['base_clobber_url'],
userRepoRoot=releaseConfig['userRepoRoot'],
)
builders.append({
'name': builderPrefix(
'%s_repo_setup' % releaseConfig['productName']),
'slavenames': unix_slaves,
'category': builderPrefix(''),
'builddir': builderPrefix(
'%s_repo_setup' % releaseConfig['productName']),
'slavebuilddir': reallyShort(builderPrefix(
'%s_repo_setup' % releaseConfig['productName'])),
'factory': repository_setup_factory,
'env': builder_env,
'properties': {
'slavebuilddir': reallyShort(builderPrefix(
'%s_repo_setup' % releaseConfig['productName'])),
'release_config': releaseConfigFile,
},
})
else:
builders.append(makeDummyBuilder(
name=builderPrefix(
'%s_repo_setup' % releaseConfig['productName']),
slaves=all_slaves,
category=builderPrefix(''),
))
if not releaseConfig.get('skip_release_download'):
release_downloader_factory = ScriptFactory(
scriptRepo=tools_repo,
extra_args=[branchConfigFile],
scriptName='scripts/staging/release_downloader.sh',
)
builders.append({
'name': builderPrefix(
'%s_release_downloader' % releaseConfig['productName']),
'slavenames': unix_slaves,
'category': builderPrefix(''),
'builddir': builderPrefix(
'%s_release_downloader' % releaseConfig['productName']),
'slavebuilddir': reallyShort(builderPrefix(
'%s_release_downloader' % releaseConfig['productName'])),
'factory': release_downloader_factory,
'env': builder_env,
'properties': {
'release_config': releaseConfigFile,
'builddir': builderPrefix('%s_release_downloader' % \
releaseConfig['productName']),
'slavebuilddir': reallyShort(builderPrefix(
'%s_release_downloader' % \
releaseConfig['productName']))
}
})
if not releaseConfig.get('skip_tag'):
pf = branchConfig['platforms']['linux']
tag_env = builder_env.copy()
if pf['env'].get('HG_SHARE_BASE_DIR', None):
tag_env['HG_SHARE_BASE_DIR'] = pf['env']['HG_SHARE_BASE_DIR']
tag_factory = ScriptFactory(
scriptRepo=tools_repo,
scriptName='scripts/release/tagging.sh',
)
builders.append({
'name': builderPrefix('%s_tag' % releaseConfig['productName']),
'slavenames': pf['slaves'] + \
branchConfig['platforms']['linux64']['slaves'],
'category': builderPrefix(''),
'builddir': builderPrefix('%s_tag' % releaseConfig['productName']),
'slavebuilddir': reallyShort(
builderPrefix('%s_tag' % releaseConfig['productName'])),
'factory': tag_factory,
'nextSlave': _nextFastReservedSlave,
'env': tag_env,
'properties': {
'builddir': builderPrefix(
'%s_tag' % releaseConfig['productName']),
'slavebuilddir': reallyShort(
builderPrefix('%s_tag' % releaseConfig['productName'])),
'release_config': releaseConfigFile,
}
})
notify_builders.append(builderPrefix('%s_tag' % releaseConfig['productName']))
else:
builders.append(makeDummyBuilder(
name=builderPrefix('%s_tag' % releaseConfig['productName']),
slaves=all_slaves,
category=builderPrefix(''),
))
if not releaseConfig.get('skip_source'):
pf = branchConfig['platforms']['linux']
mozconfig = 'linux/%s/release' % sourceRepoInfo['name']
source_factory = SingleSourceFactory(
env=pf['env'],
objdir=pf['platform_objdir'],
hgHost=branchConfig['hghost'],
buildToolsRepoPath=tools_repo_path,
repoPath=sourceRepoInfo['path'],
productName=releaseConfig['productName'],
version=releaseConfig['version'],
baseTag=releaseConfig['baseTag'],
stagingServer=branchConfig['stage_server'],
stageUsername=branchConfig['stage_username'],
stageSshKey=branchConfig['stage_ssh_key'],
buildNumber=releaseConfig['buildNumber'],
autoconfDirs=['.', 'js/src'],
clobberURL=branchConfig['base_clobber_url'],
mozconfig=mozconfig,
configRepoPath=branchConfig['config_repo_path'],
configSubDir=branchConfig['config_subdir'],
)
builders.append({
'name': builderPrefix('%s_source' % releaseConfig['productName']),
'slavenames': branchConfig['platforms']['linux']['slaves'] + \
branchConfig['platforms']['linux64']['slaves'],
'category': builderPrefix(''),
'builddir': builderPrefix(
'%s_source' % releaseConfig['productName']),
'slavebuilddir': reallyShort(
builderPrefix('%s_source' % releaseConfig['productName'])),
'factory': source_factory,
'env': builder_env,
'nextSlave': _nextFastReservedSlave,
'properties': { 'slavebuilddir':
reallyShort(
builderPrefix('%s_source' % releaseConfig['productName']))}
})
if releaseConfig.get('xulrunnerPlatforms'):
mozconfig = 'linux/%s/xulrunner' % sourceRepoInfo['name']
xulrunner_source_factory = SingleSourceFactory(
env=pf['env'],
objdir=pf['platform_objdir'],
hgHost=branchConfig['hghost'],
buildToolsRepoPath=tools_repo_path,
repoPath=sourceRepoInfo['path'],
productName='xulrunner',
version=releaseConfig['milestone'],
baseTag=releaseConfig['baseTag'],
stagingServer=branchConfig['stage_server'],
stageUsername=branchConfig['stage_username_xulrunner'],
stageSshKey=branchConfig['stage_ssh_xulrunner_key'],
buildNumber=releaseConfig['buildNumber'],
autoconfDirs=['.', 'js/src'],
clobberURL=branchConfig['base_clobber_url'],
mozconfig=mozconfig,
configRepoPath=branchConfig['config_repo_path'],
configSubDir=branchConfig['config_subdir'],
)
builders.append({
'name': builderPrefix('xulrunner_source'),
'slavenames': branchConfig['platforms']['linux']['slaves'] + \
branchConfig['platforms']['linux64']['slaves'],
'category': builderPrefix(''),
'builddir': builderPrefix('xulrunner_source'),
'slavebuilddir': reallyShort(builderPrefix('xulrunner_source')),
'factory': xulrunner_source_factory,
'env': builder_env,
'properties': { 'slavebuilddir':
reallyShort(builderPrefix('xulrunner_source'))}
})
else:
builders.append(makeDummyBuilder(
name=builderPrefix('%s_source' % releaseConfig['productName']),
slaves=all_slaves,
category=builderPrefix(''),
))
if releaseConfig.get('xulrunnerPlatforms'):
builders.append(makeDummyBuilder(
name=builderPrefix('xulrunner_source'),
slaves=all_slaves,
category=builderPrefix(''),
))
for platform in releaseConfig['enUSPlatforms']:
# shorthand
pf = branchConfig['platforms'][platform]
mozconfig = '%s/%s/release' % (platform, sourceRepoInfo['name'])
if platform in releaseConfig['talosTestPlatforms']:
talosMasters = branchConfig['talos_masters']
else:
talosMasters = None
if releaseConfig['enableUnittests']:
packageTests = True
unittestMasters = branchConfig['unittest_masters']
unittestBranch = builderPrefix('%s-opt-unittest' % platform)
else:
packageTests = False
unittestMasters = None
unittestBranch = None
if not releaseConfig.get('skip_build'):
if platform in releaseConfig['l10nPlatforms']:
triggeredSchedulers = [builderPrefix('%s_repack' % platform)]
else:
triggeredSchedulers = None
multiLocaleConfig = releaseConfig.get(
'mozharness_config', {}).get(platform)
enableUpdatePackaging = bool(releaseConfig.get('verifyConfigs',
{}).get(platform))
build_factory = ReleaseBuildFactory(
env=pf['env'],
objdir=pf['platform_objdir'],
platform=platform,
hgHost=branchConfig['hghost'],
repoPath=sourceRepoInfo['path'],
buildToolsRepoPath=tools_repo_path,
configRepoPath=branchConfig['config_repo_path'],
configSubDir=branchConfig['config_subdir'],
profiledBuild=pf['profiled_build'],
mozconfig=mozconfig,
buildRevision=releaseTag,
stageServer=branchConfig['stage_server'],
stageUsername=branchConfig['stage_username'],
stageGroup=branchConfig['stage_group'],
stageSshKey=branchConfig['stage_ssh_key'],
stageBasePath=branchConfig['stage_base_path'],
codesighs=False,
uploadPackages=True,
uploadSymbols=True,
createSnippet=False,
doCleanup=True, # this will clean-up the mac build dirs, but not delete
# the entire thing
buildSpace=10,
productName=releaseConfig['productName'],
version=releaseConfig['version'],
buildNumber=releaseConfig['buildNumber'],
talosMasters=talosMasters,
packageTests=packageTests,
unittestMasters=unittestMasters,
unittestBranch=unittestBranch,
clobberURL=branchConfig['base_clobber_url'],
triggerBuilds=True,
triggeredSchedulers=triggeredSchedulers,
stagePlatform=pf.get('stage_platform'),
use_scratchbox=pf.get('use_scratchbox'),
android_signing=pf.get('android_signing', False),
multiLocale=pf.get('multi_locale', False),
multiLocaleMerge=releaseConfig.get('mergeLocales', False),
compareLocalesRepoPath=branchConfig['compare_locales_repo_path'],
mozharnessRepoPath=branchConfig['mozharness_repo_path'],
mozharnessTag=branchConfig['mozharness_tag'],
multiLocaleScript=pf.get('multi_locale_script'),
multiLocaleConfig=multiLocaleConfig,
usePrettyNames=releaseConfig.get('usePrettyNames', True),
enableUpdatePackaging=enableUpdatePackaging,
mozconfigBranch=releaseTag,
)
builders.append({
'name': builderPrefix('%s_build' % platform),
'slavenames': pf['slaves'],
'category': builderPrefix(''),
'builddir': builderPrefix('%s_build' % platform),
'slavebuilddir': reallyShort(builderPrefix('%s_build' % platform)),
'factory': build_factory,
'nextSlave': _nextFastReservedSlave,
'env': builder_env,
'properties': { 'slavebuilddir':
reallyShort(builderPrefix('%s_build' % platform))}
})
else:
builders.append(makeDummyBuilder(
name=builderPrefix('%s_build' % platform),
slaves=all_slaves,
category=builderPrefix(''),
))
if platform in releaseConfig['l10nPlatforms']:
if not releaseConfig.get('disableStandaloneRepacks'):
standalone_factory = ScriptFactory(
scriptRepo=tools_repo,
interpreter='bash',
scriptName='scripts/l10n/standalone_repacks.sh',
extra_args=[platform, branchConfigFile]
)
env = builder_env.copy()
env.update(pf['env'])
builders.append({
'name': builderPrefix("standalone_repack", platform),
'slavenames': branchConfig['l10n_slaves'][platform],
'category': builderPrefix(''),
'builddir': builderPrefix("standalone_repack", platform),
'factory': standalone_factory,
'nextSlave': _nextFastReservedSlave,
'env': env,
'properties': {'builddir':
builderPrefix("standalone_repack", platform)}
})
for n, builderName in l10nBuilders(platform).iteritems():
if releaseConfig['productName'] == 'fennec':
repack_factory = ScriptFactory(
scriptRepo=tools_repo,
interpreter='bash',
scriptName='scripts/l10n/release_mobile_repacks.sh',
extra_args=[platform, branchConfigFile,
str(l10nChunks), str(n)]
)
else:
repack_factory = ScriptFactory(
scriptRepo=tools_repo,
interpreter='bash',
scriptName='scripts/l10n/release_repacks.sh',
extra_args=[platform, branchConfigFile,
str(l10nChunks), str(n)]
)
builddir = builderPrefix('%s_repack' % platform) + \
'_' + str(n)
env = builder_env.copy()
env.update(pf['env'])
builders.append({
'name': builderName,
'slavenames': branchConfig['l10n_slaves'][platform],
'category': builderPrefix(''),
'builddir': builddir,
'slavebuilddir': reallyShort(builddir),
'factory': repack_factory,
'nextSlave': _nextFastReservedSlave,
'env': env,
'properties': {
'builddir': builddir,
'slavebuilddir': reallyShort(builddir),
'release_config': releaseConfigFile,
}
})
builders.append(makeDummyBuilder(
name=builderPrefix('repack_complete', platform),
slaves=all_slaves,
category=builderPrefix(''),
))
if platform in releaseConfig['unittestPlatforms']:
mochitestLeakThreshold = pf.get('mochitest_leak_threshold', None)
crashtestLeakThreshold = pf.get('crashtest_leak_threshold', None)
for suites_name, suites in branchConfig['unittest_suites']:
# Release builds on mac don't have a11y enabled, do disable the mochitest-a11y test
if platform.startswith('macosx') and 'mochitest-a11y' in suites:
suites = suites[:]
suites.remove('mochitest-a11y')
test_builders.extend(generateTestBuilder(
branchConfig, 'release', platform, builderPrefix("%s_test" % platform),
builderPrefix("%s-opt-unittest" % platform),
suites_name, suites, mochitestLeakThreshold,
crashtestLeakThreshold, category=builderPrefix('')))
for platform in releaseConfig.get('xulrunnerPlatforms', []):
pf = branchConfig['platforms'][platform]
xr_env = pf['env'].copy()
xr_env['SYMBOL_SERVER_USER'] = branchConfig['stage_username_xulrunner']
xr_env['SYMBOL_SERVER_PATH'] = branchConfig['symbol_server_xulrunner_path']
xr_env['SYMBOL_SERVER_SSH_KEY'] = \
xr_env['SYMBOL_SERVER_SSH_KEY'].replace(branchConfig['stage_ssh_key'],
branchConfig['stage_ssh_xulrunner_key'])
if not releaseConfig.get('skip_build'):
xulrunner_build_factory = XulrunnerReleaseBuildFactory(
env=xr_env,
objdir=pf['platform_objdir'],
platform=platform,
hgHost=branchConfig['hghost'],
repoPath=sourceRepoInfo['path'],
buildToolsRepoPath=tools_repo_path,
configRepoPath=branchConfig['config_repo_path'],
configSubDir=branchConfig['config_subdir'],
profiledBuild=None,
mozconfig = '%s/%s/xulrunner' % (platform, sourceRepoInfo['name']),
buildRevision=releaseTag,
stageServer=branchConfig['stage_server'],
stageUsername=branchConfig['stage_username_xulrunner'],
stageGroup=branchConfig['stage_group'],
stageSshKey=branchConfig['stage_ssh_xulrunner_key'],
stageBasePath=branchConfig['stage_base_path'] + '/xulrunner',
codesighs=False,
uploadPackages=True,
uploadSymbols=True,
createSnippet=False,
doCleanup=True, # this will clean-up the mac build dirs, but not delete
# the entire thing
buildSpace=pf.get('build_space', branchConfig['default_build_space']),
productName='xulrunner',
version=releaseConfig['milestone'],
buildNumber=releaseConfig['buildNumber'],
clobberURL=branchConfig['base_clobber_url'],
packageSDK=True,
)
builders.append({
'name': builderPrefix('xulrunner_%s_build' % platform),
'slavenames': pf['slaves'],
'category': builderPrefix(''),
'builddir': builderPrefix('xulrunner_%s_build' % platform),
'slavebuilddir': reallyShort(builderPrefix('xulrunner_%s_build' % platform)),
'factory': xulrunner_build_factory,
'env': builder_env,
'properties': {'slavebuilddir':
reallyShort(builderPrefix('xulrunner_%s_build' % platform))}
})
notify_builders.append(
builderPrefix('xulrunner_%s_build' % platform))
else:
builders.append(makeDummyBuilder(
name=builderPrefix('xulrunner_%s_build' % platform),
slaves=all_slaves,
category=builderPrefix(''),
))
if releaseConfig['doPartnerRepacks']:
for platform in releaseConfig.get('partnerRepackPlatforms',
releaseConfig['l10nPlatforms']):
repack_params = dict(
hgHost=branchConfig['hghost'],
repoPath=sourceRepoInfo['path'],
buildToolsRepoPath=tools_repo_path,
productName=releaseConfig['productName'],
version=releaseConfig['version'],
buildNumber=releaseConfig['buildNumber'],
partnersRepoPath=releaseConfig['partnersRepoPath'],