Skip to content

feat(topic): add support for retrieving schema compatibility strategy with options#1469

Merged
freeznet merged 1 commit into
apache:masterfrom
freeznet:freeznet/allow-get-applied-policy
Mar 11, 2026
Merged

feat(topic): add support for retrieving schema compatibility strategy with options#1469
freeznet merged 1 commit into
apache:masterfrom
freeznet:freeznet/allow-get-applied-policy

Conversation

@freeznet

@freeznet freeznet commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #

(or if this PR is one task of a github issue, please add Master Issue: #<xyz> to link to the master issue.)

Master Issue: #

Motivation

Explain here the context, and why you're making that change. What is the problem you're trying to solve.

The current topic schema compatibility getter always returns the applied policy, which hides whether the value is explicitly configured on the topic or inherited from namespace or broker defaults. This change adds an explicit applied option so callers can request applied=false and retrieve the actual topic-level user configuration without breaking the existing default behavior.

Modifications

Describe the modifications you've done.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an API option to retrieve the non-applied (topic-level) schema compatibility strategy, while keeping the existing getters returning the applied (effective) strategy.

Changes:

  • Extended the Topics admin API with new methods that accept an applied flag for schema compatibility strategy retrieval.
  • Updated the existing GetSchemaCompatibilityStrategy* methods to preserve current behavior by defaulting to applied=true.
  • Expanded topic admin tests to validate applied vs non-applied behavior and added a unit test for response parsing.

Reviewed changes

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

File Description
pulsaradmin/pkg/admin/topic.go Adds new schema compatibility strategy getters with an applied flag and parses raw JSON-string responses.
pulsaradmin/pkg/admin/topic_test.go Adds coverage for applied vs non-applied retrieval and tests the new parsing helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pulsaradmin/pkg/admin/topic.go
Comment thread pulsaradmin/pkg/admin/topic.go
@freeznet freeznet changed the title feat(topic): add support for retrieving applied schema compatibility strategy feat(topic): add support for retrieving schema compatibility strategy with options Mar 10, 2026
@crossoverJie crossoverJie added this to the v0.19.0 milestone Mar 11, 2026
@freeznet freeznet merged commit 7832a7d into apache:master Mar 11, 2026
18 of 21 checks passed
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