Skip to content

Conversation

@HonahX
Copy link
Contributor

@HonahX HonahX commented Jun 4, 2025

This PR is a follow-up of #1806 to remove all usage of CallContext.of() in tests and the method itself

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Jun 4, 2025
@HonahX HonahX changed the title [Draft] Remove CallContext.of() Remove CallContext.of() Jun 4, 2025
@HonahX HonahX marked this pull request as ready for review June 4, 2025 23:12
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to go through a deprecation process for this even though it is a test only thing?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we have to do that. We can follow the process after 1.0.

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Changes LGTM overall, but I have a question about the rationale for some of them (as commented below)

Copy link
Contributor

Choose a reason for hiding this comment

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

How is it related to the removal of CallContext.of()?

Copy link
Contributor Author

@HonahX HonahX Jun 5, 2025

Choose a reason for hiding this comment

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

This helps remove the CallContext.of() in BasePolarisMetaStoreManagerTest, where some tests have the following pattern

@Test
  protected void testCreateEntitiesAlreadyExisting() {
    PolarisMetaStoreManager metaStoreManager = polarisTestMetaStoreManager.polarisMetaStoreManager;
    CallContext callCtx =
        CallContext.of(() -> "testRealm", polarisTestMetaStoreManager.polarisCallContext);
    if (CallContext.getCurrentContext() == null) {
      CallContext.setCurrentContext(callCtx);
    }

The polarisTestMetaStoreManager above is initialized in PolarisEclipseLinkMetaStoreManagerTest (and other persistence specific test class)

BTW, this change will disappear anyway with Yun's #1813 : )

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, #1813 appears to introduce this change in a more logically consistent way. Let's merge it first :)

@HonahX HonahX force-pushed the honahx_remove_callcontext_of branch from 433255e to 7287d6a Compare June 5, 2025 00:18
@HonahX HonahX requested a review from dimas-b June 5, 2025 00:24
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jun 5, 2025
@HonahX HonahX merged commit 511df8c into apache:main Jun 5, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Jun 5, 2025
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