Commit Graph

2025 Commits

Author SHA1 Message Date
Xavier-Do
4f3838b7e9 [FIX] runbot: fix bundle without batch display
In some case, when creating a bundle from the backend, it is possible
that the bundle has no batch at all, making _get_global_result() fail.
2024-12-05 09:09:52 +01:00
Christophe Monniez
58f0f8108a [FIX] runbot: import json for similar_ids
And small fix in fstring.
2024-12-04 11:03:41 +01:00
Xavier-Do
03a20398a1 [IMP] runbot: add forwarded for headers 2024-12-04 10:18:43 +01:00
Xavier-Do
c45f1a2dd6 [IMP] runbot: add qualifiers ir.model.fields 2024-12-04 10:17:21 +01:00
Christophe Monniez
65f2badd09 [IMP] runbot: add similar errors page
Add a page on error content showing errors with similar qualifiers.
2024-12-04 10:17:21 +01:00
Christophe Monniez
4bdd2e20b8 [IMP] runbot: permit to qualify build errors
Identifying build errors by fingerprint is not enough.
Most of the times we want to link build errors based on some criteria.

With this commit, a build error can be qualified by using regular
expressions that will extract informations.

Those informations will be stored in a jsondict field. That way, we can
find simmilar build errors when they share some qualifiers.

To extract information, the regular expression must use named group
patterns.

e.g:
`^Tour (?P<tour_name>\w+) failed at step (?P<tour_step>.+)`

The above regular expression should extract the tour name and tour step
from a build error and store them like:
`{ "tour_name": "article_portal_tour", "tour_step": "clik on 'Help'" }`

The field can be queried to find similar errors. Also, a button is added
on the Build Error Form to search for errors that share the same
qualifiers.
2024-12-04 10:17:21 +01:00
Xavier Morel
509c152156 [IMP] *: modernise tests via to_pr
The `to_pr` helper was added a *while* ago to replace the pretty
verbose process of looking a PR with the right number in the right
repository after a `make_pr`. However while I did some ad-hoc
replacement of existing `search` calls as I had to work with existing
tests I never did a full search and replace to try and excise searches
from the test suite.

This is now done. I've undoubtedly missed a few, but a hundred-odd
lines of codes have been simplified.
2024-12-02 16:32:53 +01:00
Xavier Morel
83e588d7fe [FIX] runbot_merge: dropdowns for bs5
BS5 namespaced the data-attributes it uses to trigger JS
behaviours. So for dropdowns `@data-toggle` doesn't do anything
anymore, one has to use `@data-bs-toggle`. Missed that while testing
the migrations.

Also seems like `@aria-expanded` was misapplied when I added the
dropdowns:

> When a menu is displayed, the button object that toggles the
> visibility of that menu has aria-expanded="true" set. When the menu
> is hidden, aria-expanded can be omitted. If specified when the menu
> is hidden, it should be set as aria-expanded="false".

Since the dropdowns are hidden by default, the button should be
`@aria-expanded="false"`.
2024-12-02 16:32:53 +01:00
Xavier Morel
876ec92059 [IMP] runbot_merge: add quick link projects on the main dashboard
As the number of projects is starting to grow pretty large, provide
quick links and stable jump targets for projects on the home page /
main dashboard.

Fixes #991
2024-12-02 16:32:53 +01:00
Xavier Morel
679d556c90 [FIX] project creation: handling of mergebot info
- don't *fail* in `_compute_identity`, it causes issues when the token
  is valid but doesn't have `user:email` access as the request is
  aborted and saving doesn't work
