Skip to content

Commit 014de52

Browse files
Disable external links validation on master (#1325)
1 parent 2949b78 commit 014de52

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

governance.Jenkinsfile

+7-8
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@ podTemplate(label: label) {
2323
checkout scm
2424
}
2525

26+
2627
stage("validate internal links") {
2728
validateLinks('--ignore-external', repositoryName)
2829
}
2930

30-
if (!isMaster) {
31+
if (isMaster) {
32+
stage("validate external links") {
33+
validateLinks('--ignore-internal', repositoryName)
34+
}
35+
} else {
3136
stage("validate external links in changed markdown files") {
3237
def changes = changedMarkdownFiles(repositoryName).join(" ")
3338
validateLinks("--ignore-internal ${changes}", repositoryName)
3439
}
3540
}
36-
37-
if(isMaster || params.TRIGGER_FULL_VALIDATION) {
38-
stage("validate external links") {
39-
validateLinks('--ignore-internal', repositoryName)
40-
}
41-
}
4241
}
4342
}
4443
}
@@ -47,7 +46,7 @@ podTemplate(label: label) {
4746
currentBuild.result = "FAILURE"
4847
def body = "${currentBuild.currentResult} ${env.JOB_NAME}${env.BUILD_DISPLAY_NAME}: on branch: ${params.GIT_BRANCH}. See details: ${env.BUILD_URL}"
4948
emailext body: body, recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], subject: "${currentBuild.currentResult}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'"
50-
49+
5150
if(isMaster) {
5251
sendSlackNotification(":hankey-fire:Governance validation failed on `${repositoryName}` repository!\nSee details: ${env.BUILD_URL}console")
5352
}

orchestrator.Jenkinsfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ String[] changedProjects() {
214214
res.add(allProjects[i])
215215
break // already found a change in the current project, no need to continue iterating the changeset
216216
}
217-
if (allProjects[i] == "governance" && allChanges[j].endsWith(".md") && !res.contains(allProjects[i])) {
217+
if (env.BRANCH_NAME != 'master' && allProjects[i] == "governance" && allChanges[j].endsWith(".md") && !res.contains(allProjects[i])) {
218218
res.add(allProjects[i])
219219
break // already found a change in one of the .md files, no need to continue iterating the changeset
220220
}
@@ -234,7 +234,7 @@ boolean changeIsValidFileType(String change, String project){
234234
@NonCPS
235235
String changeset() {
236236
// on branch get changeset comparing with master
237-
if (env.BRANCH_NAME != "master") {
237+
if (env.BRANCH_NAME != 'master') {
238238
echo "Fetching changes between origin/${env.BRANCH_NAME} and origin/master."
239239
return sh (script: "git --no-pager diff --name-only origin/master...origin/${env.BRANCH_NAME} | grep -v 'vendor\\|node_modules' || echo ''", returnStdout: true)
240240
}

0 commit comments

Comments
 (0)