runbot/runbot_merge/models
Xavier Morel dd17730f4c [IMP] *: crons tests running for better triggered compatibility
Mergebot / forwardport crons need to run in a specific ordering in
order to flow into one another correctly. The default ordering being
unspecified, it was not possible to use the normal cron
runner (instead of the external driver running crons in sequence one
at a time). This can be fixed by setting *sequences* on crons, as the
cron runner (`_process_jobs`) will use that order to acquire and run
crons.

Also override `_process_jobs` however: the built-in cron runner
fetches a static list of ready crons, then runs that.

This is fine for normal situation where the cron runner runs in a loop
anyway but it's any issue for the tests, as we expect that cron A can
trigger cron B, and we want cron B to run *right now* even if it
hadn't been triggered before cron A ran.

We can replace `_process_job` with a cut down version which does
that (cut down because we don't need most of the error handling /
resilience, there's no concurrent workers, there's no module being
installed, versions must match, ...). This allows e.g. the cron
propagating commit statuses to trigger the staging cron, and both will
run within the same `run_crons` session.

Something I didn't touch is that `_process_jobs` internally creates
completely new environments so there is no way to pass context into
the cron jobs anymore (whereas it works for `method_direct_trigger`),
this means the context values have to be shunted elsewhere for that
purpose which is gross. But even though I'm replacing `_process_jobs`,
this seems a bit too much of a change in cron execution semantics. So
left it out.

While at it tho, silence the spammy `py.warnings` stuff I can't do
much about.
2024-08-02 09:00:34 +02:00
..
crons [IMP] *: crons tests running for better triggered compatibility 2024-08-02 09:00:34 +02:00
project_freeze [CHG] forwardport: perform forward porting without working copies 2024-07-08 14:37:14 +02:00
staging_cancel [ADD] runbot_merge: stagings canceling wizard 2022-12-08 10:46:22 +01:00
__init__.py [ADD] *: per-repository webhook secret 2024-06-06 11:07:57 +02:00
batch.py [IMP] runbot_merge: move inconsistency block higher in batches 2024-07-24 12:35:21 +02:00
commands.py [IMP] *: convert fw=no to a genuine forward-porting policy 2024-06-28 16:06:20 +02:00
events_sources.py [ADD] *: per-repository webhook secret 2024-06-06 11:07:57 +02:00
ir_actions.py [IMP] runbot_merge: add json & requests to server actions context 2023-02-20 10:13:05 +01:00
project.py [ADD] *: per-repository webhook secret 2024-06-06 11:07:57 +02:00
pull_requests.py [FIX] *: don't send merge errors to logging 2024-07-26 14:48:59 +02:00
res_partner.py [ADD] runbot_merge: ad-hoc ACL tracking to res.partner 2024-05-16 09:32:03 +02:00
stagings_create.py [FIX] *: don't send merge errors to logging 2024-07-26 14:48:59 +02:00
utils.py [ADD] runbot_merge: rendering of PR descriptions 2024-07-15 10:28:28 +02:00