Skip to content

Conversation

PratRanj07
Copy link
Contributor

Update DescribeConfigs api to version 4(first flexible version)

@PratRanj07 PratRanj07 requested a review from a team as a code owner September 22, 2025 15:16
@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 15:16
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates the Kafka DescribeConfigs API from version 1 to version 4, implementing KIP-482 to support flexible messaging format and add new configuration metadata fields.

  • Adds support for config type and documentation information in ConfigEntry structures
  • Updates request/response parsing to handle flexible version protocol with tagged fields
  • Exposes new public APIs for accessing config type and documentation

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/rdkafka.h Adds ConfigType enum and new public API functions for type and documentation
src/rdkafka_admin.h Extends ConfigEntry structure with type and documentation fields
src/rdkafka_admin.c Implements new API functions and updates response parsing for v4 protocol
src/rdkafka_request.c Updates request creation to use flexible version format and API v4
tests/0081-admin.c Updates test output to include new config type and documentation fields

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +3675 to 3678
int16_t api_version;

api_version = rd_kafka_buf_ApiVersion(reply);

Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The variable api_version should be declared at the point of initialization rather than separately. Consider combining the declaration and assignment: int16_t api_version = rd_kafka_buf_ApiVersion(reply);

Suggested change
int16_t api_version;
api_version = rd_kafka_buf_ApiVersion(reply);
int16_t api_version = rd_kafka_buf_ApiVersion(reply);

Copilot uses AI. Check for mistakes.

}

if (api_version >= 3) {
rd_kafka_buf_read_i8(reply, &config_type);
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The assignment to entry->type should cast config_type to rd_kafka_ConfigType_t for type safety, since config_type is declared as int8_t but the field expects rd_kafka_ConfigType_t.

Suggested change
rd_kafka_buf_read_i8(reply, &config_type);
entry->type = (rd_kafka_ConfigType_t)config_type;

Copilot uses AI. Check for mistakes.

*
* @param entry Entry to get type for.
*
* @remark The lifetime of the returned entry is the same as \p conf .
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The parameter reference \\p conf is incorrect. It should reference \\p entry since that's the actual parameter name for this function.

Copilot uses AI. Check for mistakes.

*
* @param entry Entry to get documentation for.
*
* @remark The lifetime of the returned entry is the same as \p conf .
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The parameter reference \\p conf is incorrect. It should reference \\p entry since that's the actual parameter name for this function.

Copilot uses AI. Check for mistakes.

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.

1 participant