Commit Graph

2006 Commits

Author SHA1 Message Date
William Braeckman
6075d7ec48 [IMP] runbot: improve has_pr button
Previously the has_pr button was a literal href which meant you couldn't
do both a search with the has_pr checked in a singular action.

Now the has_pr button acts as a checkbox (the real checkbox is hidden)
and basic support for keyboard controls has been added (tab, space and
enter).
2025-01-02 11:06:02 +01:00
William Braeckman
998163ee03 [IMP] runbot: add config_data to triggers
Adds support for config_data directly on the triggers.
This will be used to share configs between triggers with different
parameters.
2024-12-19 14:39:21 +01:00
William Braeckman
fbce7ae713 [IMP] runbot: add without-demo as field
Adds the without-demo flag as a field on config steps.
2024-12-19 14:39:21 +01:00
Xavier-Do
214ab338d5 [REV] runbot: lower sleep values"
Revert "[FIX] higher sleep values"

This reverts commit c562dac84d.

This was done before upgrading the postgresql serevr hardware. we should
be able to have faster updates now.
2024-12-19 08:43:33 +01:00
Xavier-Do
09b14e1702 [FIX] runbot: add timeout to request
For a strange reason, the runbot got stuck while updating a ci status.
The reason why it occurs know just after the upgrade is unknown, but
adding a timeout may help to mitigate this issue.
2024-12-16 16:23:50 +01:00
William Braeckman
881941988b [FIX] runbot: change md_description to html
Otherwise it doesn't output raw html.
2024-12-13 10:19:04 +01:00
William Braeckman
eacd2f369d [FIX] runbot: remove user_has_groups calls
The method was removed in odoo/odoo#151597
2024-12-13 08:45:42 +01:00
William Braeckman
33bef243d2 [FIX] runbot: export diff_match_patch
Fixes the export of diff_match_patch, it previously used global export
which is not supported anymore (at least not the way it was doing it
before).
2024-12-11 15:50:42 +01:00
William Braeckman
f847ba57e1 [FIX] runbot: crash with frontend_url widget 2024-12-11 15:50:42 +01:00
William Braeckman
9e1e686cc6 [FIX] runbot: restore form views
Since https://github.com/odoo/odoo/pull/154710 form views can use
<chatter/> directly to include the chatter, not doing so completely
breaks the dom generated by the form view.
2024-12-11 14:27:38 +01:00
William Braeckman
a7d09ddb5e [FIX] runbot: fix frontend urls to backend
Urls are broken after 18.0 upgrade
2024-12-11 14:27:38 +01:00
William Braeckman
03c0a5143e [FIX] runbot: replace old BS4 class with BS5
text-left -> text-start
remove data-toggle css rules
font-italic -> fst-italic
2024-12-11 14:27:38 +01:00
William Braeckman
28ce031886 [REF] runbot: replace t-esc with t-out
t-esc has been deprecated and uses redirects to t-out anyways, removing
since in dev mode it logs a warning in the terminal.

