Page MenuHomePhabricator

JJB should support YAML axis
Closed, ResolvedPublic

Description

We are going to use https://wiki.jenkins-ci.org/display/JENKINS/Yaml+Axis+Plugin

JJB does not support such axis. Should be straightforward looking at jenkins_jobs/modules/project_matrix.py . An example of plugin provided axis is dynamic in that file.

Upstream patches:

https://review.openstack.org/286689Partial support Yaml Axis PluginMerged and released
https://review.openstack.org/286690Complete support of Yaml Axis PluginMerged
https://review.openstack.org/322976project matrix: rename variable/refactorPolishing patch. Merged

Details

Related Gerrit Patches:
integration/jenkins-job-builder : masterMerge in Jenkins Yaml Axis Plugin support

Event Timeline

hashar created this task.Mar 1 2016, 1:40 PM
hashar claimed this task.Mar 1 2016, 1:44 PM
hashar added a comment.Mar 1 2016, 4:24 PM

Did a first pass and proposed two changes for review upstream:

https://review.openstack.org/286689Partial support Yaml Axis Plugin
https://review.openstack.org/286690Complete support of Yaml Axis Plugin

Will use that to create some jobs on our Jenkins to make sure they are working properly. I have a test git repo to exercise the jobs against.

If all fine, I will cherry pick / update on our integration/jenkins-job-builder.git fork.

Paladox added a subscriber: Paladox.Mar 1 2016, 4:26 PM

I had meeting yesterday, then did some random reviews in the evening.
This morning I had to fix T128569: Zuul deadlocks if unknown repo has activity in Gerrit.

Stuff to do is craft a few jobs making use of the patchset I crafted, run them and ensure they work properly. Once confirmed, I will cherry pick both of my patches on integration/jenkins-job-builder and people can update their local installation.

I created a git repository with a /config.yaml file having:

python:
    - py27
    - py34
    - py35
database:
    - postgre
    - mysql

The dummy JJB config:

- job:
    name: hashar-jjb-yamlaxis
    project-type: matrix
    axes:
     - axis:
        type: label-expression
        name: label
        values:
         - contintLabsSlave && UbuntuTrusty
     - axis:
        name: python
        type: yaml
        filename: config.yaml
     - axis:
        name: database
        type: yaml
        filename: config.yaml
    scm:
        - git:
            url: 'https://github.com/hashar/yamlaxis'
            branches:
                - master
            wipe-workspace: false
            clean:
                after: true
    builders:
        - shell: |
            echo -e "Axis...\nPython: $python\nDatabase: $database"

Build page view:

And the echo commands shows the env variables $python and $database properly.

The patches I have proposed are very rough and I need to do a second pass on them. Namely enhance the documentation and add a few more tests.

Change 274435 had a related patch set uploaded (by Hashar):
Merge in Jenkins Yaml Axis Plugin support

https://gerrit.wikimedia.org/r/274435

Change 274435 merged by Hashar:
Merge in Jenkins Yaml Axis Plugin support

https://gerrit.wikimedia.org/r/274435

hashar edited projects, added Upstream; removed Patch-For-Review.Mar 2 2016, 4:55 PM

I have refreshed our fork of JJB to the latest master, carefully inspecting diff as I was rebasing commits after commits (git bisect works like a charm).

Cherry picked my two changes send upstream and I have merged them in our fork. Tip of master is cd63874ab6bccdf4e93a522ed3543c84e96c0170 you will want to update your JJB setup.

So this task is almost complete, pending review / merge of changes in upstream repository.

hashar moved this task from Backlog to Patch proposed upstream on the Upstream board.
zeljkofilipin lowered the priority of this task from Normal to Low.May 29 2017, 10:27 AM
hashar updated the task description. (Show Details)Jun 22 2017, 2:31 PM
hashar updated the task description. (Show Details)Jun 22 2017, 3:10 PM

I have addressed the few comments that were pending in OpenStack Gerrit and rebased the serie of patches.

Upstream patch has been merged :-} So I guess I just have to update our fork.

hashar updated the task description. (Show Details)Aug 29 2017, 7:44 AM
hashar closed this task as Resolved.Aug 29 2017, 8:40 AM
hashar updated the task description. (Show Details)

Fork finally updated to catch up with upstream. All patches got merged.