Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-12478

remove jenkins job slack notification boiler plate

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Continuous Integration
    • Labels:
      None

      Description

      As part of converting the tag-git-repos job to jenkins pipeline, a new convience method named notify.wrap() was introduced that can replace this chunk of boilerplate that is current present in most (all?) of our pipeline scripts:

      try {
        notify.started()
        // do stuff
      } catch (e) {
        // If there was an exception thrown, the build failed
        currentBuild.result = "FAILED"
        throw e
      } finally {
        echo "result: ${currentBuild.result}"
        switch(currentBuild.result) {
          case null:
          case 'SUCCESS':
            notify.success()
            break
          case 'ABORTED':
            notify.aborted()
            break
          case 'FAILURE':
            notify.failure()
            break
          default:
            notify.failure()
        }
      }
      

      Which may be converted to:

      notify.wrap {
        // do stuff
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            jhoblitt Joshua Hoblitt added a comment -

            Ugh. It looks like a git rebase somehow mangled three files/job pipeline scripts:

            modified: pipelines/clean_build.groovy
            modified: pipelines/sqre/infrastructure/update_cmirror.groovy
            modified: pipelines/stack_os_matrix.groovy

            https://github.com/lsst-sqre/jenkins-dm-jobs/commit/3481d1b653371abeb5ebfa2b269bb618e3fd2186

            I'm not entirely sure how that happened, but I suspect it was commits for some files being committed as part of PRs on other tickets. The history looks so messy, I think I'm going to rebase master.

            Show
            jhoblitt Joshua Hoblitt added a comment - Ugh. It looks like a git rebase somehow mangled three files/job pipeline scripts: modified: pipelines/clean_build.groovy modified: pipelines/sqre/infrastructure/update_cmirror.groovy modified: pipelines/stack_os_matrix.groovy https://github.com/lsst-sqre/jenkins-dm-jobs/commit/3481d1b653371abeb5ebfa2b269bb618e3fd2186 I'm not entirely sure how that happened, but I suspect it was commits for some files being committed as part of PRs on other tickets. The history looks so messy, I think I'm going to rebase master.
            Hide
            jhoblitt Joshua Hoblitt added a comment - - edited

            I attempted to rebase + squash the duplicate notification boilerplate commits ontop of 30acf8a3947b62eaad505879c60d91dfba030a8a while preserving merge commits but this resulted in the history being really strange. When I rebased without preserving merge, two non-merge commits vanished (wtf...) but I was able to cherry-pick them back. The end result is that the last 3 PRs/merge commits were wiped from the history. I force pushed the repaired history over the github master. I have also enabled Require branches to be up to date before merging on the github repo to try to guard against non-ff merges in the future. I'm unsure if that projection will work without any status checks being configured – a trivial check may need to be added.

            Show
            jhoblitt Joshua Hoblitt added a comment - - edited I attempted to rebase + squash the duplicate notification boilerplate commits ontop of 30acf8a3947b62eaad505879c60d91dfba030a8a while preserving merge commits but this resulted in the history being really strange. When I rebased without preserving merge, two non-merge commits vanished (wtf...) but I was able to cherry-pick them back. The end result is that the last 3 PRs/merge commits were wiped from the history. I force pushed the repaired history over the github master. I have also enabled Require branches to be up to date before merging on the github repo to try to guard against non-ff merges in the future. I'm unsure if that projection will work without any status checks being configured – a trivial check may need to be added.
            Hide
            jhoblitt Joshua Hoblitt added a comment -

            Moving this ticket into self review to follow up that all jobs have been fixed.

            Show
            jhoblitt Joshua Hoblitt added a comment - Moving this ticket into self review to follow up that all jobs have been fixed.
            Hide
            jhoblitt Joshua Hoblitt added a comment -

            I've survived virtually all jenkins jobs this morning and the breakage seems to be fixed.

            Show
            jhoblitt Joshua Hoblitt added a comment - I've survived virtually all jenkins jobs this morning and the breakage seems to be fixed.

              People

              • Assignee:
                jhoblitt Joshua Hoblitt
                Reporter:
                jhoblitt Joshua Hoblitt
                Reviewers:
                Joshua Hoblitt
                Watchers:
                Joshua Hoblitt, Kian-Tat Lim, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel