OLMIS-3498: Support releasing from a branch using a Jenkinsfile

Activity

FEOLMIS-2826 40

Keyboard shortcuts  
  • Summarize the review outcomes (optional)
     
    #permalink

    Details

    Warning: no files are visible, they have all been filtered.
    Participant Role Time Spent Comments Latest Comment
    Author 3h 17m 17 Since there are no unresolved issues or questions, I'm go...
    Reviewer - 0% reviewed 15m 3 Maybe we shouldn't build every single branch, but just th...
    Reviewer - 0% reviewed 48m 4 Thanks Jakub Kondrat, a few more things to note: *I thi...
    Reviewer - 100% reviewed 1h 7m 13 Jakub Kondrat How these builds know new version of refere...
    Total   5h 28m 40  
    #permalink

    Objectives

    There are no specific objectives for this review.

    Branches in review

    #permalink

    Issues Raised From Comments

    Key Summary State Assignee
    #permalink

    General Comments

    Josh Zamor

    This looks good Jakub Kondrat. Any new updates? I did followup on the Transi...

    This looks good Jakub Kondrat. Any new updates?

    I did followup on the Transifex reasoning and while we might have an issue for follow-on work when we do want to build any branch at any time, I think for now there's no issue here so long as our development process keeps to trunk based development.

    Next thing: Thanks for adding in the stages to run contract tests. It's exactly what I asked for, and the more I've had a chance to think about it, I think it may not help the team as we copy this pattern to the other services. It got us the general picture: we don't want to sign-off on a build if the contract tests don't pass. It however does so very verbosely by directly checking out the contract tests and running them.

    Instead I think you we're right initially, we'd prefer to invoke the contract test remotely. What we wouldn't want to do though is pass the pipeline if the contract test fails, so we need to invoke the contract tests from within the pipeline. Ideally that would mean calling one parameterized jenkins job with a parameter that let contract tests know which service changed and it would determine which tests to run. That might be too much to change all at once though, so lets call the contract test jobs as they are today from within the pipeline, and wait for each job to pass/fail before we pass/fail the pipeline. This looks helpful: https://stackoverflow.com/questions/43337070/how-to-invoke-a-jenkins-pipeline-a-in-another-jenkins-pipeline-b/43340921

    Jakub Kondrat

    Josh Zamor: It's good to hear that Transifex is not an issue now. I made the ...

    Josh Zamor: It's good to hear that Transifex is not an issue now.
    I made the pipeline invoke existing jobs in order to run contract tests. The downside is that the pipeline job will still occupy a build slot while waiting for these tests to complete. I parallelized contract test and sonar analysis stage, so it shouldn't be a big issue as long as we have more than one executor slot.
    Other than that - no updates. Is there anything else that needs to be done? Here's a ticket for creating that parametrized job: OLMIS-4625

    Josh Zamor

    Thanks Jakub Kondrat, a few more things to note: *I think we forgot the bui...

    Thanks Jakub Kondrat, a few more things to note:

    • I think we forgot the build ERD step? And we'll need to archive it.
    • Also I think as-is we don't have a Slack notification if the some of the stages fail. e.g. the Sonar stage fails? Is it possible to do this for the overall pipepline rather than each stage?
    • Is it possible to archive the contract test results? I'm just curious it's not needed.


    Some other nice to haves:

    • Can we add log-rotate into the Jenkinsfile so that we only keep the last 15 or so builds?
    • Can we discard branch builds after they're no longer relevant? Like this one: http://build.openlmis.org/job/OpenLMIS-referencedata-pipeline/job/OLMIS-2245/

    Jakub Kondrat

    Josh Zamor: *I have added the ERD generation step *We should now be getting...

    Josh Zamor:

    • I have added the ERD generation step
    • We should now be getting a Slack notification if the whole pipeline fails
    • I don't think it's possible to archive contract test results if we have them in a separate job
    • Added build rotation (15 builds)
    • Maybe discarding branch builds after x days would make sense? buildDiscarder(logRotator(daysToKeepStr: env.BRANCH_NAME == 'master' ? '' : '7'))

    Łukasz Lewczyński

    There is an issue with slack notification. The following message is shown on ...

    There is an issue with slack notification. The following message is shown on build channel:

    ${env.JOB_NAME} - ${env.BUILD_NUMBER} FAILED (<${env.BUILD_URL}|Open>)
    

    Jakub Kondrat

    It's already fixed

    It's already fixed

    Jakub Kondrat

    Update: After adding this Jenkinsfile to a couple other services, it turned o...

    Update: After adding this Jenkinsfile to a couple other services, it turned out that a deadlock is possible - when the pipelines occupy all the available build slots (3), the external job for contract tests cannot be launched. I have installed this plugin https://wiki.jenkins.io/display/JENKINS/Throttle+Concurrent+Builds+Plugin
    and added a "pipeline" group that allows only one job from this group to run on a node (so the second slot on slave will always be available for other jobs). This group can be configured under "Throttle Concurrent Builds" section in Jenkin's system configuration

    Jakub Kondrat

    Since there are no unresolved issues or questions, I'm going to close this re...

    Since there are no unresolved issues or questions, I'm going to close this review

    /Jenkinsfile Added 31

    Review updated: Reload | Ignore | Collapse

    You cannot reload the review while writing a comment.

    Log time