runbot/forwardport
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
..
changelog [ADD] *: changelog entries I forgot 2023-08-14 09:28:19 +02:00
data [IMP] *: crons tests running for better triggered compatibility 2024-08-02 09:00:34 +02:00
migrations [CHG] *: rewrite commands set, rework status management 2024-05-23 07:58:46 +02:00
models [IMP] *: crons tests running for better triggered compatibility 2024-08-02 09:00:34 +02:00
tests [FIX] *: stray prints 2024-08-02 08:59:45 +02:00
__init__.py [ADD] mergebot, forwardbot: changelog 2021-10-20 15:16:48 +02:00
__manifest__.py [CHG] *: rewrite commands set, rework status management 2024-05-23 07:58:46 +02:00
controllers.py [FIX] forwardport: count next to users should be the fwport 2024-06-28 08:18:34 +02:00