- make `github_name` and `github_email` required rather than ad-hoc
  requiring them in `_compute_identity` (which doesn't work correctly)
- force copy of `github_name` and `github_email`, with o2ms being
  !copy this means duplicating projects now works out of the box (or
  should...)

Currently errors in `_compute_identity` are reported via logging which
is not great as it's not UI visible, should probably get moved to
chatter eventually but that's not currently enabled on projects.

Fixes #990
2024-12-02 16:32:53 +01:00
Xavier Morel
38c2bc97f3 [IMP] runbot_merge: inspectability of patch parsing
Show patch metadata on the patch screen, so it's easier to understand
what the parser sees in case of issues.

Behaviour is not *entirely* consisten, `file_ids` is correctly set but
it looks like during the initial `web_read` it gets stripped out in at
least some cases and the files list is empty even though files have
been found in the patch. nm.

Fixes #987
2024-12-02 16:32:53 +01:00
Xavier Morel
7f7589c50e [FIX] runbot_merge: normalisation of patches before parsing
- Apparently if a user is on windows the ACE editor can swap out their
  line end from unix to windows. The patch parsers were predicated
  upon all patches being in unix mode (because git, and diff).

  Fixup both parsers to convert windows-style line end to unix before
  trying to parse the patch data. Also add a few fallbacks to limit
  the odds of an unhelpful `StopIteration` (though that might hide
  errors more than reveal them...)
- Make sure we support `format-patch --no-signature`, just requires
  using the correct partition direction: I assume I used `rpartition`
  as a form of micro-optimisation *but*

  - If the separator is not found the "patch body" ends up in the
    third parameter rather than the first, which makes the fallback
    difficult.
  - There doesn't seem to be anything preventing *multiple* signature
    separators in a message, and logically the first one should hold
    and the rest is all part of the signature.

  As a result, for both reasons we need to look *forwards* for the
  signature separator, not backwards. Hence `str.partition`.

Fixes #992
2024-12-02 16:32:53 +01:00
Xavier Morel
749382a1e7 [REM] runbot_merge: freeze wizard auto-refresh
Turns out to not work well in 17.0, and after consideration moc hasn't
really used the auto-update feature (or the required-prs gate in
general to be honest), usually he knows what PRs he's waiting for and
only validates once he's confirmed every which way.

So it's probably not worth fixing the thing. According to jpp, this
should probably use something based on bus subscriptions to update
just the field (though tbf the `root.update` call doesn't really seem
to be "deep" anymore, so in reality rather than update the *form*'s
record I should probably have tried reloading the required_pr_ids
records to fetch the new color).

Closes #997
2024-12-02 16:32:53 +01:00
William Braeckman
075e6a99b0 [FIX] runbot: remove dead code
The template part was not reached only in certain cases and regardless
the empty collapse toggle has not been visible for a while..
As handling subbuild error logs adds unnecessary load when rendering the
page anyways (most people will not display the subbuild errors
regardless if the collapse is showing or not), we decided to remove it
completely.
2024-11-29 09:31:17 +01:00
William Braeckman
85e6b7a312 [REF] runbot: stop using link type ir.logging
Stop using the special $$icon$$ syntax when logging the download url for
the database dump.
2024-11-28 16:25:11 +01:00
Xavier-Do
07fda301a0 [FIX] runbot: pass build in error in case of log critical 2024-11-28 14:42:46 +01:00
William Braeckman
7b2ca7b919 [IMP] runbot: show state in favicon
Until now the favicon was handled by the `/favicon.ico` route made
available by `website`.

This commit adds the different favicons and logic to be able to display
the state of the current page through it.
2024-11-28 14:22:25 +01:00
Xavier-Do
b76a523730 [IMP] runbot: faster batch prepare 2024-11-28 14:12:42 +01:00
Christophe Monniez
0beb2cd71b [IMP] runbot: remove error logs menu 2024-11-28 13:43:40 +01:00
Christophe Monniez
f3c7212b7c [IMP] runbot: add responsible in error list view 2024-11-28 13:43:40 +01:00
Christophe Monniez
9d5b31fe18 [IMP] runbot: add a deduplicate server action
Duplicate error content should not happens ... but it does.
With this commit, a server actions allows to relink error contents and
thus removes error contents having the same fingerprint.
2024-11-28 13:43:40 +01:00
Christophe Monniez
3a485536fd [IMP] runbot: rename _merge method into _relink on error_content 2024-11-28 13:43:40 +01:00
Xavier-Do
0768d9c797 [IMP] runbot: optimize build error content merging 2024-11-28 13:43:40 +01:00
Christophe Monniez
96eb116ead [FIX] runbot: refactor error content merge 2024-11-28 13:43:40 +01:00
Christophe Monniez
60f7f195bf [IMP] runbot: find duplicate error contents 2024-11-28 13:43:40 +01:00
Christophe Monniez
276b43b729 [IMP] runbot: add possibility to search fingerprints 2024-11-28 13:43:40 +01:00
Christophe Monniez
34ed682a79 [FIX] runbot: bind the link error content action to the right model 2024-11-28 13:43:40 +01:00
Christophe Monniez
a82a995397 [IMP] runbot: add a message when a build error is merged
When digging into deactivated build errors, one cannot easily find why
an error was deactivated and to which one it was merged.

With this commit, a message is added in the chatter to explain where it
is merged.
2024-11-28 13:43:40 +01:00
William Braeckman
57bd762d9c [IMP] runbot: make computable fields searchable
Adds search functions for all 'related' computed fields on
runbot.build.error.
2024-11-28 13:40:16 +01:00
William Braeckman
b8d39471cc [IMP] runbot: add tracking on config steps modules 2024-11-28 13:39:48 +01:00
William Braeckman
ab0c95dac2 [IMP] runbot: add mail.thread to upgrade exception
Makes it easier to track when to remove upgrade exceptions.
2024-11-28 13:39:48 +01:00
William Braeckman
833b4e29d0 [IMP] runbot: add configurable process delay
Adds a configurable process delay on projects.
It can be used to reduce or otherwise increase the time between a push
and a batch starting.
2024-11-27 11:18:16 +01:00
Christophe Monniez
22151d3566 [FIX] runbot: fix log args
Previous fix was not enough when one of the args is not a string.

Courtesy of xmo
2024-11-26 09:13:05 +01:00
William Braeckman
ec440e61f7 [FIX] runbot: prevent crash with invalid exception 2024-11-26 09:12:30 +01:00
Xavier-Do
08016333fe [FIX] runbot: fix displayed log linked error 2024-11-26 09:04:43 +01:00
Xavier-Do
113f87dee2 [FIX] runbot: avoid duplicate ouptut because of Download progress 2024-11-26 09:04:43 +01:00
Xavier-Do
e6605dfaef [IMP] runbot: get docker metadata after build
The docker metadata are currently computed only on
some images durring the nightly.

This aims to get metadata after each docker image build in order to be
able to rely on them when needed.
2024-11-26 09:04:43 +01:00
Xavier Morel
8c70e44ae9 [IMP] runbot)merge: 17.0 migration
`runbot_merge.patch` is a mail.thread model added since the last
migration attempt, see 36786d51c8
2024-11-21 15:47:09 +01:00
Xavier Morel
0106d7539f [MERGE] mergebot updates (again)
Can't be arsed to rebase and re-resolve the conflicts, so remerge
instead.
2024-11-20 13:19:46 +01:00
Xavier Morel
bf4cc09aa4 [IMP] reporting if creating template DB fails
Before this, if creating the DB failed the next worker would find
themselves with an empty `template-` file, so they would take the path
to *create* a template database, which would fail when trying to
`mkdir` the `shared-` directory as the directory would already exist.

