Skip to content

Commit

Permalink
ci: fix functional review pipeline check
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaian committed May 15, 2024
1 parent 0b2ee82 commit b5a5198
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -524,23 +524,26 @@ pipeline {
def status = issue.data.fields.status
println "Issue Status: ${status.name} (${status.id})"

// For Issues with Functional reviewer and not validated
if (issue.data.fields.customfield_10105 && status.id != "10325") {
// Ensure the PR is not already marked as changed requested
def lastFuncReviewStatus
for (review in pullRequest.reviews) {
if (review.user == "ironArt3mis") {
lastFuncReviewStatus = review.state
// For Issues with Functional reviewer
if (issue.data.fields.customfield_10105) {
// Not validated
if (status.id != "10325") {
// Ensure the PR is not already marked as changed requested
def lastFuncReviewStatus
for (review in pullRequest.reviews) {
if (review.user == "ironArt3mis") {
lastFuncReviewStatus = review.state
}
}
// PR already marked as review requested
if (lastFuncReviewStatus == "CHANGES_REQUESTED") {
echo "This PR is already marked as functional review required"
return
}
pullRequest.review('REQUEST_CHANGES', 'Functional review required')
} else {
pullRequest.review('APPROVE')
}
// PR already marked as review requested
if (lastFuncReviewStatus == "CHANGES_REQUESTED") {
echo "This PR is already marked as functional review required"
return
}
pullRequest.review('REQUEST_CHANGES', 'Functional review required')
} else {
pullRequest.review('APPROVE')
}
}
}
Expand Down

0 comments on commit b5a5198

Please sign in to comment.