On Wed, Mar 6, 2019 at 12:56 AM Nir Soffer <nsoffer@redhat.com> wrote:
I'm trying to a write a tool that given a gerrit patch number, will:
1. Start build artifacts job (instead of adding "ci please build" comment)\
2. Wait until the job is complete
3. Start OST with CUSTOM_REPOS using the build artifacts job from step 1
4. Wait until OST complets
5. Post a comment with the OST link to gerrit

So testing patches will easy as:

   $ ci test 12345
   Building rpms...
   Starting OST...
   OST succeeded, congratulations!

I can start OST and watch it, but I could not find a way to start vdsm build-artifacts job.

This starts a job:

curl -i \
    --user USERNAME:API_TOKEN \
    -X POST \
    https://jenkins.ovirt.org/job/vdsm_standard-check-patch/build

But the fail quickly in the first "detecting" stage.

Clicking "Build Now" button on the job page fails in the same way.

And this:

curl -i \
    --user USERNAME:API_TOKEN \
    -X POST \
    https://jenkins.ovirt.org/job/vdsm_standard-check-patch/buildWithParameters

Fails with 500 Internal server error, with a huge traceback, hiding this expected message:

    java.lang.IllegalStateException: This build is not parameterized!

Looks like the job need to be parametrized:


I guess we can workaround this by posting "ci please build" comment on gerrit
using gerrit API, and then waiting waiting an grabbing the build link from the comment
added by jenkins, but I really don't want to go in this direction.

I hope we can have a proper solution in the job configuration.

With Barak help I could get the entire flow working
(using the secret standard-manual-runner)

I started this project on github:

There is no code yet, but the entire flow is documented here:

Sharing in case someone wants to write this before I find time for this :-)

Nir