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

[improve] add connector options class exist check #8600

Merged
merged 8 commits into from
Feb 6, 2025

Conversation

liunaijie
Copy link
Member

Purpose of this pull request

check the Connector need has corresponding [Options] class.

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

path.getFileName().toString().replace(JAVA_FILE_EXTENSION, "");
connectorOptionFileNames.remove(className);
});
Assertions.assertEquals(
Copy link
Member

Choose a reason for hiding this comment

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

Can we add some white list to let the test case passes? Then when one connector had Options class, we can remove it from white list.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I will add the connector under this issue to the whitelist, #8576.

path.getFileName().toString().replace(JAVA_FILE_EXTENSION, "");
connectorOptionFileNames.remove(className);
});
connectorOptionFileNames.removeAll(buildWhiteList());
Copy link
Member

Choose a reason for hiding this comment

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

we should assert connectorOptionFileNames size equals white list size.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems that this might not be necessary.
If the white list size is smaller than connectorOptionFileNames.size(), the following Assertions.assertEquals(0, connectorOptionFileNames.size()) will fail.

On the other hand, if the white list size is larger than connectorOptionFileNames.size(), removing non-existent Options or already removed Options won't have any impact.

Additionally, if we check for equality of size before calling connectorOptionFileNames.remove(className), the size will never match when the update PR is done and the connector class is removed from the white list.

Please correct me if I'm wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, my logic needs to be corrected. We should check the size of connectorOptionFileNames be removed by white list equals white list size. So that we can make sure the white list are all up to date and right.

Hisoka-X
Hisoka-X previously approved these changes Feb 5, 2025
@hailin0 hailin0 merged commit 6468a1b into apache:dev Feb 6, 2025
6 checks passed
litiliu pushed a commit to litiliu/seatunnel that referenced this pull request Feb 6, 2025
@liunaijie liunaijie deleted the improve/option_check branch February 7, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants