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

Fix PostgreSQL Metadata Source Tests #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Chanakya-TS
Copy link

Updates Metadata Source Tests after changes from commit

Updates database creation and deletion commands (PSQL specific)

Description

Changes in commit no longer require EscapeString to be surrounded by single quotes.

Previously, databases cannot be created or deleted with the name "model-registry" due to "-". PR surrounds database name in double quotes.

How Has This Been Tested?

Deployed model-registry-operator with a postgres server and ran standalone_postgresql_metadata_source_test. All 7 tests pass.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@dhirajsb
Copy link

dhirajsb commented Aug 5, 2024

@isinyaaa can you also take a look?
/lgtm

@dhirajsb dhirajsb requested a review from isinyaaa August 5, 2024 03:44
Copy link

@isinyaaa isinyaaa left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, Chanakya!
I have a final nitpick that I'd prefer if you split the two fixes on this PR in separate commits, because they kinda overlap although I think each requires a little more context, e.g. why are you removing quotes on one place and adding them on another? My point being that the changes are similar but for different reasons.
Because we're squash merging I guess you can also "copy-paste" the PR description on a single commit. That's just a click-saver to avoid getting into GitHub to try and figure out why the change was made (although the Mercurial syncs from upstream don't help much on this project).

TLDR: see comments inline, also https://cbea.ms/git-commit is a personal favorite -- especially useful in the open source world.

absl::Substitute("CREATE DATABASE $0;", config_.dbname().data());
absl::Substitute("CREATE DATABASE \"$0\";", config_.dbname().data());
Copy link

Choose a reason for hiding this comment

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

IIUC, and also from the PR description, this fixes DB creation for names containing a "-", as you also raised on a previous meeting.
Can you split that into a separate commit, with the comment from the PR description? I believe it's important to keep track of the reason why certain changes were made.

IIRC we also need that fix on the MySQL metadata source ConnectImpl, can you confirm/test?

Comment on lines 1 to 5
{
"files.associations": {
"string": "cpp"
}
}
Copy link

Choose a reason for hiding this comment

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

Nit: you could squash this change to keep the PR cleaner.

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