Commit Graph

1315 Commits

Author SHA1 Message Date
Xavier Morel
1dcab0744d [IMP] runbot_merge: remove dead code
apparently at one point I wanted to provide an atom feed or something
2022-06-02 12:55:22 +02:00
Xavier Morel
48c9754906 [IMP] runbot_merge: acknowledge check command
The command works, but the 'bot would always reply it was not allowed
2022-06-02 12:55:22 +02:00
Xavier-Do
3071f5a6db [IMP] runbot: adapt for odoo 15.0 2022-06-02 10:50:42 +02:00
Xavier-Do
91d176f561 [FIX] runbot: fix pull_info_failures 2022-03-30 08:11:45 +02:00
Xavier-Do
78f050b132 [IMP] runbot: adapt for 14.0 2022-03-23 09:49:53 +01:00
Xavier-Do
eda014f724 [DEL] runbot: remove old upgrade scripts 2022-03-18 11:09:58 +01:00
Xavier-Do
8c120ac0d9 [FIX] runbot: don't log invalid bases on autorebase 2022-03-17 09:30:03 +01:00
Xavier-Do
c4d0b56972 [FIX] runbot: dont duplicate export
Even if it isn't really problematic, avoiding to duplicate exports
will make the table slighly smaller, especially when considering running
builds.
2022-03-16 09:44:58 +01:00
Xavier-Do
3985332a34 [IMP] runbot: commit exports
Source cleanup will check in multiple place for potentially used
commits. This maked the cleanup logic complex, plus limit the usable
commits in python steps. The current use case is to export the mergebase
commits.

The poposed solution is to save the exported commit and clean this list
when the build is done. All commit in this list cannot be cleaned.
2022-03-16 09:05:39 +01:00
Xavier-Do
ea3191a8d0 [IMP] runbot: add javascript support for JsonDictFields
The main motivation is to be able to see existing config_data on params
and edit configuration on triggers.

A simple version would be to use the `FieldChar` with a simple
`JSON.stringify` formater, but having some indent on field make it
easier to read and edit.

The multiline need make it closet to the `FieldText` than the `FieldChar`
but the reset makes the browser freeze.
2022-03-14 15:27:11 +01:00
Xavier-Do
623255b0d8 [IMP] runbot: reorganize menus
and add missing fields...
2022-03-11 15:12:36 +01:00
Xavier-Do
45cc0b1675 [REF] runbot: remove useless names 2022-03-11 15:12:36 +01:00
Xavier-Do
ca8ee428f8 [REF] runbot: move all menu to a single file 2022-03-11 15:12:36 +01:00
Xavier-Do
4e6ae00f23 [IMP] runbot: custom trigger wizard
The actual way to add a custom multibuild on a dev bundle will be:
- use the multibuild wizard to create 2 configs and 2 steps
- add this config on the bundle
- customize this config to make it fatser by installing/restoring...

The usefull parameters are the number of build, the test tags and
modules to install.

Another usefull operation is to restore a dump instead of installing,
especially for post install test only breaking on full databases.

This commit proposes to replace the multi build wizard with a custom
trigger wizard. The main idea is to have generic config, parametrized by
config_data. The wizard will only help to generate the corresponding
config_data.
2022-03-11 14:00:47 +01:00
Xavier Morel
2337bd8518 [FIX] forwardport: chain crash on insert in forward-port cron
On two of the freezes, thereafter the logs showed serial crashes in
the forwardport cron when trying to find the insertion point for a new
forward-port.

The first time was not really diagnosed, the second time the cause was
found to be a retargeted PR which led to a failure of the "insertion"
forward port, which did not take that possibility in account (it
assumed -- sensibly I believed -- that an intermediate FP following a
branch insertion would always succeed, sadly the malevolent universe
had other plans).

So only insert the new forward port inside its sequence (if necessary)
if the forward port actually succeeded, otherwise ignore it.

Fixes #551
2022-02-10 13:51:33 +01:00
Xavier Morel
2898c7edd4 [FIX] runbot_merge: updating of commit date on rebase
On #509, the rebasing process was changed to forcefully update the
commit date of the commits, in order to force trigger builds.

