Skip to content

Commit b5a5198

Browse files
committed
ci: fix functional review pipeline check
1 parent 0b2ee82 commit b5a5198

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

Jenkinsfile

+18-15
Original file line numberDiff line numberDiff line change
@@ -524,23 +524,26 @@ pipeline {
524524
def status = issue.data.fields.status
525525
println "Issue Status: ${status.name} (${status.id})"
526526

527-
// For Issues with Functional reviewer and not validated
528-
if (issue.data.fields.customfield_10105 && status.id != "10325") {
529-
// Ensure the PR is not already marked as changed requested
530-
def lastFuncReviewStatus
531-
for (review in pullRequest.reviews) {
532-
if (review.user == "ironArt3mis") {
533-
lastFuncReviewStatus = review.state
527+
// For Issues with Functional reviewer
528+
if (issue.data.fields.customfield_10105) {
529+
// Not validated
530+
if (status.id != "10325") {
531+
// Ensure the PR is not already marked as changed requested
532+
def lastFuncReviewStatus
533+
for (review in pullRequest.reviews) {
534+
if (review.user == "ironArt3mis") {
535+
lastFuncReviewStatus = review.state
536+
}
534537
}
538+
// PR already marked as review requested
539+
if (lastFuncReviewStatus == "CHANGES_REQUESTED") {
540+
echo "This PR is already marked as functional review required"
541+
return
542+
}
543+
pullRequest.review('REQUEST_CHANGES', 'Functional review required')
544+
} else {
545+
pullRequest.review('APPROVE')
535546
}
536-
// PR already marked as review requested
537-
if (lastFuncReviewStatus == "CHANGES_REQUESTED") {
538-
echo "This PR is already marked as functional review required"
539-
return
540-
}
541-
pullRequest.review('REQUEST_CHANGES', 'Functional review required')
542-
} else {
543-
pullRequest.review('APPROVE')
544547
}
545548
}
546549
}

0 commit comments

Comments
 (0)