Skip to content

Fix GCP and Azure storage configuration to store missing properties - #370

Merged
collado-mike merged 5 commits into
apache:mainfrom
collado-mike:mcollado-fix-gcp-azure-storageconfig
Oct 16, 2024
Merged

collado-mike merged 5 commits into
apache:mainfrom
collado-mike:mcollado-fix-gcp-azure-storageconfig

Conversation

@collado-mike

@collado-mike collado-mike commented Oct 14, 2024 •

Copy link
Copy Markdown
Contributor

Description

GCP and Azure storage config models are missing properties sent by the client, causing misconfiguration of catalog storage. This fixes the missing properties and adds explicit tests for those storage configurations.

To facilitate testing, this also moves the GCP application credentials generation to a configurable supplier so that a static instance can be injected in tests.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • PolarisServiceImplIntegrationTest

Test Configuration:

  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • If adding new functionality, I have discussed my implementation with the community using the linked GitHub issue

}

@Test
public void testCreateCatalogWithAzureStorageConfig() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might also be useful to add CLI tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CLI tests are fine, but I think the primary purpose of CLI tests is to evaluate that the CLI behaves as expected. For the purpose of this PR, we're fixing an API issue, so I think testing the API directly makes the most sense. If the CLI isn't passing something to the API, that's a concern, but I don't think we need to duplicate every API test in the CLI. Moreover, the CLI test doesn't have the infrastructure for setting fake google credentials, so adding tests there would require a pretty significant change and I don't know that we'd get much more value for the extra work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding CLI or Python client tests would add further validation that the types (i.e. AzureStorageConfigInfo) serialize and deserialize correctly in the Python client.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As above, if we don't have tests for that, I don't think we ought to block a bugfix from being checked in to address that issue. I think de/serialization tests are great. Let's open an issue and tackle it in another PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Being that the issue was initially reported as affecting the CLI, I still think it makes sense to add CLI tests.

@eric-maynard eric-maynard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an important fix and overall the change looks good to me. Left a few comments

@eric-maynard eric-maynard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for the fix! Let's not block on reworking the relevant tests

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