However when squashing was re-enabled for #539 for some fool reason it
implemented its own bespoke rebasing (despite that not actually saving
any API call that I can see), meaning it did *not* update the commit
date. As such, an old commit being squashed would not get picked up by
the runbot, which is what happened to odoo/documentation#1226 (which
ultimately had to be hand-rebased after some confusion as to why it
did not work).

Update `_stage_squash` to go through `rebase` the normal way, also
update `rebase` to pop the commit date entirely instead of setting it
manually, and update the squashing test to check that the commit date
gets properly updated.

Fixes #579, closes #582
2022-02-10 13:51:08 +01:00
Xavier Morel
2285965e22 [MRG] runbot_merge, forwardport: multiple fixes to freeze wizard
Multiple fixes to various issues of the freeze wizard.

Some of the less fix-oriented sub-tasks were moved to #586 for discussion instead.

Closes #559, #587
2022-02-10 13:50:21 +01:00
Christophe Monniez
a931af2fed [IMP] runbot: fully garbage collect old builds
When a build is garbage collected and the local folders are cleaned, the
log files are kept to allow build errors investigations.

With this commit, a full local cleanup will be done 365 days after the
garbage collect.  This means that the build dir will be completely
removed.  The default number of days can be tweaked with the
`runbot.full_gc_days` ir.config_parameter.

Also, the _local_cleanup method can be called with a `full` boolean
parameter to force a full cleanup. e.g.: when called in a config step.

While at it, the res_config_settings view is a bit reorganized.
2022-02-10 13:39:50 +01:00
Christophe Monniez
2f7c752793 [FIX] runbot: avoid hook_time update on builders 2022-02-10 13:39:18 +01:00
Xavier Morel
de70bd6f83 [IMP] runbot_merge: show PR titles in freeze wizard
Currently limited to release/freeze PRs: it can be difficult to be
sure the right PR was selected then, and a mistake there seems more
impactful than in the PRs being waited for?

Note: adds a test to make sure I don't break the check that all
      release PRs must have the same label (be linked). This was
      already safe, and in a way this PR adds convenience but not
      really safety, but better sure than sorry.
2022-02-08 12:28:10 +01:00
Xavier Morel
e05cc77a57 [FIX] forwardport: don't forwardport freeze PRs
The freeze wizard has support for merging freeze / release PRs on each
of the newly created branches. But since this would be done by, well,
merging, those PRs would get forward-ported to master, and would have
to be closed there.

This creates additional work for the freeze master, and noise /
parasitic PRs.

