Skip to content

[18.0][FIX] auth_jwt: mute noisy Odoo test patch checker#899

Merged
OCA-git-bot merged 1 commit intoOCA:18.0from
StefanRijnhart:18.0-auth_jwt-mute_patch_checker
Feb 20, 2026
Merged

[18.0][FIX] auth_jwt: mute noisy Odoo test patch checker#899
OCA-git-bot merged 1 commit intoOCA:18.0from
StefanRijnhart:18.0-auth_jwt-mute_patch_checker

Conversation

@StefanRijnhart
Copy link
Copy Markdown
Member

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@sbidoul
Copy link
Copy Markdown
Member

sbidoul commented Feb 20, 2026

@StefanRijnhart I had done #897 yesterday, do we still need this?

@StefanRijnhart
Copy link
Copy Markdown
Member Author

@sbidoul Yes, because after #897, the logs are still littered with

2026-02-19 13:25:35,667 688 INFO odoo odoo.tests.common: /__w/server-auth/server-auth/auth_jwt/models/auth_jwt_validator.py:255:_register_auth_method setting ir.http._auth_method_jwt_validator to functools.partial(<bound method IrHttpJwt._auth_method_jwt of <class 'odoo.api.ir.http'>>, validator_name='validator') 

@sbidoul
Copy link
Copy Markdown
Member

sbidoul commented Feb 20, 2026

Ah yes, I see. Do we know the purpose of that specific log and why it logs a stack trace at INFO level? I could not immediately find the explanation in the upstream PR.

@StefanRijnhart
Copy link
Copy Markdown
Member Author

If I understand correctly, the purpose is to register the file and method as a known originator of patches. The goal of the code is to point out unregistered (and as such, illegitimate) patches in tests.

I would normally set SETATTR_SOURCES in tests, but this one fires unconditionally whenever post tests are run on a database with this module installed.

@StefanRijnhart
Copy link
Copy Markdown
Member Author

StefanRijnhart commented Feb 20, 2026

Wait, this won't do. It raises a runtime warning.

2026-02-20 10:42:04,254 157722 ERROR odoo odoo.tests.common: Importing test framework, avoid importing from business modules and when not running in test mode
File "/home/odoo/src/oca-server-auth/auth_jwt/models/auth_jwt_validator.py", line 16, in
from odoo.tests.common import SETATTR_SOURCES

Refactored to mute the logger in the patching method.

@StefanRijnhart StefanRijnhart marked this pull request as draft February 20, 2026 10:44
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auth_jwt-mute_patch_checker branch from c9f10cf to 714196e Compare February 20, 2026 10:46
@StefanRijnhart StefanRijnhart force-pushed the 18.0-auth_jwt-mute_patch_checker branch from 714196e to fb0eea0 Compare February 20, 2026 10:47
@StefanRijnhart StefanRijnhart marked this pull request as ready for review February 20, 2026 10:55
@pedrobaeza pedrobaeza added this to the 18.0 milestone Feb 20, 2026
Copy link
Copy Markdown
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@pedrobaeza pedrobaeza changed the title [FIX] auth_jwt: mute noisy Odoo test patch checker [18.0][FIX] auth_jwt: mute noisy Odoo test patch checker Feb 20, 2026
@OCA-git-bot
Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-899-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit acdf945 into OCA:18.0 Feb 20, 2026
9 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at a12f4c8. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants