<div dir="ltr">Hello <span style="font-family:Calibri,sans-serif;font-size:14.6667px">Vaclav,</span><div><span style="font-family:Calibri,sans-serif;font-size:14.6667px"><br></span></div><div><span style="font-family:Calibri,sans-serif;font-size:14.6667px">Thanks for raising this, it looks like you've found a bug.</span></div><div><span style="font-family:Calibri,sans-serif;font-size:14.6667px"><br></span></div><div><font face="Calibri, sans-serif"><span style="font-size:14.6667px">The layout validation test doesn't load the scheduler fully meaning that the scheduler is unaware of the connections and hence you see errors like the ones you've exampled.</span></font></div><div><br></div><div>If you start the zuul server without -t you should find that it'll validate and load. I suggest you do this in a non-production instance to double check, but I'd also be curious to see how it goes.</div><div><br></div><div>The second set of config you tried should be the correct one. ie:</div><div><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br class="">[connection gerrit]<u></u><u></u></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">driver=gerrit</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">The important parts are the 'connection' keyword and the driver. The config section [gerrit] translates to the above for backwards compatibility.</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">I've got a patch to fix up the validation here: <a href="https://review.openstack.org/#/c/300924/">https://review.openstack.org/#/c/300924/</a></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Cheers,<br>Josh</p></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 2, 2016 at 12:02 AM, Paul Belanger <span dir="ltr"><<a href="mailto:pabelanger@redhat.com" target="_blank">pabelanger@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Fri, Apr 01, 2016 at 12:44:08PM +0000, Hejral, VaclavX wrote:<br>
> Hello,<br>
><br>
> running Zuul version: 2.1.1.dev131, I want to configure multiple gerrit<br>
> connections, so gerrit account reporting back will differ based on pipeline.<br>
> Having just one gerrit account (connection) works without problems.<br>
><br>
> Original /etc/zuul/zuul.conf contained just one gerrit connection as below<br>
><br>
> >><br>
> [gerrit]<br>
> server=<a href="http://review.openstack.org" rel="noreferrer" target="_blank">review.openstack.org</a><br>
> user=intel-nfv-ci<br>
> sshkey=/var/lib/zuul/ssh/id_rsa<br>
> >><br>
><br>
> "gerrit" is used in /etc/zuul/layout/layout.conf<br>
> and everything works well.<br>
><br>
> I thought the solution is to add additional connection section into<br>
> /etc/zuul/zuul.conf and use connection in laoyut.yaml itself.<br>
> I have troubles with that.<br>
><br>
> After adding next section, e.g. my_gerrit into /etc/zuul/zuul.conf<br>
> >><br>
> [my_gerrit]<br>
> server=<a href="http://review.openstack.org" rel="noreferrer" target="_blank">review.openstack.org</a><br>
> user=intel-networking-ci<br>
> sshkey=/var/lib/zuul/ssh/<a href="mailto:id_rsa_intel-networking-ci@review.openstack.org">id_rsa_intel-networking-ci@review.openstack.org</a><br>
> >><br>
><br>
> and using "my_gerrit" in /etc/zuul/layout/layout.yaml<br>
> zuul refuses to start, and also validation via<br>
> zuul-server -t fails.<br>
><br>
> I ended with configuration of /etc/zuul/zuul.conf as follows (I added<br>
> "connection" string and "driver" parameter to both my gerrit connections)<br>
><br>
> >><br>
> [connection gerrit]<br>
> driver=gerrit<br>
> server=<a href="http://review.openstack.org" rel="noreferrer" target="_blank">review.openstack.org</a><br>
> user=intel-nfv-ci<br>
> sshkey=/var/lib/zuul/ssh/id_rsa<br>
><br>
> [connection my_gerrit]<br>
> driver=gerrit<br>
> server=<a href="http://review.openstack.org" rel="noreferrer" target="_blank">review.openstack.org</a><br>
> user=intel-networking-ci<br>
> sshkey=/var/lib/zuul/ssh/<a href="mailto:id_rsa_intel-networking-ci@review.openstack.org">id_rsa_intel-networking-ci@review.openstack.org</a><br>
> >><br>
><br>
> No change. Still, zuul-server doesn't know about "my_gerrit"<br>
> So now, I have /etc/zuul/zuul.conf with 2 gerrit connections defined,<br>
> but the 2nd - my_gerrit I am unable to use in /etc/zuul/layout/layout.yaml<br>
><br>
> excerpt from working /etc/zuul/layout/layout.yaml<br>
> >><br>
>     source: gerrit<br>
>     trigger:<br>
>       gerrit:<br>
>         - event: patchset-created<br>
>    success:<br>
>       gerrit:<br>
>         verified: 1<br>
> >><br>
> This works well.<br>
><br>
> excerpt from non-working /etc/zuul/layout/layout.yaml<br>
> >><br>
>     source: gerrit<br>
>     trigger:<br>
>       gerrit:<br>
>         - event: patchset-created<br>
>     success:<br>
>       my_gerrit:<br>
>         verified: 1<br>
> >><br>
><br>
> zuul-server -t<br>
> Traceback (most recent call last):<br>
>   File "/usr/local/bin/zuul-server", line 10, in <module><br>
>     sys.exit(main())<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 218, in main<br>
>     sys.exit(server.test_config(path))<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 96, in test_config<br>
>     self.connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 286, in testConfig<br>
>     return self._parseConfig(config_path, connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 402, in _parseConfig<br>
>     validator.validate(data, connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/layoutvalidator.py", line 328, in validate<br>
>     schema(data)<br>
>   File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 337, in __call__<br>
>     return self._compiled([], data)<br>
>   File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 635, in validate_dict<br>
>     return base_validate(path, iteritems(data), out)<br>
>   File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 471, in validate_mapping<br>
>     raise MultipleInvalid(errors)<br>
> voluptuous.MultipleInvalid: extra keys not allowed @ data['pipelines'][0]['success']['my_gerrit']<br>
><br>
> I tried to modify, source:, trigger:, success:<br>
> seems anything except 1st gerrit connection "gerrit" is not knownn to zuul.<br>
><br>
> excerpt from non-working /etc/zuul/layout/layout.yaml<br>
> >><br>
>     source: my_gerrit<br>
>     trigger:<br>
>       my_gerrit:<br>
>         - event: patchset-created<br>
>     success:<br>
>       gerrit:<br>
>         verified: 1<br>
> >><br>
><br>
> zuul-server -t<br>
> Traceback (most recent call last):<br>
>   File "/usr/local/bin/zuul-server", line 10, in <module><br>
>     sys.exit(main())<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 218, in main<br>
>     sys.exit(server.test_config(path))<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 96, in test_config<br>
>     self.connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 286, in testConfig<br>
>     return self._parseConfig(config_path, connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 444, in _parseConfig<br>
>     params)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 384, in _getReporterDriver<br>
>     return self._getDriver('reporter', connection_name, driver_config)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 369, in _getDriver<br>
>     driver = drivers[dtype][driver_name].split(':')<br>
> KeyError: 'my_gerrit'<br>
><br>
> I tried vice versa, to keep just "my_gerrit" in /etc/zuul/zuul.conf<br>
> I got similar issue - that zuul does not know "gerrit" now<br>
><br>
> zuul-server -t<br>
> Traceback (most recent call last):<br>
>   File "/usr/local/bin/zuul-server", line 10, in <module><br>
>     sys.exit(main())<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 218, in main<br>
>     sys.exit(server.test_config(path))<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/cmd/server.py", line 96, in test_config<br>
>     self.connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 286, in testConfig<br>
>     return self._parseConfig(config_path, connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/scheduler.py", line 402, in _parseConfig<br>
>     validator.validate(data, connections)<br>
>   File "/usr/local/lib/python2.7/dist-packages/zuul/layoutvalidator.py", line 328, in validate<br>
>     schema(data)<br>
>   File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 337, in __call__<br>
>     return self._compiled([], data)<br>
>   File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 635, in validate_dict<br>
>     return base_validate(path, iteritems(data), out)<br>
>   File "/usr/local/lib/python2.7/dist-packages/voluptuous.py", line 471, in validate_mapping<br>
>     raise MultipleInvalid(errors)<br>
> voluptuous.MultipleInvalid: extra keys not allowed @ data['pipelines'][0]['success']['gerrit']<br>
><br>
> Is it known this scenario shouldn't work or am I doing something wrong?<br>
> Any ideas?<br>
><br>
> Thanks,<br>
> Vaclav<br>
><br>
</div></div>While I haven't tested it personally, we do have an example test fixture<br>
documenting[1][2] what is needed for multiple gerrit servers.<br>
<br>
My only comment would be to ensure you are using commit<br>
352264b3c22b501ae53c1643e31df2ccdfc89388[3] or later, since that introduced the new<br>
connection concept.<br>
<br>
[1] <a href="https://git.openstack.org/cgit/openstack-infra/zuul/tree/tests/fixtures/layouts/good_connections1.conf" rel="noreferrer" target="_blank">https://git.openstack.org/cgit/openstack-infra/zuul/tree/tests/fixtures/layouts/good_connections1.conf</a><br>
[2] <a href="https://git.openstack.org/cgit/openstack-infra/zuul/tree/tests/fixtures/layouts/good_connections1.yaml" rel="noreferrer" target="_blank">https://git.openstack.org/cgit/openstack-infra/zuul/tree/tests/fixtures/layouts/good_connections1.yaml</a><br>
[3] <a href="https://git.openstack.org/cgit/openstack-infra/zuul/commit/?id=352264b3c22b501ae53c1643e31df2ccdfc89388" rel="noreferrer" target="_blank">https://git.openstack.org/cgit/openstack-infra/zuul/commit/?id=352264b3c22b501ae53c1643e31df2ccdfc89388</a><br>
<br>
_______________________________________________<br>
OpenStack-Infra mailing list<br>
<a href="mailto:OpenStack-Infra@lists.openstack.org">OpenStack-Infra@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra</a><br>
</blockquote></div><br></div></div>