You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "jiangpengcheng (via GitHub)" <gi...@apache.org> on 2024/01/05 02:52:31 UTC

[PR] [Improve] Implement GetTopicAutoCreation [pulsar-client-go]

jiangpengcheng opened a new pull request, #1151:
URL: https://github.com/apache/pulsar-client-go/pull/1151

   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   *(If this PR fixes a github issue, please add `Fixes #<xyz>`.)*
   
   Fixes #<xyz>
   
   *(or if this PR is one task of a github issue, please add `Master Issue: #<xyz>` to link to the master issue.)*
   
   Master Issue: #<xyz>
   
   ### Motivation
   
   The `GetTopicAutoCreation` endpoint is missed, needs to add it
   
   ### Modifications
   
   Implement the `GetTopicAutoCreation` method
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   - [x] This change is a trivial rework / code cleanup without any test coverage.
   
   ### 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? 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve] Implement GetTopicAutoCreation [pulsar-client-go]

Posted by "RobertIndie (via GitHub)" <gi...@apache.org>.
RobertIndie merged PR #1151:
URL: https://github.com/apache/pulsar-client-go/pull/1151


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve] Implement GetTopicAutoCreation [pulsar-client-go]

Posted by "jiangpengcheng (via GitHub)" <gi...@apache.org>.
jiangpengcheng commented on PR #1151:
URL: https://github.com/apache/pulsar-client-go/pull/1151#issuecomment-1878079028

   @RobertIndie There are no tests for the `namespaces`(and other modules) at all, we may need a PIP to setup the tests structure first


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve] Implement GetTopicAutoCreation [pulsar-client-go]

Posted by "jiangpengcheng (via GitHub)" <gi...@apache.org>.
jiangpengcheng commented on code in PR #1151:
URL: https://github.com/apache/pulsar-client-go/pull/1151#discussion_r1442453267


##########
pulsaradmin/pkg/utils/topic_auto_creation_config.go:
##########
@@ -20,5 +20,5 @@ package utils
 type TopicAutoCreationConfig struct {
 	Allow      bool      `json:"allowAutoTopicCreation"`
 	Type       TopicType `json:"topicType"`
-	Partitions int       `json:"defaultNumPartitions"`
+	Partitions *int      `json:"defaultNumPartitions"`

Review Comment:
   it's not allowed to pass the `partitions` argument when the type is `non-partitioned`, so need to set this as a pointer



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve] Implement GetTopicAutoCreation [pulsar-client-go]

Posted by "RobertIndie (via GitHub)" <gi...@apache.org>.
RobertIndie commented on PR #1151:
URL: https://github.com/apache/pulsar-client-go/pull/1151#issuecomment-1878106647

   > @RobertIndie There are no tests for the `namespaces`(and other modules) at all, we may need a PIP to setup the tests structure first
   
   I don't think we need a PIP for that. We can utilize the existing testing framework. Seems that you can just create a test go file and write the test. I have created a PR to show how to do it: https://github.com/apache/pulsar-client-go/pull/1152
   
   Then you can refer to these scripts to run the tests: https://github.com/apache/pulsar-client-go/tree/master/scripts . It will run in the CI: https://github.com/apache/pulsar-client-go/blob/master/.github/workflows/ci.yml#L50 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Improve] Implement GetTopicAutoCreation [pulsar-client-go]

Posted by "jiangpengcheng (via GitHub)" <gi...@apache.org>.
jiangpengcheng commented on PR #1151:
URL: https://github.com/apache/pulsar-client-go/pull/1151#issuecomment-1878188416

   I see, there will be a pulsar instance for testing, added some tests for topic auto-creation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org