Skip to content

Conversation

@XN137
Copy link
Contributor

@XN137 XN137 commented Sep 10, 2025

PolarisServiceImpl already is a request-scoped bean. if we apply the same to PolarisAdminService we can simply inject it into PolarisServiceImpl.

import jakarta.annotation.Nonnull;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult;
import software.amazon.awssdk.annotations.NotNull;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wrong import

*/
private boolean requiresSecretReferenceExtraction(
@NotNull ConnectionConfigInfo connectionConfigInfo) {
@Nonnull ConnectionConfigInfo connectionConfigInfo) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needed to be changed as quarkus thought this might be a rest endpoint or the like, quite sure Nonnull was the original intent (i.e. not validation here)

private PolarisAdminService newAdminService(
RealmContext realmContext, SecurityContext securityContext) {
PolarisPrincipal authenticatedPrincipal = (PolarisPrincipal) securityContext.getUserPrincipal();
if (authenticatedPrincipal == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that this checks happens in PolarisAdminService ctor already

/** From PolarisCatalogsApiService */
@Override
public Response createCatalog(
CreateCatalogRequest request, RealmContext realmContext, SecurityContext securityContext) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the realmContext and securityContext params in these methods are now all unused.
note that since this class has a CallContext field, we can be sure that realmContext is matching the one from the injected request-scoped fields.

wondering:
should we adjust openapi server-templates to remove one/both from the apis (now/in a followup)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say remove in a follow-up.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on follow-up, the same should apply to IcebergAdapter, GenericTableAdapter and PolicyAdapter. I think the server template update will not be a small PR

@XN137 XN137 marked this pull request as ready for review September 10, 2025 11:38
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Sep 10, 2025
Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

LGTM!

/** From PolarisCatalogsApiService */
@Override
public Response createCatalog(
CreateCatalogRequest request, RealmContext realmContext, SecurityContext securityContext) {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on follow-up, the same should apply to IcebergAdapter, GenericTableAdapter and PolicyAdapter. I think the server template update will not be a small PR

`PolarisServiceImpl` already is a request-scoped bean.
if we apply the same to `PolarisAdminService` we can simply
inject it into `PolarisServiceImpl`.
@XN137 XN137 force-pushed the inject-PolarisAdminService branch from 67a272a to 5a46a7d Compare September 12, 2025 06:21
@dimas-b dimas-b merged commit be4175c into apache:main Sep 12, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Sep 12, 2025
@XN137 XN137 deleted the inject-PolarisAdminService branch September 12, 2025 15:39
snazy added a commit to snazy/polaris that referenced this pull request Nov 20, 2025
* Fix deprecation warnings in GcpCredentialsStorageIntegrationTest (apache#2544)

* Fix deprecation warnings in GcpCredentialsStorageIntegrationTest

Refactor the code to use an explicit InputStream

Cf. FasterXML/jackson-core#803

* Add subtype-check to PolarisEntity subclass ctors (apache#2492)

this is a follow-up to ac31963

* Inject PolarisAdminService into PolarisServiceImpl (apache#2533)

`PolarisServiceImpl` already is a request-scoped bean.
if we apply the same to `PolarisAdminService` we can simply
inject it into `PolarisServiceImpl`.

* Reduce getOrCreateMetaStoreManager callers (apache#2532)

we can inject `PolarisMetaStoreManager` directly into request-scoped
beans or build it only once in tests that operate in a single realm.

* Update dependency mypy to >=1.18, <=1.18.1 (apache#2547)

* Update dependency pyiceberg to v0.10.0 (apache#2549)

Co-authored-by: Yong Zheng <yongzheng0809@gmail.com>

* Minor fix for README.md (apache#2558)

* Testing: Let runtime-service tests use Quarkus via `enforcedPlatform()` (apache#2545)

This change ensures that the tests in runtime-service use the same Quarkus platform dependency versions as Polaris server does.

* Update quay.io/keycloak/keycloak Docker tag to v26.3.4 (apache#2553)

* Update dependency software.amazon.awssdk:bom to v2.33.9 (apache#2561)

* NoSQL: remove unused type

* Last merged commit a2f29cb

* disable flaky test apache#2563

---------

Co-authored-by: Dmitri Bourlatchkov <dmitri.bourlatchkov@gmail.com>
Co-authored-by: Christopher Lambert <xn137@gmx.de>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Yong Zheng <yongzheng0809@gmail.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.

3 participants