zuul/zuul/driver/gerrit
James E. Blair d595c9f024 Fix multi-tenant gerrit pre-filters
The Gerrit trigger event pre-filters functionality had a flaw when
multiple tenants used the same connection but did not have the same
pipeline configuration.  Whichever tenant reconfigured most recently
would set the pre-filters for the entire connection based on that
tenant's pipeline configuration.

This feature was based on the Gerrit checks plugin feature, and since
it is deprecated, that feature likely has only ever seen a single user
with a single tenant.  It likely suffers from the same flaw but that
went unnoticed.  This change does not address the checks plugin, but
it does add TODO comments indicating the flaw for clarity.

To correct the issue for pre-filters, we will store the filters for
each tenant separately and then build a superset of filters for all
tenants after reconfiguration.

The filters have hash and eq methods added so that we can avoid storing
duplicate filters for systems with very similar configurations on
each tenant.  This saves processing time during pre-filtering.

Since the driver reconfigure method is not called on a removed tenant,
there is no facility for removing filters of deleted tenants.  This is
a limitation shared not only with the checks plugin support, but also
other drivers such as the timer or zuul drivers.  We should probably
address that in a future change, but it's not critical now since
the current implementation will "fail safe" by simply having more
pre-filters than necessary.  Given that the behavior before this change
was not to have pre-filters at all, that should be fine.  As schedulers
are restarted, excess pre-filters will naturally age out.

Change-Id: Ib879a8983c5444594ee152735dbcfc7f4dba2f80
2024-07-13 16:42:48 -07:00
..
__init__.py Fix multi-tenant gerrit pre-filters 2024-07-13 16:42:48 -07:00
auth.py gerrit: Fix 'form' auth 2022-04-25 09:30:48 -05:00
gcloudauth.py Add gcloud_service auth option for Gerrit driver 2020-01-30 08:09:00 -08:00
gerritconnection.py Fix multi-tenant gerrit pre-filters 2024-07-13 16:42:48 -07:00
gerriteventawskinesis.py Add AWS Kinesis support 2023-07-25 11:04:19 -07:00
gerriteventchecks.py Refactor Gerrit driver event sources 2023-07-13 14:02:46 -07:00
gerriteventgcloudpubsub.py Add gcloud pubsub support to Gerrit driver 2023-08-02 14:50:28 -07:00
gerriteventkafka.py Add Kafka support to Gerrit 2023-07-15 14:41:23 -07:00
gerriteventssh.py Refactor Gerrit driver event sources 2023-07-13 14:02:46 -07:00
gerritmodel.py Fix multi-tenant gerrit pre-filters 2024-07-13 16:42:48 -07:00
gerritreporter.py Make the test change database serializable 2024-05-14 10:53:20 -07:00
gerritsource.py Stop using submitted-together for submitWholeTopic 2024-06-10 18:13:45 -07:00
gerrittrigger.py gerrit: Add approval-change trigger 2024-05-03 15:39:46 -07:00