[16.0][FIX] session_db: Fix creation of postgres_uri in tests - #3185
Merged
Merged
Conversation
Contributor
|
Hi @sbidoul, |
sbidoul
approved these changes
Feb 3, 2025
lal-solute
force-pushed
the
fix_session_db
branch
from
February 3, 2025 14:47
2850ce8 to
2e5d0c3
Compare
Member
|
@lal-solute thanks a lot for adding a test :) Please don't change the version number, this is bumped automatically on merge. |
Contributor
Author
|
OK, sorry |
lal-solute
force-pushed
the
fix_session_db
branch
from
February 3, 2025 14:52
2e5d0c3 to
5336bd6
Compare
with the parameter "login" in `_make_postgres_uri()` it becomes impossible to log in with the configured database, as it has to have the name "user". This is because of passing the `connection_info` dict as keywords parameter into the function. But because `connection_info_for` called in `setUp()` reads the config file of odoo and there the database user is `db_user` the keyword parameter is discarded and `login` is not set. The `db_`-prefix is removed. So user and password are not applied to the uri/dsn and thus login to the database is not possible, if the database wants those parameters. When I applied this change in our internal CI of solute.de, everything worked fine afterwards. This has to be ported to 17.0 and 18.0 as well.
lal-solute
force-pushed
the
fix_session_db
branch
from
February 3, 2025 15:04
5336bd6 to
d5db5ea
Compare
Contributor
Author
|
@sbidoul Now I think I'm done, thx for the help. |
Member
|
Thanks for contributing the fix and writing a test! /ocabot merge patch |
Contributor
|
What a great day to merge this nice PR. Let's do it! |
Member
|
I'll take care of the forward port. |
Contributor
Author
|
Thank you! |
Contributor
|
Congratulations, your PR was merged at 179d06e. Thanks a lot for contributing to OCA. ❤️ |
This was referenced Feb 4, 2025
Member
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.
with the parameter "login" in
_make_postgres_uri()it becomes impossible to log in with the configured database, as it has to have the name "user". This is because of passing theconnection_infodict as keywords parameter into the function. But becauseconnection_info_forcalled insetUp()reads the config file of odoo and there the database user isdb_userthe keyword parameter is discarded andloginis not set. Thedb_-prefix is removed. So user and password are not applied to the uri/dsn and thus login to the database is not possible, if the database wants those parameters.When I applied this change in our internal CI of solute.de, everything worked fine afterwards.
This has to be ported to 17.0 and 18.0 as well.