If a cycle of dependencies is attempted to be enqueued into a pipeline
and at least one of the participating projects has a per-branch change queue
and the changes in the cycle are in different branches, it can be confusing
for users why the changes were not enqueued. This is even more likely to
happen with implicit cyclic dependencies such as those from Gerrit's
submitted-together feature (but can happen with any driver).
To aid users in this situation, report this situation back to the code
review system.
Change-Id: I26174849deab627b2cf91d75029c5a2674cc37d6
The gearman server in tests doesn't do anything anymore, therefore
these tests don't actually need to use it. Remove those references.
Change-Id: I48663a994647d6385a80d8c263c34ac8d9b8438f
Those tests are failing with multiple schedulers depending on which
scheduler completed the tenant reconfiguration first. As all assertions
are done on the objects from scheduler-0, they will fail if scheduler-1
completed the tenant reconfiguration first.
To make those tests work with multiple schedulers, we might want to wait
until all schedulers completed their reconfigs before doing the
assertions.
There are also a few test cases that don't rely directly on the results
of a tenant reconfiguration, but still use local tenant objects for
assertions. I assume that those tests are failing for the same reason -
because the tenant object used for the assertion is not up-to-date.
Change-Id: I4df816ec98f5fbab25cd412a5146f0f85d6d0138
Moving the re-enqueue step after a reconfiguration to the pipeline
processing phase allows us to re-enqueue multiple pipelines in
parallel in a multi-scheduler environment.
In case of a failure the re-enqueue can also be retried the next time
the pipeline is processed.
Change-Id: Iad483c37610b51d94ead72573c3540b1dea9ab84
With the persistent change cache in Zookeeper we need to periodically
remove changes that are outdated and no longer required by any active
item in the pipelines.
The cache maintenance will be performed together with the other general
cleanup every hour.
Change-Id: I62e75ab8c5b43f830e01b0e4c08b25ecdc5eed08
This is the second part of I5de26afdf6774944b35472e2054b93d12fe21793.
It uses the executor api.
Three tests are disabled until the next change.
Change-Id: Ie08fa9dfb4bb3adb9a02e0a2e8b11309e1ec27cd
Each scheduler in tests needs its own connection registries.
This change only affects tests.
Change-Id: I2ad188cf5a72c46f7486c23ab653ff574123308b
Story: 2007192
To improve consistency and remove `self.sched` and
use `self.scheds.first.sched` in all tests.
This change only touches tests.
Change-Id: I0a8c3f8ad634d1d88f3c68a11e4d5587993f4a0d
Story: 2007192
As a preparation for scale-out-scheduler the scheduler in tests
were extracted in order to start multiple instances in a previous
change.
This change continues on by introducing a manager to create
additional scheduler instances and the ability to call certain
methods on some or all of those instances.
This change only touches tests.
Change-Id: Ia05a7221f19bad97de1176239c075b8fc9dab7e5
Story: 2007192
Setup config will not set the base test config object rather return a new one.
This allows to setup multiple config objects which is needed in order to
instantiate mutliple schedulers enabling them to have different configs, e.g.
command socket.
Change-Id: Icc7ccc82f7ca766b0b56c38e706e6e3215342efa
Story: 2007192
This corrects the following errors.
Test fixture errors:
* Unlike the SSH API, the Gerrit REST API does not include
COMMIT_MSG in the list of files.
* We weren't checking all elements of the (change id, branch,
project) tuple when searching for change ids
* I observed a race around poll synchronization; I can't figure it out
so I've added more debug log lines.
Production errors:
* Break after the first successful submit rather than attemping the
call multiple times in all cases. This was non-fatal.
* Only attempt to get the remote version if using HTTP. This was
non-fatal.
* URLquote search queries (they may contain '#'). The additional CRD
tests cover this now.
* Coerce the list of files to a list rather than a dict_keys instance.
The new single file test covers this.
Change-Id: I89a68b2d189b82f0bc64e78fbc875d5628cc2cf0
This adds support for performing queries and git clones over HTTP
(reporting over HTTP was already supported). This will happen
automatically for any connection with a password configured.
Otherwise, the SSH connection will be used as before.
Change-Id: I11920a13615de103eb3d8fb305eacbbcb30e5e40
This change changes the dependency cycle error handling in order
to report the error to the user via the standard report mechanics.
Change-Id: I7cdbd9b7b48fd612b2887007b70acedd7a8e3113
The regex to detect Depends-On relations between Gerrit changes was recently
updated for the new URL schema. However because the change.uris attribute was
not also updated, getChangesDependingOn was not working, and the functionality
that this enables ("reverse" dependency processing, where a dependee change
triggers a test for an already-approved dependent) was not covered by the test.
Update the attribute and add test coverage.
Change-Id: I400445093beda390aa9ce19af31e50820f7c56df
Gerrit 2.16 change URLs look like:
"{baseurl}/c/{project}/+/{change_no}/". Update the regex so it matches those
too.
Suggested by tristanC on #zuul
Change-Id: I5eabe25bc26ce4a2d829b1a77d2023fd19c1068f
This patch aims to fix issue where such a depends-on won't match.
Depends-On: https://sftests2.com/r/#/c/1/
Indeed here Gerrit is hosted behind a reverse proxy under /r.
The regexp matching fail. Also the connection source lookup
may fail if Gerrit web interface is not connection.server or
connection.canonical_hostname so this path defines connection.baseurl
as a new lookup condition.
connection.baseurl is then used to build the regexp in order
to set the path prefix of the Gerrit ui.
Story: 2002080
Co-Authored-By: Nicolas Hicher <nhicher@redhat.com>
Change-Id: Ie764bfc814b821636d447f82147a7d76e0511d2f
Some folks may copy the URL out of their brower location field
rather than using the permalink when creating a Gerrit Depends-On,
so support that as well.
Change-Id: Ie35fde41befcb0c5c062fcc0417afeed1cf60a77
This corrects a false-positive in the dependency cycle detection,
but only for the new URL-style depends-on headers. It does not
do so for the legacy gerrit headers.
We used a single history list to store all the changes we enqueued
ahead of a given change, but this meant that if there was more
than one path to a change, we would see it in the history on the
second traversal. Instead, when traversing the tree, use copies
of the history list at each stage so that it can be rewound when
going back up the tree. The second path to a change will not
trip the cycle detection, and will proceed on to the point where
it notices the change is already in the queue and return harmlessly.
Also, check whether the exact change is in the history, not just
the number, since numbers are no longer unique with multiple sources.
Also, fix a bug in the test_crd_cycle test which was causing the
test to always pass since the changes were never enqueued due to
missing approval requirements.
Change-Id: I3241f90a1d7469d433cfa176e719322203d4d089
Story: 2001427
Task: 6133