See odoo/odoo#81024
2024-12-11 14:27:38 +01:00
xdo
01e7676cb6 [FIX] runbot: revert some upgrade_code errors
Co-authored-by: William Braeckman (wbr) <wbr@odoo.com>
2024-12-11 14:27:38 +01:00
Xavier-Do
d30856107c [IMP] runbot: apply upgrade code 2024-12-11 14:27:38 +01:00
Xavier-Do
3d33448ad8 [FIX] runbot: fix query test 2024-12-11 14:27:38 +01:00
Xavier-Do
bb9242f49e [FIX] runbot: remove unaccent
see https://github.com/odoo/odoo/pull/139568
2024-12-11 14:27:38 +01:00
Xavier-Do
2b88938e14 [FIX] runbot: fix tests 2024-12-11 14:27:38 +01:00
Xavier-Do
8efc8874fe [FIX] runbot: adapt cron 2024-12-11 14:27:38 +01:00
Xavier-Do
aaf99dbe62 [FIX] runbot: adapt slug usage 2024-12-11 14:27:38 +01:00
Xavier-Do
ede1ef3c6a [FIX] runbot: addapt requirements 2024-12-11 14:27:38 +01:00
Xavier-Do
90d2906712 [IMP] runbot: remove ruff from default image
ruff is using another specific image, not useful anymore.
2024-12-11 09:57:03 +01:00
Xavier-Do
6bf1991c9d [FIX] runbot: make archive work when an error has no linked build 2024-12-10 10:45:38 +01:00
Xavier-Do
9c995d1f7c [FIX] runbot: add edition access to error content
This was forgotten during the refactoring. Needed to link error together
2024-12-10 10:45:38 +01:00
Christophe Monniez
f74391fc13 [FIX] runbot: avoid empty string in stored compute 2024-12-10 09:33:44 +01:00
Xavier Morel
2e107111f0 [ADD] runbot_merge: basic support for false positive detection
Adds a very limited ability to try and look for false positive /
non-determinstic staging errors. It tries to err on the side of
limiting false false positives, so it's likely to miss many.

Currently has no automation / reporting, just sets a flag on the
stagings which are strongly believed to have failed due to false
positives.

While at it, add link between a "root" staging and its splits. It's
necessary to clear the "false positive" flag, and surfacing it in the
UI could be useful one day.

Fixes #660
2024-12-09 16:02:28 +01:00
Xavier Morel
d6e1516f31 [IMP] runbot_merge: support arbitrary tunnel scripts
Rather than add individual tunnel methods to conftest, just allows
specifying a tunnel script and have that do whatever.

Protocol is uncomplicated: workers run the `$tunnel` with an arbitrary
port, script should create a tunnel to `localhost:$port`, print the
ingress of the tunnel to `STDOUT` with a terminating newline then
close `STDOUT`, and wait for `SIGINT` or `SIGTERM`, doing  whatever
cleanup they need when receiving either of those.

`ngrok` and `localtunnel` adapter scripts are provided out of the box,
though the ngrok one doesn't *really* work when using xdist without a
pre-spawned ngrok worker. Then again using xdist against github actual
is suicidal (because concurrency limits + rate limits) so likely
irrelevant.

Fixes #729
2024-12-09 16:02:28 +01:00
Xavier Morel
461db6a3e7 [ADD] runbot_merge: closing linked issues on merge
Requires parsing the commit messages as github plain doesn't collate
the info from there, but also the descriptions: apparently github only
adds those to the references if the PR targets the default
branch. That's not a limitation we want.

Meaning at the end of the day, the only thing we're calling graphql
for is explicit manual linking, which can't be tested without
extending the github API (and then would only be testable on DC), and
which I'm not sure anyone bothers with...

Limitations
-----------

- Links are retrieved on staging (so if one is added later it won't be
  taken in account).
- Only repository-local links are handled, not cross-repository.

Fixes #777
2024-12-09 16:02:28 +01:00
Xavier Morel
62fbda52a8 [IMP] runbot_merge: a PR can't be reopened if its batch is merged
In that case, ignore the reopen, close the PR, and tell the idiot to
fuck off.

Also the case where a PR is reopened while its batch is staged was
already handled, but probably not tested: it was implicit in
forcefully updating the HEAD of the PR, which triggers an unstage
since c8a06601a7.

Now that scenario is tested, which should lower the odds of breaking
it in the future.

Fixes #965
2024-12-09 16:02:28 +01:00
Xavier Morel
31f3edeea6 [IMP] runbot_merge: minor simplification of test_by_branch
Dedup' the application of statuses. Although it is somewhat slower do
keep applying them one by one to ensure all are required.
2024-12-09 16:02:28 +01:00
Xavier-Do
ee55c8c630 [FIX] runbot: add missing depends 2024-12-05 13:17:11 +01:00
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