Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: postgres_info.py now shows the info of each specific database #173

Conversation

marcosdiez
Copy link
Contributor

SUMMARY

fixes #172

The reason postgres_info.py was gathering data on every database was because of a bug in PgDbConn.reconnect(), which is fixed here.

I also changed the main loop that iterate among all DBs to ignore DBs which it can't access because in AWS RDS not all DBs are accessible.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

postgres_info.py

@marcosdiez marcosdiez changed the title fix reconnect() postgres_info.py will not properly show the info each specific database (mainly namespaces) Dec 15, 2021
@marcosdiez marcosdiez changed the title postgres_info.py will not properly show the info each specific database (mainly namespaces) bugfix: postgres_info.py will now properly show the info each specific database (mainly namespaces) Dec 15, 2021
@Andersson007
Copy link
Collaborator

@marcosdiez hi and welcome to the project! Thank you for the bunch of issues and fixes! Could you please:

@marcosdiez marcosdiez changed the title bugfix: postgres_info.py will now properly show the info each specific database (mainly namespaces) bugfix: postgres_info.py now shows the info of each specific database Dec 15, 2021
@Andersson007
Copy link
Collaborator

@marcosdiez thank you for the PR, could you please:

  1. Fix CI, everything should be green (see the "Details" link for details)
  2. Be sure the changes is covered with integration tests, see the content of tests/integration/targets/postgresql_info/tasks

@Andersson007
Copy link
Collaborator

closed reopened to re-trigger CI

@Andersson007
Copy link
Collaborator

Andersson007 commented Dec 20, 2021

@marcosdiez ah, the failings are unrelated (there are AZP issues there), sorry
So please cover the case mentioned in #172 somewhere within tests/integration/targets/postgresql_info/tasks and let us know when it's ready for review (if you need any help, just ask)

This was referenced Dec 20, 2021
marcosdiez and others added 4 commits December 26, 2021 10:02
…ach_specific_database.yml

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
@marcosdiez
Copy link
Contributor Author

@Andersson007 hi! Unit tests added. Sorry for the delay, but it took me longer to find out how to run unit tests locally then to actually write them.

By the way, the solution I found is time ansible-test integration --target docker:ubuntu2004 --docker-terminate never -v postgresql_info which is taking a little more than a minute on each iteration.

I still have not found a way to use the same container and hence not have to download postgres every time I want to run unit tests.

Please feel free to core review this PR and request changes as needed.
Thanks!

Copy link
Collaborator

@Andersson007 Andersson007 left a comment

Choose a reason for hiding this comment

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

LGTM

@Andersson007 Andersson007 merged commit c26dab1 into ansible-collections:main Jan 3, 2022
@Andersson007
Copy link
Collaborator

@marcosdiez thanks for the great contribution!:)

@Andersson007
Copy link
Collaborator

By the way, the solution I found is time ansible-test integration --target docker:ubuntu2004 --docker-terminate never -v postgresql_info which is taking a little more than a minute on each iteration.

I just use ansible-test integration postgresql_info --docker ubuntu2004 -vvv > ~/test.log, never dug into it deeply. I'll compare your command with this simplest one next time, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

community.postgresql.postgresql_info is showing the namespaces of "db" variable for every database
2 participants