The problem with this is this module would likely immediately fail and
take down their worker, triggering a test suite failure for themselves
and likely hiding the *true* failure cause (not sure why the
originally failed worker isn't the first one to trigger a failure but
there you go).

By skipping the tests instead, we provide a lot more opportunity for
the "true" failure to be revealed.
2024-11-20 12:43:43 +01:00
Xavier Morel
bf20127da9 [FIX] runbot_merge: tracked value ordering
Apparently in odoo 17.0 tracking values are always ordered by field
name.
2024-11-20 12:40:15 +01:00
Xavier Morel
31c13ca9a0 [FIX] runbot_merge: attrs not supported in 17.0
Basically the next part of aa1df22657
which requires replacing @attrs by the corresponding attribute &
python predicates: new attrs were added to 15.0 since.
2024-11-20 12:38:57 +01:00
Xavier Morel
1f83007675 [FIX] runbot_merge: global acl removed on subtype access
Because of tracking, `test_patch_acl` needs access to message subtypes
during patch creation. If the user *only* has
`runbot_merge.group_patcher` or `runbot_merge.group_admin` they don't
have any of the "core" user groups (public, portal, internal) and thus
don't have access to mail subtypes.

Fix that by having the runbot_merge groups imply being an internal
user.
2024-11-20 12:35:19 +01:00
Xavier Morel
acaf605472 [FIX] runbot_merge: implement __contains__ in test proxy model
`read_tracking_value` likely never worked correctly in both branches,
but worked in 15.0 because the failures to do anything useful happened
to end in the right case?
2024-11-20 12:34:02 +01:00
Xavier Morel
3d33d0406e [FIX] runbot_merge: tracking author is already a res.partner
Not sure why it didn't break tests in 16...
2024-11-20 12:33:00 +01:00
Xavier-Do
36b35b6711 [FIX] runbot: test upgrade for dev branches again 2024-11-20 08:32:18 +01:00
Xavier Morel
0a17454838 [MERGE] runbot_merge, forwardport: latest updates
Got a bunch of updates since the initial attempt to migrate the
mergebot before the odoo days.
2024-11-20 08:05:41 +01:00
Xavier Morel
667aa69f5b [FIX] runbot_merge, forwardport: create_single is deprecated
Update a bunch of `create` overrides to work in batch. Also fix a few
`super()` calls unnecessarily in legacy style.
2024-11-19 15:09:01 +01:00
Xavier Morel
c7523c0429 [MERGE] runbot_merge, forwardport: latest updates
Got a bunch of updates since the initial attempt to migrate the
mergebot before the odoo days.
2024-11-19 12:18:59 +01:00
Xavier Morel
c4bdb75d9c [FIX] runbot_merge: EmailMessage.get_content misbehaves
`get_content` round-trips the text part through `ascii` with
`error=replace`, so if the input is not ascii it screws up
tremendously, which leads to either failing to apply patches (the more
likely situation) or corrupting the patches.

`get_payload`, if called without `decode`, pretty much just returns
the payload unless it needs a decoding pass (e.g. because it contains
raw surrogates, but that should not be an issue for us). So this is
really what we want.

While at it, increase `patch`'s verbosity in case it can give us more
info.
2024-11-19 11:22:25 +01:00