Obviously it's possible for the freeze master to set some nonsense `up
to` (nonsense because the "real" limit doesn't exist yet at that
point), but really it never makes any sense to forward port release
PRs, so the wizard should do it.
2022-02-08 10:11:57 +01:00
Xavier Morel
e2887a7473 [IMP] runbot_merge: allow only freezing a subset of a project
- add flag to not select repos for freezing
- allow removing more repositories from the wizard
- when performing the freeze, only create branches for the selected
  repos
2022-02-07 15:15:13 +01:00
Xavier Morel
1add3d4854 [FIX] runbot_merge: freeze being triggered upon reopening the wizard
The freeze wizard was implemented using a single action to open and
validate the dialog.

This was a mistake, as it means if there are no errors left (e.g. all
the PRs being waited for are now validated) trying to view the freeze
wizard will immediately validate it and commit the freeze, which is
unexpected, surprising, and unsafe e.g.

- open wizard
- add freeze prs
- add a required pr or two
- close and go do something else
- be told that more PRs need to be waited for
- reopen wizard
- oops freeze is done

So split the "open action" part of `action_freeze` into opening the
action and performing the freeze. The "freeze" / "view freeze" button
on the project only activates the latter, and the actual freeze
operation is only triggered from the wizard's "Freeze" button.

Part of #559.
2022-02-07 13:23:41 +01:00
Xavier-Do
ea5feb114a [FIX] runbot: fix codowner match 2022-02-07 13:03:26 +01:00
Xavier-Do
2c29a6b94b [IMP] runbot: add validation for domain 2022-02-07 09:31:19 +01:00
Xavier-Do
ebb342ea0c [IMP] runbot: link on reference batch 2022-02-07 08:59:28 +01:00
Xavier Morel
8e8a238a66 [FIX] forwarport: mark branches as fp-targets by default
otherwise the freeze wizard gets very confused
2022-02-07 08:10:03 +01:00
Xavier Morel
4c8ab63af8 [REM] runbot_merge: leftover debug print
Found by @d-fence
2022-02-07 08:08:59 +01:00
Christophe Monniez
ffd432311f [FIX] runbot: removing failed git export
When a git archive fails, the partially exported source tree is left in
place. If another builds tries to use the same commit, the tree is not
exported anymore as the directory exists. This leads to non
deterministic behaviors.
2022-01-27 10:19:54 +01:00
Xavier-Do
8cdb8c9e5b [FIX] runbot: small fixed to ease deployment 2022-01-27 10:08:39 +01:00
Christophe Monniez
ec2f12ef5f [FIX] runbot: manage or in debian/controll
Since odoo/odoo@3d6043a735
the controll file can contain fallbacks `dep1 | dep2 | dep3`.
Taking the first column will work in most cases.

closes #573
2022-01-27 10:08:39 +01:00
Xavier-Do
de84882a07 [IMP] runbot: add a build search page
Quick prototype to find similar builds, especially usefull for nighlty
to list history of some subbuild.
2022-01-27 09:59:33 +01:00
Xavier-Do
dde70ffeb2 [FIX] runbot: add missing chart js 2022-01-18 09:18:31 +01:00
Xavier-Do
b5d01797cb [IMP] runbot: add single branch repo
Right now single version repo like upgrade are managed using
a regex to limit name prefix, this avoid grouping branches when
mergebot wont be able to merge them together but the ci can be painfull
since the branch needs to be renamed (closing existing pr) or a manual
operation to move the branch into a new bundle must be performed.
This commit proposes to replace the forbidden_regex mechanism with
an explicit single_version mechanism.
In this case the reference name will be automatically prefixes with
the version. The prefix contains `---` to indicate that some
magic was applied.
2022-01-11 15:14:08 +01:00
Xavier-Do
6a72b7f96f [IMP] runbot: style death branche (github menu) 2022-01-11 09:11:48 +01:00
Xavier-Do
9a3c11b09f [IMP] runbot: use custom layout and improve views
Runbot layout modifies the website/portal base layout to remove navbar,
footer, overides some custom styles. A lot of assets are loaded but not
used. The only real usefull elements are base assets (bootstrap, ...)
and the login button.

Migrating to the next version of odoo is usually painfull because some
xpath may break, extra element added, or some style change may break the
page, needing to add more and more xpath, css rules, ... for very little
benefits.

This cleanup creates a custom base layout for runbot independant from
base odoo templates.

Also add a breadcrumb, navigation arrow, and improve batch links
2022-01-11 09:11:48 +01:00
Xavier-Do
460e26bafc [IMP] runbot: add populated data 2022-01-11 09:11:48 +01:00
Xavier-Do
fe7c90f889 [FIX] runbot: fix typo 2022-01-11 09:11:48 +01:00
Xavier-Do
fe987cd0f3 [IMP] runbot: some fixes for ps runbot
- searching on number will search for both pr and branche name
- hooks are now using payload to define repo when not given in url
- fixes .git cleaning in repo
    (remove rstrip since it can fail for repo starting with g, i, t)
- recompute base on prepare if base was not found
- remove local_result form write values if there is a single record
    (instead of raising, makes python step easier to write).
- avoid stucked build/loop after removing a step from a config.
- avoid to send ci for linked base_commit
- add a fallback mechanism for base if no master branch is found
- add option on project to avoid to keep sticky running, usefull
    when using a lots of projects
    WARNING: this is a change of default behaviour, need to update
    existing projects.
- always discover new commits for branch matching base paterns.
    This is especially usefull to discover old versions on project with
    low merge frequency.
- always create a batch, event if there is now trigger. This helps to
    notice that commits are discovered
- add line-through on death branches/pr
- manual trigger are now displayed on main page
2022-01-10 15:19:44 +01:00
Xavier-Do
d8b96db1b7 [IMP] runbot: limited height on tiles 2021-12-08 15:06:49 +01:00
Xavier-Do
ee715360ff [FIX] runbot: avoid docker state UNKNOWN after slow fetch 2021-12-08 15:06:49 +01:00
Xavier-Do
e22c403102 [IMP] runbot: avoid concurrent write and useless still in use messages 2021-12-08 15:06:49 +01:00
Xavier-Do
0b30b9c104 [IMP] runbot: create a separate process for cron
As for the builder, this give the ability to run the discovery of new
commits and all related logic in a separate process.

This will mainly be usefull to restart frontend without waiting for cron
or restart "leader" without stoping the frontend. This will also be
usefull for optimisation purpose.
2021-12-08 15:06:49 +01:00
Martin Trigaux
ede5384607 [IMP] forwardport: add missing space
Instead of "[FW]Create README.md", the forwardport PR is now named
"[FW] Create README.md"
2021-12-03 16:03:08 +01:00
Christophe Monniez
91efbec943 [IMP] runbot: add a codeowner model
As a custom codeowner system was successfully implemented in a python
step on our runbot instance, it's now time to have a real model for
that.

This commit adds a skeleton Codeowner model in order to be used for a
basic usage.

This should be improved in the future after some battle testing.
2021-11-25 15:19:26 +01:00
Christophe Monniez
89dcb52215 [IMP] runbot: add a runbot team model
With the increasing usage of runbot to test various things and to take
care of random bugs in tests, the need of a team dashboard arose.

This commit adds a `runbot.team` model. Internal users can be
linked to the team. Module wildcards can be used to automatically assign
build errors to a team at 'build.error` creation.

