zuul/zuul
Guillaume Chauvel 96d002cbbe Fix branch name and project name for ref-updated create/delete
1.
gerritconnection: changes are using "data.change.branch" to fill
event.branch which doesn't have 'refs/heads/' prefix

branch creation and deletion were using "data.refUpdate.refName"
to fill event.branch which has the complete refname: it starts
with 'refs/heads/'

As a result, in the Scheduler event process queue, the cache was not
properly cleared when calling Abide's clearUnparsedBranchCache,
called using event.branch and not change.branch.

change.branch is already correctly set to the relative refname

When reconfiguring a tenant, it could hold data which were removed
and reconfigured tenant could still use data that had disappeared

This patch removes the prefix "refs/heads/" when setting event branch
name in case of deletion or creation

note: it's not possible to use event.branch to set change.branch in
gerritconnection.getChange as event objects doesn't have a constant base
type.
it can be either:
- GerritTriggerEvent -> TriggerEvent -> object
- DequeueEvent -> ManagementEvent -> object
the latter doesn't have a branch attribute

2.
Setting event.branch is moved to any 'ref-update' event, so it will now
be set when newrev and oldrev are both not null. This doesn't have and
should not have any impacts

Change-Id: Ie60b382b23074cc9feff0648e786ddaf0d3454aa
2020-09-16 11:19:05 +02:00
..
ansible Merge file comments from multiple tasks 2020-08-24 14:33:15 +02:00
cmd REST API: remove deprecated trigger arg in enqueue endpoint 2020-08-18 12:25:14 +02:00
connection Annotate some logs in the scheduler with event id 2019-05-17 06:06:11 +02:00
driver Fix branch name and project name for ref-updated create/delete 2020-09-16 11:19:05 +02:00
execution_context Add wrapper driver execution context 2017-08-18 16:35:12 -07:00
executor Fix Multi Node Builds with k8s Build Nodes 2020-08-17 16:15:36 +02:00
lib Merge "Ensure deletion of the command socket" 2020-07-24 17:02:02 +00:00
manager Annotate all canMerge calls with event id 2020-07-30 15:56:33 +02:00
merger Offload repo reset during merge 2020-09-14 11:02:36 +02:00
reporter Report dequeued changes via Github checks API 2020-05-14 07:42:24 +02:00
source Annotate getChangeByUrl logs with event id 2020-07-30 15:28:30 +02:00
sphinx docs: remove zuuldocs domain 2020-08-04 16:10:09 +10:00
trigger Annotate logs in the zuul driver with event ids 2019-05-17 06:06:11 +02:00
web Builds: add "held" attribute 2020-09-04 18:09:37 +02:00
__init__.py Initial commit. 2012-05-29 14:49:32 -07:00
_setup_hook.py Revert "Revert "Create zuul/web/static on demand"" 2020-07-07 19:53:33 +02:00
change_matcher.py Match tag items against containing branches 2020-03-06 13:29:18 -08:00
configloader.py Move mark comparision into ZuulMark object 2020-07-31 22:42:10 +10:00
exceptions.py web: add tenant and project scoped, JWT-protected actions 2019-07-10 12:11:14 +02:00
model.py Merge "Remove source_event from Change objects" 2020-09-14 18:59:42 +00:00
nodepool.py Fix memleak on zk session loss 2020-09-11 09:23:21 +02:00
rpcclient.py Add client_id to RPC client 2020-01-28 10:16:19 +01:00
rpclistener.py Separate slow rpc operations 2020-08-05 08:45:01 +02:00
scheduler.py Merge "Clear traceback before attaching exception to event" 2020-09-14 18:59:39 +00:00
version.py Report git sha in status page version 2018-04-27 10:21:43 -07:00
zk.py Add TLS support for ZooKeeper 2020-03-18 14:47:37 -07:00