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

KAFKA-17051: ApiKeys#toHtml should exclude the APIs having unstable latest version #16480

Merged
merged 9 commits into from
Jul 2, 2024

Conversation

m1a2st
Copy link
Contributor

@m1a2st m1a2st commented Jun 28, 2024

https://issues.apache.org/jira/browse/KAFKA-17051
we should exclude those APIs having make "latestVersionUnstable=true".

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@@ -332,6 +332,7 @@ public static EnumSet<ApiKeys> controllerApis() {
public static EnumSet<ApiKeys> clientApis() {
List<ApiKeys> apis = Arrays.stream(ApiKeys.values())
.filter(apiKey -> apiKey.inScope(ApiMessageType.ListenerType.ZK_BROKER) || apiKey.inScope(ApiMessageType.ListenerType.BROKER))
.filter(apiKey -> !apiKey.messageType.latestVersionUnstable())
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't add this change to clientApis since it is used by other callers. Please add the filter into toHtml. Also, please have test for it

@m1a2st
Copy link
Contributor Author

m1a2st commented Jun 28, 2024

@chia7712, Thanks for your review, PTAL

@chia7712
Copy link
Contributor

@m1a2st could you also update the docs to remind readers that the listed APIs include only stable parts?

<p>The following are the numeric codes that the ApiKey in the request can take for each of the below request types.</p>

@m1a2st
Copy link
Contributor Author

m1a2st commented Jun 30, 2024

@chia7712, Thanks for your comments, PTAL

@@ -200,7 +200,7 @@ <h5 class="anchor-heading"><a id="protocol_error_codes" class="anchor-link"></a>
<!--#include virtual="generated/protocol_errors.html" -->

<h5 class="anchor-heading"><a id="protocol_api_keys" class="anchor-link"></a><a href="#protocol_api_keys">Api Keys</a></h5>
<p>The following are the numeric codes that the ApiKey in the request can take for each of the below request types.</p>
<p>The following are the numeric codes that the ApiKey which last version is stable in the request can take for each of the below request types.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe stable ApiKey is good enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, If ApiKey only have last version, I agree that use stable ApiKey is good enough

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@m1a2st thanks for your patch

String html = ApiKeys.toHtml();
for (ApiKeys apiKeys : ApiKeys.clientApis()) {
if (apiKeys.messageType.latestVersionUnstable()) {
assertFalse(html.contains(apiKeys.name), "Html should not contain unstable api: " + apiKeys.name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use "The_Messages_" + apiKeys.name? that is more accurate. If the api name is "too" normal, it could be used by other APIs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your suggestion, I updated the test

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@chia7712 chia7712 merged commit 2bc5e01 into apache:trunk Jul 2, 2024
1 check failed
chirag-wadhwa5 pushed a commit to chirag-wadhwa5/kafka that referenced this pull request Jul 3, 2024
abhi-ksolves pushed a commit to ksolves/kafka that referenced this pull request Jul 31, 2024
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