runbot/runbot_merge/models
Xavier Morel e6057afde7 [FIX] runbot_merge: handle missing patch commits
Commits can take some time to propagate through the network (I guess),
or human error can lead to the wrong commit being set.

Either way, because the entire thing was done using a single fetch in
`check=True` the cron job would fail entirely if any of the patch
commits was yet unavailable.

Update the updater to:

- fallback on individual fetches
- remove the patch from the set of applicable patch if we (still)
  can't find its commit

I'd have hoped `fetch` could retrieve whatever it found, but
apparently the server just crashes out when it doesn't find the commit
we ask for, and `fetch` doesn't update anything.

No linked issue because I apparently forgot to jot it down (and only
remembered about this issue with the #1063 patching issue) but this
was reported by mat last week (2025-02-21) when they were wondering
why one of their patches was taking a while:

- At 0832 patch was created by automated script.
- At 0947, an attempt to apply was made, the commit was not found.
- At 1126, a second attempt was made but an other patch had been
  created whose commit was not found, failing both.
- At 1255, there was a concurrency error ("cannot lock ref" on the
  target branch).
- Finally at 1427 the patch was applied.

All in all it took 6 hours to apply the patch, which is 3-4 staging
cycles.
2025-02-25 14:38:15 +01:00
..
backport [FIX] *: double forwardport when adding a PR to an existing batch 2025-02-11 14:27:53 +01:00
crons [IMP] runbot_merge: auto-trigger cron for issue closing 2024-12-16 09:11:19 +01:00
ir_cron [IMP] runbot_merge: add cron trigger button 2025-02-18 11:45:56 +01:00
project_freeze [REM] runbot_merge: freeze wizard auto-refresh 2024-12-02 16:32:53 +01:00
staging_cancel [ADD] runbot_merge: stagings canceling wizard 2022-12-08 10:46:22 +01:00
__init__.py [IMP] runbot_merge: add cron trigger button 2025-02-18 11:45:56 +01:00
batch.py [FIX] *: double forwardport when adding a PR to an existing batch 2025-02-11 14:27:53 +01:00
commands.py [IMP] mergebot: improve command line 2025-02-20 14:06:47 +01: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
ir_ui_view.py [IMP] runbot_merge: suppress view validation warning 2024-09-27 12:53:51 +02:00
mail_thread.py [MERGE] bot from 16.0 to 17.0 2024-08-12 13:13:03 +02:00
patcher.py [FIX] runbot_merge: handle missing patch commits 2025-02-25 14:38:15 +01:00
project.py [FIX] project creation: handling of mergebot info 2024-12-02 16:32:53 +01:00
pull_requests.py [IMP] runbot_merge: add optional statuses on PRs 2025-02-25 09:50:45 +01:00
res_partner.py [MERGE] bot from 16.0 to 17.0 2024-08-12 13:13:03 +02:00
stagings_create.py [IMP] runbot_merge: make space characters in regexes clearer 2025-01-24 14:53:47 +01:00
utils.py [FIX] runbot_merge: reset markdown renderer 2024-10-29 13:13:59 +01:00