Repository navigation
[20.0][MIG] queue_job: Migration to 20.0 - #1
Merged
Merged
Conversation
Use case: * you have a root channel per scope/app (eg: root.edi) * you have several sub channels (eg: root.edi.ubl.sales, root.edi.gs1.delivery) * you want to configure capacity only for the main channel "root.edi" Before this change, the channel manager falls back on root channel. However, if you have a specific parent channel configured it sounds a good idea to use it.
Contributing since a while... :)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/
test_queue_job will create channels root.sub and root.sub.sub, so the tests doing the same thing will fail with a unique constraint error.
When displayed in a tab, the widget show the nodes offset, the d3 network is probably confused by the size or visibility of its canvas. Install a listener on tabs to trigger a fit() on the network.
A graph of jobs always share the same graph_uuid, which can be used to group jobs, but is also a faster way to find all the jobs of the graph. Then we can use the dependencies field to build the whole graph from the pre-selection of jobs.
Jobs waiting that their dependencies are executed cannot be requeued. They have to keep waiting their turn.
* mock_jobs context manager with assert methods to check enqueued jobs * jobs are not stored in database, yet they can be inspected and performed during the test * the context manager works with graphs enqueued by delayable and with with_delay() * direct execution of jobs works with graphs by executing them synchronously following their topological sort
This would release the job lock, causing spurious restarts by the dead jobs requeuer.
There is no parameter auto_spec to mock.patch. This is likely a typo.
Running the tests with Python 3.12 give a RuntimeError
```
File "/usr/local/lib/python3.12/unittest/mock.py", line 1311, in __init__
_check_spec_arg_typos(kwargs)
File "/usr/local/lib/python3.12/unittest/mock.py", line 1287, in _check_spec_arg_typos
raise RuntimeError(
RuntimeError: 'auto_spec' might be a typo.
```
Every time a job is done, even if it is not part of a graph, it runs a query to look for dependents to enqueue. Storing the dependent uuids in the "dependencies" field was on purpose to know that we have no further jobs in the graph and that we can skip the check entirely and have no overhead in this case. It looks like an oversight, we can add the missing condition.
In this case, when a module adds a value in context, the tests fail
It is forbidden to commit inside a job, because it releases the job lock and can cause it to start again, while still being run, by the dead jobs requeuer. For some use cases, it may actually be legitimate, or at least be needed in the short term before actual updates in the code. A new option on the job function, false by default, allow to run the job in a new transaction, at the cost of an additional connection + transaction overhead. Related to OCA#889
False on new databases, True on existing databases. Should always be False by default on future versions.
This reverts commit b4f3bec.
As the controller changes env on Job instances.
…ethod We add the `_subscribe_job_creator` method in `queue.job` which will return True for the cases where we want to subscribe the job creator, False otherwise.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: queue-19.0/queue-19.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job/
Currently translated at 100.0% (156 of 156 strings) Translation: queue-19.0/queue-19.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job/it/
Jobs are always created through sudo() in the Job class, and always deleted by the cron, never by users. See discussion on OCA#802 (comment)
Currently translated at 100.0% (156 of 156 strings) Translation: queue-19.0/queue-19.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job/it/
- upgrade_code: ir.model.access + ir.rule -> ir.access; registry.clear_cache -> transaction.invalidate_ormcache - http: patch pe odoo.http.router._set_session_and_dbname (Request._get_session_and_dbname nu mai există) - controller: PG_CONCURRENCY_ERRORS_TO_RETRY definit local (odoo.service.model l-a eliminat); env.clear() -> env.transaction.clear() - jobrunner: odoo.modules.db.list_dbs (odoo.service.db eliminat) - fields: _setup_attrs -> _setup_attrs__; tools.ormcache -> api.ormcache - JS: widget-ul job_direct_graph portat la Owl 3 (useProps, signal.ref, ActionPlugin) - view: widget remaining_days -> relative_date Testat pe Odoo 20 (test20): instalare + teste modul. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrare queue_job 19.0 → 20.0, după fluxul OCA (Migration to version 20.0).
Commit-uri: istoricul modulului replayat din 19.0 (
git format-patch | git am -3 --keep) +[MIG] queue_job: Migration to 20.0.Adaptări
upgrade_code:ir.model.access+ir.rule→security/ir.access.csv(7 drepturi + regula multi-company, nicio regulă pierdută);registry.clear_cache→transaction.invalidate_ormcache.post_loadmutat peodoo.http.router._set_session_and_dbname(Request._get_session_and_dbnamenu mai există în 20).PG_CONCURRENCY_ERRORS_TO_RETRYdefinit local (eliminat dinodoo.service.model);env.clear()→env.transaction.clear().odoo.modules.db.list_dbs(odoo.service.dbeliminat).fields.py:_setup_attrs→_setup_attrs__;tools.ormcache→api.ormcache.job_direct_graphportat la Owl 3 nativ (useProps,signal.ref,ActionPlugin) —owl3-migrationprodusese importuri inexistente șiActionManagerPlugin(bug în maparea din upgrade_code).remaining_days→relative_date.De confirmat înainte de merge: regula globală multi-company
queue_job_comp_ruledevine un rândir.accessfără grup, cu același domeniu; în 19 eranoupdate=1, acum se actualizează la fiecare upgrade de modul.Pentru modulele dependente:
queue_job_cron_jobrunnerimportăodoo.service.model.PG_CONCURRENCY_ERRORS_TO_RETRY→ de mutat peodoo.addons.queue_job.controllers.mainla migrarea lui.Verificare
upgrade_code(19.x +owl3-migration) și rescrierile proprii prinscripts/mig_upgrade_code.py; verificările de API (semnături core 19↔20, API-uri eliminate) fără poziții rămase.test20) și rulate testele modulului: 68 teste OK.🤖 Generated with Claude Code