Skip to content

Conversation

@williamhyun
Copy link
Member

This PR aims to improve the Policy API test coverage per #1582.

@williamhyun
Copy link
Member Author

cc: @HonahX

@HonahX
Copy link
Contributor

HonahX commented May 23, 2025

Thanks for working on this! It looks great, left some comments.

@williamhyun
Copy link
Member Author

Thank you for the review @adnanhemani and @HonahX!
Please feel free to take a look again and comment on anything else that could be improved!

@williamhyun
Copy link
Member Author

cc: @eric-maynard

eric-maynard
eric-maynard previously approved these changes May 27, 2025
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board May 27, 2025
@eric-maynard eric-maynard requested a review from adnanhemani May 27, 2025 18:46
policyApi
.request(
"polaris/v1/{cat}/namespaces/{ns}/policies/{policy}",
Map.of("cat", currentCatalogName, "ns", "NS1", "policy", INVALID_POLICY))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This is similar to the comment I left earlier - ideally we should not have "magic strings" anywhere in the tests either.

So instead of using "NS1", we should be using variable NS1 and in all locations instead of using NS1 inline on the assertion, make the string into "namespace: " + NS1 (and substitute all other locations of this, as required).

adnanhemani and others added 3 commits May 27, 2025 14:07
This is a retry at apache#1586, which I'll close if this PR is on the right direction instead.

Java URI does not actually apply any normalization to URIs if we do not call URI.normalize() (which we currently do not). Additionally, blob storage providers like S3 and GCS can provide ".." and "." as valid fragments in URLs - which Java URI would attempt to normalize incorrectly. As a result, attempting to validate and/or normalize URIs for blob storage providers using the Java URI class is the incorrect behavior. While we may want to add location validation via regex later, removing it first should at least unblock the bug we see in apache#1545.
Copy link
Contributor

@adnanhemani adnanhemani left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@williamhyun williamhyun requested a review from eric-maynard May 27, 2025 21:38
@flyrain flyrain merged commit d8c8920 into apache:main May 27, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board May 27, 2025
@flyrain
Copy link
Contributor

flyrain commented May 27, 2025

Thanks a lot for working on it, @williamhyun! Thanks everyone for the review.

snazy added a commit to snazy/polaris that referenced this pull request Jun 13, 2025
* fix: Remove duplicated code in IcebergCatalog (apache#1681)

* Fix SparkClient listGenericTable to use ListGenericTablesRESTResponse

ListTableResponse is the class used by iceberg endpoint, which is the same as ListGenericTablesRESTResponse. However, we are suppose to use ListGenericTablesRESTResponse to be correct

* fix: Remove info log about deprecated internal method from PolarisConfiguration (apache#1672)


Remove the INFO log about calls to this method in Polaris, because users cannot do anything about these messages.

Phasing out old property names requires coordination with users (e.g. release notes), so it is not a matter of merely avoiding calls to that method in Polaris code.

Fixes apache#1666

* Create a single binary distribution bundle (apache#1589)

* fix(quickstart): Correct Quickstart Instructions (apache#1673)

* Remove Java URI validations for Blob Storage providers (apache#1604)

This is a retry at apache#1586, which I'll close if this PR is on the right direction instead.

Java URI does not actually apply any normalization to URIs if we do not call URI.normalize() (which we currently do not). Additionally, blob storage providers like S3 and GCS can provide ".." and "." as valid fragments in URLs - which Java URI would attempt to normalize incorrectly. As a result, attempting to validate and/or normalize URIs for blob storage providers using the Java URI class is the incorrect behavior. While we may want to add location validation via regex later, removing it first should at least unblock the bug we see in apache#1545.

* Improve test coverage for invalid inputs in Policy APIs (apache#1665)

* Fix getting-started docker start by PR apache#1532 (apache#1687)

* Fix the manual test broken by PR apache#1532 (apache#1688)

* Fix credentials printing twice (apache#1682)

* main: Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7.0.4 (apache#1690)

* INFO: last merged commit 493de03

---------

Co-authored-by: Alexandre Dutra <adutra@users.noreply.github.com>
Co-authored-by: gh-yzou <167037035+gh-yzou@users.noreply.github.com>
Co-authored-by: Dmitri Bourlatchkov <dmitri.bourlatchkov@gmail.com>
Co-authored-by: Yufei Gu <yufei@apache.org>
Co-authored-by: Adnan Hemani <adnan.h@berkeley.edu>
Co-authored-by: William Hyun <william@apache.org>
Co-authored-by: Christopher Lambert <xn137@gmx.de>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
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.

5 participants