[ADD] ci: CI de Forgejo, bots y pre-commit en todo el repo #19

Merged
snt merged 7 commits from 18.0-ci-forgejo-bots into 18.0 2026-10-04 17:42:04 +00:00
Owner

Resumen

Trae a addons-cm el CI y los bots de ecocentral-18, y deja el repo pasando pre-commit para que el job de lint salga en verde.

  • [FIX] pre-commit: no quita los espacios finales de los *.patch. Las líneas de contexto en blanco de un diff son un solo espacio, y quitarlo rompe pos_payment_method_cashdro_fix/upstream/*.patch.
  • [ADD] ci: Forgejo Actions con el mismo esquema que ecocentral (ver su docs/CI-CD.md):
    • ci.yml: lint (pre-commit), test (tools/ci/run_tests.py, instalación en dos fases como la OCA) y revisión del bot de PR, tras lint y test.
    • issue-bot.yml: el bot de issues contesta o abre un PR en bot/issue-N.
    • pr-bot.yml: revisión al quitar WIP o al poner la etiqueta i18n.
    • Los scripts son copias de los de ecocentral; solo cambian los valores por defecto (repo, token, ficheros de estado, idiomas es, eu, ca, gl). Propio de este repo: ODOO_SRC_SKIP (el runner trae un clon de addons-cm), BOT_BASE_BRANCH = 18.0 (la rama por defecto es 16.0) y PostgreSQL de test en el puerto 54330, para no chocar con ecocentral (54329).
  • [REF] all: pre-commit en todo el repo. Casi todo son arreglos automáticos de los hooks; a mano: dos imports sin usar, una variable l ambigua y claves del manifiesto iguales a su valor por defecto. Sin cambios de comportamiento.

Los 3 commits estaban solo en el 18.0 local; se han aplicado sobre origin/18.0 (que ya incluye 76dc355) sin conflictos.

Para probar

  • pre-commit pasa también en los ficheros de 76dc355, que entró en el remoto después de la limpieza
  • El job de lint del CI sale en verde
  • El job de test arranca en el runner y usa el puerto 54330
  • Conviene fusionar este PR antes que el #18, para que el #18 pase por el CI

🤖 Generated with Claude Code

## Resumen Trae a `addons-cm` el CI y los bots de ecocentral-18, y deja el repo pasando pre-commit para que el job de lint salga en verde. - **`[FIX] pre-commit`**: no quita los espacios finales de los `*.patch`. Las líneas de contexto en blanco de un diff son un solo espacio, y quitarlo rompe `pos_payment_method_cashdro_fix/upstream/*.patch`. - **`[ADD] ci`**: Forgejo Actions con el mismo esquema que ecocentral (ver su `docs/CI-CD.md`): - `ci.yml`: lint (pre-commit), test (`tools/ci/run_tests.py`, instalación en dos fases como la OCA) y revisión del bot de PR, tras lint y test. - `issue-bot.yml`: el bot de issues contesta o abre un PR en `bot/issue-N`. - `pr-bot.yml`: revisión al quitar WIP o al poner la etiqueta i18n. - Los scripts son copias de los de ecocentral; solo cambian los valores por defecto (repo, token, ficheros de estado, idiomas es, eu, ca, gl). Propio de este repo: `ODOO_SRC_SKIP` (el runner trae un clon de addons-cm), `BOT_BASE_BRANCH` = `18.0` (la rama por defecto es 16.0) y PostgreSQL de test en el puerto 54330, para no chocar con ecocentral (54329). - **`[REF] all`**: pre-commit en todo el repo. Casi todo son arreglos automáticos de los hooks; a mano: dos imports sin usar, una variable `l` ambigua y claves del manifiesto iguales a su valor por defecto. Sin cambios de comportamiento. Los 3 commits estaban solo en el `18.0` local; se han aplicado sobre `origin/18.0` (que ya incluye `76dc355`) sin conflictos. ## Para probar - [x] pre-commit pasa también en los ficheros de `76dc355`, que entró en el remoto después de la limpieza - [ ] El job de lint del CI sale en verde - [ ] El job de test arranca en el runner y usa el puerto 54330 - [ ] Conviene fusionar este PR antes que el #18, para que el #18 pase por el CI 🤖 Generated with [Claude Code](https://claude.com/claude-code)
snt added 3 commits 2026-10-04 12:35:26 +00:00
The blank context lines of a diff are a single space: stripping it breaks
pos_payment_method_cashdro_fix/upstream/*.patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same system as ecocentral-18 (see its docs/CI-CD.md):

- ci.yml: lint (pre-commit), test (tools/ci/run_tests.py, OCA-style
  two-phase install) and review (PR bot, after lint and test).
- issue-bot.yml: the issue bot answers issues or opens a PR on bot/issue-N.
- pr-bot.yml: review when WIP is removed or the i18n label is added.
- .gitea/issue-bot.md: context for the bots; this repo is shared by
  several clients.

The bot scripts are copies of ecocentral's. Only the defaults differ (repo,
token and state files, i18n languages es,eu,ca,gl) along with the [I18N]
commit message and the references to the runner's sources.txt.

The jobs run on a second forgejo-runner registration (CriptoMart org) on
ecocentral's runner machine, sharing its image, mounts and cache. The
runner files (Dockerfile, update.sh, sources.txt) live in ecocentral.
Specific to this repo:

- ODOO_SRC_SKIP: the runner's /odoo-src/18.0 holds a clone of addons-cm,
  so test skips it and checks the PR checkout instead.
- BOT_BASE_BRANCH "18.0": the repo's default branch is 16.0.
- test PostgreSQL on port 54330: ecocentral's runs on 54329 and a test job
  from each repo can run at the same time.

The lint job fails until the repo is cleaned up with
pre-commit run --all-files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[REF] all: pass pre-commit on the whole repo
Some checks failed
CI / lint (pull_request) Successful in 33s
CI / test (pull_request) Failing after 9m29s
CI / review (pull_request) Has been skipped
fbd43bb459
Needed for the lint job of the CI to go green. Mostly automatic hook
fixes (black, isort, prettier, pyupgrade, autoflake, whitespace). By hand:

- flake8: two unused imports, an ambiguous variable name `l`.
- pylint-odoo mandatory: manifest keys equal to their default value
  (installable, application, data, external_dependencies).
- end-of-file-fixer skips *.patch too, like trailing-whitespace: the
  upstream patches stay as git format-patch wrote them.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snt added 4 commits 2026-10-04 13:05:04 +00:00
The request env of the tests is in es_ES (and eu, ca, gl, pt, fr, it in the
multilang ones), but a fresh database such as the CI's only has en_US active
and env.lang raises "Invalid language code". The tests now activate them,
so the multilang cases run instead of being skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Created in one batch, every product got the same website_sequence (MAX + 5,
read before the insert) and the shop breaks the tie by id desc, so the
listing came out backwards and the page assertions failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In 18.0 purchase.order.line uses purchase.triple.discount.mixin, not the
triple.discount.mixin this addon patches, so the purchase tests checked 16.0
behaviour. test_purchase_order now checks the 18.0 one plus what matters
here: the bill created from the PO keeps discount1..3, and editing one of
them on the bill keeps the others. test_triple_discount_mixin runs on an
invoice line, and no longer expects the values of the previous test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[IMP] ci: test the ISOLATE addons in their own database
Some checks failed
CI / lint (pull_request) Successful in 31s
CI / test (pull_request) Failing after 11m29s
CI / review (pull_request) Has been skipped
87c2d1d1d3
website_sale_disable_cart removes the cart from every website once
installed, which breaks website_membership_signup_required when CI installs
everything together. The repo is shared by clients that never install them
together: run_tests.py now tests each ISOLATE addon in its own database,
after the rest, and ci.yml isolates website_sale_disable_cart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snt merged commit fac8299c9c into 18.0 2026-10-04 17:42:04 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: CriptoMart/addons-cm#19
No description provided.