zuul/tests/fixtures/config/wrong-connection-in-pipeline
James E. Blair 7b6134ca81 Detect Gerrit gate pipelines with the wrong connection
If multiple Gerrit connections are configured and the wrong one
is used in a gate pipeline, then the Gerrit reporter will correctly
detect that it should not act on a change from a different connection,
however, the isMerged check which is associated with the (correct)
source connection performs an extra check immediately after reporting.
Since the reporter didn't (couldn't) act, the ._ref_sha attribute
(pointing to the previous sha before reporting) won't be set, and
the isMerged check throws an exception.

To correct this, have isMerged detect this case, log an error, and
return False (which will fail the item in the pipeline).  Also,
have the reporter log when it's skipping reporting for a different
connection.  This is normal behavior when everything is configured
correctly, but could be a helpful clue when something is misconfigured,
so that is set at debug level.

Change-Id: Ic3b715273e08ed2df7096c79add1b319066c46ec
Story: 2007761
2020-06-09 13:27:23 -07:00
..
git Detect Gerrit gate pipelines with the wrong connection 2020-06-09 13:27:23 -07:00
main.yaml Detect Gerrit gate pipelines with the wrong connection 2020-06-09 13:27:23 -07:00