[OpenStack-Infra] multiple gerrit connections for ZUUL

Hejral, VaclavX vaclavx.hejral at intel.com
Fri Apr 1 12:44:08 UTC 2016


Hello,

running Zuul version: 2.1.1.dev131, I want to configure multiple gerrit
connections, so gerrit account reporting back will differ based on pipeline.
Having just one gerrit account (connection) works without problems.

Original /etc/zuul/zuul.conf contained just one gerrit connection as below

>>
[gerrit]
server=review.openstack.org
user=intel-nfv-ci
sshkey=/var/lib/zuul/ssh/id_rsa
>>

"gerrit" is used in /etc/zuul/layout/layout.conf
and everything works well.

I thought the solution is to add additional connection section into
/etc/zuul/zuul.conf and use connection in laoyut.yaml itself.
I have troubles with that.

After adding next section, e.g. my_gerrit into /etc/zuul/zuul.conf
>>
[my_gerrit]
server=review.openstack.org
user=intel-networking-ci
sshkey=/var/lib/zuul/ssh/id_rsa_intel-networking-ci at review.openstack.org
>>

and using "my_gerrit" in /etc/zuul/layout/layout.yaml
zuul refuses to start, and also validation via
zuul-server -t fails.

I ended with configuration of /etc/zuul/zuul.conf as follows (I added
"connection" string and "driver" parameter to both my gerrit connections)

>>
[connection gerrit]
driver=gerrit
server=review.openstack.org
user=intel-nfv-ci
sshkey=/var/lib/zuul/ssh/id_rsa

[connection my_gerrit]
driver=gerrit
server=review.openstack.org
user=intel-networking-ci
sshkey=/var/lib/zuul/ssh/id_rsa_intel-networking-ci at review.openstack.org
>>

No change. Still, zuul-server doesn't know about "my_gerrit"
So now, I have /etc/zuul/zuul.conf with 2 gerrit connections defined,
but the 2nd - my_gerrit I am unable to use in /etc/zuul/layout/layout.yaml

excerpt from working /etc/zuul/layout/layout.yaml
>>
    source: gerrit
    trigger:
      gerrit:
        - event: patchset-created
   success:
      gerrit:
        verified: 1
>>
This works well.

excerpt from non-working /etc/zuul/layout/layout.yaml
>>
    source: gerrit
    trigger:
      gerrit:
        - event: patchset-created
    success:
      my_gerrit:
        verified: 1
>>

zuul-server -t
Traceback (most recent call last):
  File "/usr/local/bin/zuul-server", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 218, in main
    sys.exit(server.test_config(path))
  File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 96, in test_config
    self.connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 286, in testConfig
    return self._parseConfig(config_path, connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 402, in _parseConfig
    validator.validate(data, connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/layoutvalidator.py", line 328, in validate
    schema(data)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 337, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 635, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 471, in validate_mapping
    raise MultipleInvalid(errors)
voluptuous.MultipleInvalid: extra keys not allowed @ data['pipelines'][0]['success']['my_gerrit']

I tried to modify, source:, trigger:, success:
seems anything except 1st gerrit connection "gerrit" is not knownn to zuul.

excerpt from non-working /etc/zuul/layout/layout.yaml
>>
    source: my_gerrit
    trigger:
      my_gerrit:
        - event: patchset-created
    success:
      gerrit:
        verified: 1
>>

zuul-server -t
Traceback (most recent call last):
  File "/usr/local/bin/zuul-server", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 218, in main
    sys.exit(server.test_config(path))
  File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 96, in test_config
    self.connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 286, in testConfig
    return self._parseConfig(config_path, connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 444, in _parseConfig
    params)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 384, in _getReporterDriver
    return self._getDriver('reporter', connection_name, driver_config)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 369, in _getDriver
    driver = drivers[dtype][driver_name].split(':')
KeyError: 'my_gerrit'

I tried vice versa, to keep just "my_gerrit" in /etc/zuul/zuul.conf
I got similar issue - that zuul does not know "gerrit" now

zuul-server -t
Traceback (most recent call last):
  File "/usr/local/bin/zuul-server", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 218, in main
    sys.exit(server.test_config(path))
  File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 96, in test_config
    self.connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 286, in testConfig
    return self._parseConfig(config_path, connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 402, in _parseConfig
    validator.validate(data, connections)
  File "/usr/local/lib/python2.7/dist-packages/zuul/layoutvalidator.py", line 328, in validate
    schema(data)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 337, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 635, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 471, in validate_mapping
    raise MultipleInvalid(errors)
voluptuous.MultipleInvalid: extra keys not allowed @ data['pipelines'][0]['success']['gerrit']

Is it known this scenario shouldn't work or am I doing something wrong?
Any ideas?

Thanks,
Vaclav

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-infra/attachments/20160401/b4dc12e9/attachment.html>


More information about the OpenStack-Infra mailing list