Skip to content

Commit ea2924b

Browse files
John E. Malmberggrom72
andauthored
SRE-2932 Fix notifyBrokenBranch
* SRE-2932 Fix notifyBrokenBranch vars/notifyBrokenBranch.grooy: This routine was doing a lookup of the enviroment Map which is not allowed in the pipeline-lib sandboxed operation. vars/DocOnlyChange.groovy: Missing a String declaration that was causing log noise. el9.2 is not available - use 9.4 instead el8.6 is not available - prepare to upgrade to 8.8 el8.6 can be removed when daos 2.6 and master start using 8.8 opensuse-leap-15.4 not available - upgrade to 15.5 --------- Signed-off-by: John E. Malmberg <john.malmberg@hpe.com> Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com> Co-authored-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
1 parent efbd410 commit ea2924b

10 files changed

+67
-35
lines changed

vars/distroVersion.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ String call(String distro, String branch) {
3333
return ['el8': ['master': '8.8',
3434
'2.4': '8.8',
3535
'2.6': '8.8'],
36-
'el9': ['master': '9.2',
37-
'2.6': '9.2'],
36+
'el9': ['master': '9.4',
37+
'2.6': '9.4'],
3838
'leap15': ['master': '15.6',
3939
'2.4': '15.6',
4040
'2.6': '15.6'],
@@ -48,8 +48,8 @@ assert(call('leap15', 'master') == '15.6')
4848
assert(call('el8', '2.4') == '8.8')
4949
assert(call('el8', '2.6') == '8.8')
5050
assert(call('el8', 'master') == '8.8')
51-
assert(call('el9', 'master') == '9.2')
52-
assert(call('el9', '2.6') == '9.2')
51+
assert(call('el9', 'master') == '9.4')
52+
assert(call('el9', '2.6') == '9.4')
5353

5454
/* Uncomment to do further testing
5555
env = [:]

vars/docOnlyChange.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ boolean call(String target_branch) {
1717
if (cachedCommitPragma('Doc-only').toLowerCase() == 'false') {
1818
return false
1919
}
20+
String script
2021
if (fileExists('ci/doc_only_change.sh')) {
2122
script = 'CHANGE_ID=' + env.CHANGE_ID +
2223
' TARGET_BRANCH=' + target_branch +

vars/getFunctionalTestStage.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Map call(Map kwargs = [:]) {
4545

4646
return {
4747
stage("${name}") {
48-
// Get the tags for thge stage. Use either the build parameter, commit pragma, or
48+
// Get the tags for the stage. Use either the build parameter, commit pragma, or
4949
// default tags. All tags are combined with the stage tags to ensure only tests that
5050
// 'fit' the cluster will be run.
5151
String tags = getFunctionalTags(

vars/notifyBrokenBranch.groovy

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// vars/notifyBrokenBranch.groovy
2+
/* groovylint-disable VariableName */
23

34
/**
45
* notifyBrokenBranch.groovy
@@ -12,37 +13,47 @@
1213

1314
def call(Map config = [:]) {
1415

16+
String branches
1517
if (config['branches']) {
1618
branches = config['branches'].split()
1719
} else {
1820
branches = ["master"]
1921
}
2022

21-
if (!branches.contains(env.GIT_BRANCH)) {
23+
// Needed this as a work around that env['GIT_BRANCH'] is blacklisted
24+
// inside of pipeline-lib
25+
String git_branch = env.GIT_BRANCH
26+
27+
if (!branches.contains(git_branch)) {
2228
return
2329
}
2430

25-
emailextDaos body: env.GIT_BRANCH + ' is broken and you are one of the people\n' +
31+
emailextDaos body: git_branch + ' is broken and you are one of the people\n' +
2632
'who have committed to it since it was last successful. Please\n' +
27-
'investigate if your recent patch(es) to ' + env.GIT_BRANCH + '\n' +
33+
'investigate if your recent patch(es) to ' + git_branch + '\n' +
2834
'are responsible for breaking it.\n\n' +
2935
'See ' + env.BUILD_URL + ' for more details.',
3036
recipientProviders: [
3137
[$class: 'DevelopersRecipientProvider'],
3238
[$class: 'RequesterRecipientProvider']
3339
],
34-
subject: 'Build broken on ' + env.GIT_BRANCH,
40+
subject: 'Build broken on ' + git_branch,
3541
onPR: config['onPR']
3642

37-
def branch = env['GIT_BRANCH'].toUpperCase().replaceAll("-", "_")
38-
def watchers = env["DAOS_STACK_${branch}_WATCHER"]
39-
40-
if (watchers != "null") {
41-
emailextDaos body: env.GIT_BRANCH + ' is broken.\n\n' +
42-
'See ' + env.BUILD_URL + ' for more details.',
43-
to: watchers,
44-
subject: 'Build broken on ' + env.GIT_BRANCH,
45-
onPR: config['onPR']
43+
String branch = git_branch.toUpperCase().replaceAll("-", "_")
44+
// This will need to be implemented in trusted-pipe-line lib eventually
45+
// as checking if environment variables exist is blacklisted in the
46+
// groovy sandbox.
47+
// for now we only have DAOS_STACK_MASTER_WATCHER
48+
// def watchers = env["DAOS_STACK_${branch}_WATCHER"]
49+
if (branch == 'MASTER') {
50+
String watchers = env.DAOS_STACK_MASTER_WATCHER
51+
if (watchers != "null") {
52+
emailextDaos body: git_branch + ' is broken.\n\n' +
53+
'See ' + env.BUILD_URL + ' for more details.',
54+
to: watchers,
55+
subject: 'Build broken on ' + git_branch,
56+
onPR: config['onPR']
57+
}
4658
}
47-
4859
}

vars/packageBuildingPipeline.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void call(Map pipeline_args) {
535535
}
536536
}
537537
} //stage('Build RPM on EL 9')
538-
stage('Build RPM on Leap 15.4') {
538+
stage('Build RPM on Leap 15.5') {
539539
when {
540540
beforeAgent true
541541
expression { !skipStage() && distros.contains('leap15') }
@@ -555,19 +555,19 @@ void call(Map pipeline_args) {
555555
sh label: 'Build package',
556556
script: '''rm -rf artifacts/leap15/
557557
mkdir -p artifacts/leap15/
558-
make CHROOT_NAME="opensuse-leap-15.4-x86_64" ''' +
558+
make CHROOT_NAME="opensuse-leap-15.5-x86_64" ''' +
559559
'DISTRO_VERSION=' + parseStageInfo()['distro_version'] + ' ' +
560560
pipeline_args.get('make args', '') + ' chrootbuild ' +
561561
pipeline_args.get('add_make_targets', '')
562562
}
563563
post {
564564
success {
565-
rpmlintMockResults('opensuse-leap-15.4-x86_64',
565+
rpmlintMockResults('opensuse-leap-15.5-x86_64',
566566
pipeline_args.get('rpmlint_rpms_allow_errors', false),
567567
pipeline_args.get('rpmlint_rpms_skip', false),
568568
pipeline_args.get('make args', ''))
569569
sh label: 'Collect artifacts',
570-
script: '''(cd /var/lib/mock/opensuse-leap-15.4-x86_64/result/ &&
570+
script: '''(cd /var/lib/mock/opensuse-leap-15.5-x86_64/result/ &&
571571
cp -r . $OLDPWD/artifacts/leap15/)\n''' +
572572
pipeline_args.get('add_archiving_cmds', '').replace('<distro>',
573573
'leap15') +
@@ -584,7 +584,7 @@ void call(Map pipeline_args) {
584584
}
585585
unsuccessful {
586586
sh label: 'Build Log',
587-
script: '''mockroot=/var/lib/mock/opensuse-leap-15.4-x86_64
587+
script: '''mockroot=/var/lib/mock/opensuse-leap-15.5-x86_64
588588
ls -l $mockroot/result/
589589
cat $mockroot/result/{root,build}.log
590590
artdir=$PWD/artifacts/leap15
@@ -594,9 +594,9 @@ void call(Map pipeline_args) {
594594
}
595595
always {
596596
scrubSecret(pipeline_args['secret'],
597-
'/var/lib/mock/opensuse-leap-15.4-x86_64/result/build.log')
597+
'/var/lib/mock/opensuse-leap-15.5-x86_64/result/build.log')
598598
sh label: 'Collect config.log(s)',
599-
script: '(if cd /var/lib/mock/opensuse-leap-15.4-x86_64/root/builddir/build/' +
599+
script: '(if cd /var/lib/mock/opensuse-leap-15.5-x86_64/root/builddir/build/' +
600600
'''BUILD/*/; then
601601
find . -name configure -printf %h\\\\n | \
602602
while read dir; do

vars/parseStageInfo.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Map call(Map config = [:]) {
7979
result['target'] = 'el8.6'
8080
result['distro_version'] = cachedCommitPragma('EL8.6-version', '8.6')
8181
new_ci_target = cachedCommitPragma('EL8.6-target', result['target'])
82+
} else if (stage_name.contains('EL 8.8')) {
83+
result['target'] = 'el8.8'
84+
result['distro_version'] = cachedCommitPragma('EL8.8-version', '8.8')
85+
new_ci_target = cachedCommitPragma('EL8.8-target', result['target'])
8286
} else if (stage_name.contains('EL 8')) {
8387
result['target'] = 'el8'
8488
result['distro_version'] = cachedCommitPragma('EL8-version',

vars/provisionNodes.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
May be used in the future as SUSE free development
4040
licenses do currently allow them to be used for
4141
CI automation, and SUSE also has offered site licenses.
42-
Prefix "leap": Specifically OpenSUSE leap oprating system builds of
42+
Prefix "leap": Specifically OpenSUSE leap operating system builds of
4343
Suse Linux Enterprise Server.
4444
*/
4545
/* groovylint-disable-next-line MethodSize */
@@ -122,6 +122,7 @@ Map call(Map config = [:]) {
122122

123123
if (!fileExists('ci/provisioning/log_cleanup.sh') ||
124124
!fileExists('ci/provisioning/post_provision_config.sh')) {
125+
125126
return provisionNodesV1(config)
126127
}
127128

vars/sconsBuild.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Map call(Map config = [:]) {
6565
* config['stash_files'] Filename containing list of test files to stash.
6666
* config['stash_opt'] Boolean, stash tar of /opt in preference to install/**. Default false.
6767
* If present, those files will be placed in a stash name
68-
* of based on parsing the evironment variables of the
68+
* of based on parsing the environment variables of the
6969
* <target-compiler[-build_type]-test>. Additional stashes
7070
* will be created for "install" and "build_vars" with similar
7171
* prefixes.

vars/skipStage.groovy

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,20 @@ boolean call(Map config = [:]) {
504504
!run_default_skipped_stage('test-el-8.6-rpms')) ||
505505
(rpmTestVersion() != '') ||
506506
stageAlreadyPassed()
507+
case 'Test EL 8.8 RPMs':
508+
case 'Test RPMs on EL 8.8':
509+
return !paramsValue('CI_RPMS_el8.8_TEST', true) ||
510+
target_branch =~ branchTypeRE('weekly') ||
511+
skip_stage_pragma('build-el8-rpm') ||
512+
skip_stage_pragma('test') ||
513+
skip_stage_pragma('test-rpms') ||
514+
skip_stage_pragma('test-el-8.8-rpms') ||
515+
docOnlyChange(target_branch) ||
516+
(quickFunctional() &&
517+
!paramsValue('CI_RPMS_el8_8_TEST', true) &&
518+
!run_default_skipped_stage('test-el-8.8-rpms')) ||
519+
(rpmTestVersion() != '') ||
520+
stageAlreadyPassed()
507521
case 'Test Leap 15 RPMs':
508522
case 'Test Leap 15.2 RPMs':
509523
// Skip by default as it doesn't pass with Leap15.3 due to

vars/unitTest.groovy

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* config['description'] Description to report for SCM status.
2727
* Default env.STAGE_NAME.
2828
*
29-
* config['failure_artifacts'] Failure aritfifacts to return.
29+
* config['failure_artifacts'] Failure artifacts to return.
3030
* Default env.STAGE_NAME.
3131
*
3232
* config['ignore_failure'] Ignore test failures. Default false.
@@ -43,10 +43,10 @@
4343
*
4444
* config['node_count'] Count of nodes that will actually be used
4545
* the test. Default will be based on the
46-
* enviroment variables for the stage.
46+
* environment variables for the stage.
4747
*
4848
* config['stashes'] List of stashes to use. Default will be
49-
* baed on the environment variables for the
49+
* based on the environment variables for the
5050
* stage.
5151
*
5252
* config['target'] Target distribution, such as 'centos7',
@@ -61,16 +61,16 @@
6161
* SSH_KEY_ARGS and NODELIST environment
6262
* variables set.
6363
*
64-
* config['timeout_time'] Timelimit for test run, not including
64+
* config['timeout_time'] Time limit for test run, not including
6565
* provisioning time.
6666
* Default is 120 Minutes.
6767
*
68-
* config['timeout_units'] Timelimit units. Default is minutes.
68+
* config['timeout_units'] Time limit units. Default is minutes.
6969
*
70-
* config['unstash_opt'] Unstash -opt-tar instead of -opt,
70+
* config['unstash_opt'] Un-stash -opt-tar instead of -opt,
7171
* default is false.
7272
*
73-
* config['unstash_tests'] Unstash -tests, default is true.
73+
* config['unstash_tests'] Un-stash -tests, default is true.
7474
*/
7575

7676
Map afterTest(Map config, Map testRunInfo) {
@@ -144,6 +144,7 @@ Map call(Map config = [:]) {
144144
/([a-z]+)(.*)/)[0][1] + stage_info['distro_version'],
145145
inst_repos: config.get('inst_repos', ''),
146146
inst_rpms: inst_rpms)
147+
147148
String target_stash = "${stage_info['target']}-${stage_info['compiler']}"
148149
if (stage_info['build_type']) {
149150
target_stash += '-' + stage_info['build_type']

0 commit comments

Comments
 (0)