Skip to content

Commit

Permalink
Merge pull request Mbed-TLS#180 from ARMmbed/dev/mpg/strengthen-activ…
Browse files Browse the repository at this point in the history
…ity-check

Reduce activity threshold for pr-merge nightly
  • Loading branch information
bensze01 authored and daverodgman committed Sep 21, 2021
2 parents c8bb2d8 + 389494e commit 3b4af57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vars/mbedtls.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,18 @@ def run_pr_job(is_production=true) {

/* During the nightly branch indexing, if a target branch has been
* updated, new merge jobs are triggered for each PR to that branch.
* If a PR hasn't been updated in over a month, don't run the merge
* If a PR hasn't been updated recently enough, don't run the merge
* job for that PR.
*/
if (env.BRANCH_NAME ==~ /PR-\d+-merge/ &&
currentBuild.rawBuild.getCauses()[0].toString().contains('BranchIndexingCause'))
{
upd_timestamp_ms = pullRequest.updatedAt.getTime()
now_timestamp_ms = currentBuild.startTimeInMillis
long month_ms = 30L * 24L * 60L * 60L * 1000L
if (now_timestamp_ms - upd_timestamp_ms > month_ms) {
error('Not running: PR has not been updated in over a month.')
/* current threshold is 7 days */
long threshold_ms = 7L * 24L * 60L * 60L * 1000L
if (now_timestamp_ms - upd_timestamp_ms > threshold_ms) {
error('Not running: PR has not been updated recently enough.')
}
}

Expand Down

0 comments on commit 3b4af57

Please sign in to comment.