Skip to content

Commit

Permalink
Add ability to retrieve versioned crystalball map
Browse files Browse the repository at this point in the history
flag=none
Test-plan:
- run a patchset with different value set for crystalball map
- previous timestamp should appear in #crystalball-noisy

Change-Id: I206e2c62bcfc00f0f8bc8c8ad0b1262d28caab4f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283794
Reviewed-by: Kyle Rosenbaum <[email protected]>
QA-Review: Brian Watson <[email protected]>
Product-Review: Brian Watson <[email protected]>
Tested-by: Service Cloud Jenkins <[email protected]>
  • Loading branch information
brianlwatson committed Jan 28, 2022
1 parent f2b3a9b commit d13aa69
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def buildParameters = [
string(name: 'GERRIT_CHANGE_COMMIT_MESSAGE', value: "${env.GERRIT_CHANGE_COMMIT_MESSAGE}"),
string(name: 'GERRIT_HOST', value: "${env.GERRIT_HOST}"),
string(name: 'GERGICH_PUBLISH', value: "${env.GERGICH_PUBLISH}"),
string(name: 'MASTER_BOUNCER_RUN', value: "${env.MASTER_BOUNCER_RUN}")
string(name: 'MASTER_BOUNCER_RUN', value: "${env.MASTER_BOUNCER_RUN}"),
string(name: 'CRYSTALBALL_MAP_S3_VERSION', value: "${env.CRYSTALBALL_MAP_S3_VERSION}")
]

def getSummaryUrl() {
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile.rspecq
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ def computeTestCount() {

// Crystalball predictor returned empty text file
if (specUnique.size() == 0) {
crystalballSummaryMessage = 'No App Code Detected! - Running everything!'
crystalballSummaryMessage = "Map: $mapVersion\nNo App Code Detected! - Running everything!"
// Do not run full builds while still testing
env.CRYSTALBALL_SKIP = 'true'
return
}
// Crystalball predictor returned "."
if (specUnique.size() == 1 && specUnique[0] == '.') {
crystalballSummaryMessage = 'New File Detected! - Complete Suite Re-run!'
crystalballSummaryMessage = "Map: $mapVersion\nNew File Detected! - Complete Suite Re-run!"
// Do not run full builds while still testing
env.CRYSTALBALL_SKIP = 'true'
return
Expand Down
7 changes: 6 additions & 1 deletion build/new-jenkins/library/vars/setupStage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def call() {
def _getCrystalballMap() {
withCredentials([usernamePassword(credentialsId: 'INSENG_CANVAS_CI_AWS_ACCESS', usernameVariable: 'INSENG_AWS_ACCESS_KEY_ID', passwordVariable: 'INSENG_AWS_SECRET_ACCESS_KEY')]) {
def awsCreds = "AWS_DEFAULT_REGION=us-west-2 AWS_ACCESS_KEY_ID=${INSENG_AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY=${INSENG_AWS_SECRET_ACCESS_KEY}"
sh "$awsCreds aws s3 cp s3://instructure-canvas-ci/crystalball_map.yml ."

if (env.CRYSTALBALL_MAP_S3_VERSION && env.CRYSTALBALL_MAP_S3_VERSION != 'latest') {
sh "$awsCreds aws s3api get-object --bucket instructure-canvas-ci --key crystalball_map.yml --version-id ${env.CRYSTALBALL_MAP_S3_VERSION} crystalball_map.yml"
} else {
sh "$awsCreds aws s3 cp s3://instructure-canvas-ci/crystalball_map.yml ."
}
}
}

Expand Down

0 comments on commit d13aa69

Please sign in to comment.