Skip to content

[16.0][FIX] session_db: Fix creation of postgres_uri in tests - #3185

Merged
OCA-git-bot merged 1 commit into
OCA:16.0from
lal-solute:fix_session_db
Feb 3, 2025
Merged

OCA-git-bot merged 1 commit into
OCA:16.0from
lal-solute:fix_session_db

Conversation

@lal-solute

@lal-solute lal-solute commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

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.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@sbidoul

sbidoul commented Feb 3, 2025

Copy link
Copy Markdown
Member

@lal-solute thanks a lot for adding a test :)

Please don't change the version number, this is bumped automatically on merge.

@lal-solute

Copy link
Copy Markdown
Contributor Author

OK, sorry

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

Copy link
Copy Markdown
Contributor Author

@sbidoul Now I think I'm done, thx for the help.

@sbidoul

sbidoul commented Feb 3, 2025

Copy link
Copy Markdown
Member

Thanks for contributing the fix and writing a test!

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@sbidoul

sbidoul commented Feb 3, 2025

Copy link
Copy Markdown
Member

I'll take care of the forward port.

@lal-solute

Copy link
Copy Markdown
Contributor Author

Thank you!

@OCA-git-bot
OCA-git-bot merged commit 1291057 into OCA:16.0 Feb 3, 2025
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@lal-solute
lal-solute deleted the fix_session_db branch February 3, 2025 15:54
@sbidoul

sbidoul commented Feb 4, 2025

Copy link
Copy Markdown
Member

Forward ports in #3187 and #3188

@StefanRijnhart StefanRijnhart changed the title [FIX] session_db: Fix creation of postgres_uri in tests [16.0][FIX] session_db: Fix creation of postgres_uri in tests Feb 5, 2025
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.

3 participants