#292 CI/CD: Job refactoring
Merged by rayson. Opened by rayson.
rayson/waiverdb cicd-split-dev-job  into  master

Download 292.patch

Following up https://pagure.io/waiverdb/issue/263.

  1. Split waiverdb-dev job into waiverdb-premerge and waiverdb-postmerge
    for better readability. The new 2 jobs are generated from the same template waiverdb-build.
  2. Move Pagure pull-request flagging and mail sending code from polling job to waiverdb-premerge and waiverdb-postmerge jobs.
  3. Use C3I Library to interact with Pagure API.

@mikeb Could you take a look?

rebased onto 3282d97e7aa4eff3348089d5932a4bf89de4720e

Is this left over from testing?

You'll want to add the:

changelog: false,

option to the library step, to avoid Jenkins also polling for changes on the library repo. See:

https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/34#issuecomment-312108505

for more information.

Should this be displayName:?

Isn't PAGURE_URL being passed in as a parameter? This value should come from there.

You could use c3i.wait(buildSelector.name()) here. It handles checking when the build starts, streaming the logs, and raising an error if the build does not end in the Complete state. You can use it for watching the progress of any build, either a container build or another pipeline job.

You don't need the c3i. here, pagure is available as a global variable.

Should be recipient.

Made a few comments, but overall +1, I really like refactoring, I think it makes it a lot simpler and more manageable.

rebased onto 9d75c931c0fe6030ae507be129bf2c4204c3ccac

Is this left over from testing?

This is actually useless. I just don't know what the default value of WAIVERDB_GIT_REF should be for a premerge job. It should be something like pull/$number/head but it is usually passed from upstream polling job. I finally decided to remove this parameter because it is not intended to be manually triggered.

You'll want to add the:
changelog: false,
option to the library step, to avoid Jenkins also polling for changes on the library repo. See:
https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/34#issuecomment-312108505
for more information.

Done.

Should this be displayName:?

Yes, it's a mistake.

Isn't PAGURE_URL being passed in as a parameter? This value should come from there.

You are right. Changed.

You could use c3i.wait(buildSelector.name()) here. It handles checking when the build starts, streaming the logs, and raising an error if the build does not end in the Complete state. You can use it for watching the progress of any build, either a container build or another pipeline job.

It is really awesome to have such a wait function! I've tried it and it indeed reduces the code duplication. But I have some RFEs for those C3I functions. I will open an issue in the c3-library repo later.

You don't need the c3i. here, pagure is available as a global variable.

Done.

Should be recipient.

Done.

Made a few comments, but overall +1, I really like refactoring, I think it makes it a lot simpler and more manageable.

Thanks for the review. I am really excited in introducing the c3i-library to WaiverDB pipeline. The power of that library began to show up!

PAGURE_API and PAGURE_REPO_HOME are already set in the global environment section, they don't need to be set again here.

One comment about duplicate environment variables. Otherwise looks good! +1 to merge it.

rebased onto 67ef28c80aa21a23d2adc82eace9a9cb361f6fae

Thanks @mikeb

Commit 5863efdf fixes this pull-request

Pull-Request has been merged by rayson

Pull-Request has been merged by rayson

Metadata