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: add backwards compatibility for procedures #98

Closed

Conversation

DerekTBrown
Copy link

@DerekTBrown DerekTBrown commented Nov 28, 2023

What does this PR do?

This adds backwards-compatible support for procedures with the OSS terraform provider.

Test Plan

  • Added unit tests.

@DerekTBrown DerekTBrown reopened this Jan 12, 2024
@DerekTBrown DerekTBrown changed the title fix: procedure formatting fix: add backwards compatibility for procedures Jan 13, 2024
@DerekTBrown DerekTBrown marked this pull request as ready for review January 13, 2024 00:35
Copy link
Owner

@petoju petoju left a comment

Choose a reason for hiding this comment

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

Looks good - I have only few small comments, feel free to object.

user = "jdoe-%s"
host = "%s"
privileges = ["EXECUTE"]
database = "PROCEDURE %s.%s"
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe this is a too large of request, but could you please add test with the format that worked here before?

database = "PROCEDURE some_db_name"
table = "procedure_name"

I don't insist on this, but it would be helpful as a regression test.

Copy link
Author

Choose a reason for hiding this comment

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

That's a good idea. I have introduced a test for this in the newest version.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks, that draft looks good - I have two more comments for you to comment (that were just resolved). Could you please at least comment on them?

database = strings.Trim(m[3], "`\"")
table = strings.Trim(m[4], "`\"")
} else {
database = fmt.Sprintf("%s%s.%s", m[2], strings.Trim(m[3], "`\""), strings.Trim(m[4], "`\""))
Copy link
Owner

Choose a reason for hiding this comment

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

Please consider adding a comment the expected value. On a first sight, I had absolutely no idea about what should be saved to "database" and why.

Copy link
Owner

Choose a reason for hiding this comment

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

Did you do anything here? Please at least leave a comment if you want to resolve something.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I am actively working on this. Just haven't pushed my latest changes.

Copy link
Owner

Choose a reason for hiding this comment

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

Ok thanks! Feel free to push them; more changes can also be added later.

@@ -23,7 +23,7 @@ bin/terraform:
(cd $(CURDIR)/bin/ ; unzip terraform.zip)

testacc: fmtcheck bin/terraform
PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout=90s
PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 TF_LOG=DEBUG go test $(TEST) -v $(TESTARGS) -timeout=90s
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please remove this change?
It may be beneficial, but it fills test output with thousands of lines of TF debug that will be never read.

Copy link
Owner

Choose a reason for hiding this comment

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

Why was this resolved?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, just haven't pushed changes.

@DerekTBrown DerekTBrown marked this pull request as draft January 16, 2024 22:42
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.

2 participants