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

NODE service get_table_data task is only allowed for published tables. #450

Merged

Conversation

ThanKarab
Copy link
Member

https://team-1617704806227.atlassian.net/browse/MIP-825
The 'get_table_data' task uses the db public user to fetch data so it only works for published data.
Added 'use_public_user' parameter in the monetdb_facade method, so that the public user is used for the queries.
Added 'get_table_data_from_db' method in the standalone tests (conftest.py) and changed all tests to use this method instead of calling the NODE task.
Refactored many standalone tests to use ONLY the task they are testing, instead of using multiple NODE tasks to ensure the proper result. Instead direct DB queries are made.

@ThanKarab ThanKarab force-pushed the dev/MIP-825/get_table_data_should_use_the_guest_user branch 4 times, most recently from 00345c1 to 2b63a84 Compare September 20, 2023 15:10
Copy link
Contributor

@KFilippopolitis KFilippopolitis left a comment

Choose a reason for hiding this comment

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

Great job.
The tests are now simpler and smaller.
Two minor things:

  • Update the README.md of node to also contain the PROTECT_LOCAL_DATA in the required env variables.
  • Also add some test on the test_monet_db_facade.py to cover the different cases with the
    use_public_user.

exareme2/node/monetdb_interface/monet_db_facade.py Outdated Show resolved Hide resolved
https://team-1617704806227.atlassian.net/browse/MIP-825
The 'get_table_data' task uses the db public user to fetch data so it only works for published data.
Added 'use_public_user' parameter in the monetdb_facade method, so that the public user is used for the queries.
Added 'get_table_data_from_db' method in the standalone tests (conftest.py) and changed all tests to use this method instead of calling the NODE task.
Refactored many standalone tests to use ONLY the task they are testing, instead of using multiple NODE tasks to ensure the proper result. Instead direct DB queries are made.
Added on/off switch named 'protect_local_data'.
When the switch is on, the 'get_table_data' will use the public user, otherwise not.
The GLOBALNODE should always have this variable switched off.
In the LOCALNODE this variable should be off ONLY in testing scenarios.
@ThanKarab ThanKarab force-pushed the dev/MIP-825/get_table_data_should_use_the_guest_user branch from 2b63a84 to fa60aef Compare September 21, 2023 10:59
@ThanKarab ThanKarab merged commit 47a0001 into master Sep 21, 2023
6 checks passed
@ThanKarab ThanKarab deleted the dev/MIP-825/get_table_data_should_use_the_guest_user branch September 21, 2023 11:37
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.

3 participants