Skip to content

feat(pulsaradmin): add offload policies API and tests#1512

Open
freeznet wants to merge 2 commits into
apache:masterfrom
freeznet:freeznet/offload-policy
Open

feat(pulsaradmin): add offload policies API and tests#1512
freeznet wants to merge 2 commits into
apache:masterfrom
freeznet:freeznet/offload-policy

Conversation

@freeznet

@freeznet freeznet commented Jun 11, 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

align pulsaradmin with broker namespace offload policies API; support namespace full offload config and applied topic get.

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

@freeznet freeznet self-assigned this Jun 11, 2026
Copilot AI review requested due to automatic review settings June 11, 2026 07:56

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 namespace- and topic-level Pulsar Admin APIs for managing offload policies, expands the OffloadPolicies model to cover additional broker/admin fields, and introduces unit tests validating the new JSON and REST behaviors.

Changes:

  • Expanded utils.OffloadPolicies with additional offload-related configuration fields (S3/GCS/filesystem/universal driver fields, extra configurations).
  • Added “applied” variants for topic offload policy retrieval to support fetching the effective policy.
  • Added namespace offload policy get/set/remove APIs and accompanying REST-level unit tests.

Reviewed changes

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

Show a summary per file
File Description
pulsaradmin/pkg/utils/offload_policies.go Extends the OffloadPolicies struct with additional JSON fields and initializes extra configuration maps in the constructor.
pulsaradmin/pkg/utils/offload_policies_test.go Adds serialization/deserialization coverage for newly added OffloadPolicies fields and makes JSON assertions order-insensitive.
pulsaradmin/pkg/admin/topic.go Adds topic APIs to retrieve offload policies with an applied option (effective policy) and wires the legacy getter through the new implementation.
pulsaradmin/pkg/admin/namespace.go Introduces namespace offload policy get/set/remove APIs, including optional JSON decoding behavior.
pulsaradmin/pkg/admin/offload_policies_test.go New tests validating topic “applied” query param behavior and namespace offload policies REST endpoints + null decoding.

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

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