Also, an upgrade exception can be assigned to a team in order to display
it on a dashboard.

A dashboard model is used to create custom dashboards on the team
frontend page. By default, a dashboard is meant to display a list of
failed builds. The failed builds are selected by specifying a project, a
trigger category (e.g. nightly), a config and a domain (which select
failed builds by default).

The dashboard can be customized by specifying a custom view.

Each created team has a frontend page that displays all the team
dashboards and the errors assigned to the team.

A few other improvement also come with this commit:

 * The cleaned error is now in a tab on the build error form
 * Known errors are displayed as "known" on the build log page
 * The build form shows the config used for the build
2021-11-25 15:19:26 +01:00
Xavier-Do
2bbe346e75 [FIX] runbot: only use normal builds to display stats 2021-11-25 09:42:55 +01:00
Xavier-Do
b252800205 [IMP] runbot: add sum on stats 2021-11-25 09:42:55 +01:00
Xavier Morel
8c11db21a2 [FIX] forwardport: merge error message change in git
Apparently 2.34:

* flipped around the "auto-merging" and "CONFLICT" messages on stdout,
  so just match the second one with wildcards around to ignore the
  location of the first
* changed the casing and content of everything after the `error` line
  on stderr, so just ignore it all (none of it's actually useful
  anyway)
2021-11-18 08:20:50 +01:00
Xavier Morel
4da0f5df69 [ADD] runbot_merge: ~~tree~~ freeze wizard
Provides a less manual interface for creating the freeze:

* takes the name of the branch to create
* takes any number of PRs which must be part of the freeze
* takes PRs representing the HEADs of the new branches

Then essentially takes care of the test.

Implementation of the actual wizard is not trivial but fairly
straightforward and linear, biggest issue is not being able to
`project_id.branch_ids[1]` to get the new branch, not sure why but it
seems to ignore the ordering, clearing the cache doens't fix it.

When creating the branches, add a sleep after each one for secondary
rate limiting purposes. Same when deleting branches.

Also the forwardbot has been updated to disable the forwardport cron
while a freeze is ongoing, this simplifies the freezing process.

Note: after recommendation of @aab-odoo, tried using `_applyChanges`
in `_checkState` but it simply did not work: the two relational fields
got completely frozen and were impossible to update, which is less
than ideal. Oh well, hopefully it works well enough like this for now.
2021-11-17 10:40:12 +01:00