lizhimins commented on PR #4896: URL: https://github.com/apache/rocketmq-dashboard/pull/4896#issuecomment-5845588771
The REST half is correct and verified: `TopicVO.java:33-34` are primitive ints, `RocketMQAdminClientImpl.java:377-384` replaces any non-positive count with the broker's value or 8, and `TopicController.java:87-92` uses `@Valid`, so the new `@NotNull` really does return 400. Three things block it. 1. Contract layer. Your premise is that 0 is a legal drain-to-zero value, but the same operation's tool entry point still forbids it: `tool-catalog/tools/topic.yaml:311` (`rmq.topic.update`) declares `minimum: 1` for both counts at `:344` and `:347`, mirrored in `rmqctl/internal/catalog/catalog_gen.go:670-671`. That schema is enforced at runtime by `ToolSchemaValidator` (JSON Schema 2020-12) and `TopicUpdateInput` carries no bean-validation annotation, so after this PR REST accepts 0 while the tool path rejects it. Please drop the minimum to 0 and regenerate (`make -C rmqctl catalog-generate`, then `catalog-verify`; `CONTRIBUTING.md:133-135`). 2. Test naming: the four new methods must end in `Test` (PR template, line 25) — `updateTopicShouldRejectMissingQueueCounts`, `updateTopicShouldForwardExplicitZeroQueueCounts`, `updateTopicUsesExplicitQueueCountsForPermissionChanges`, `updateTopicAppliesExplicitZeroQueueCounts`. 3. `AdminClient.updateTopic` is a public interface method whose meaning changes from "0 = leave unchanged" to "0 = clear", and only the REST DTO enforces non-omission: `schema.sql:130-131` leave the columns nullable, `RmqTopic.java:41,43` are nullable `Integer`s and `RocketMQMetadataProvider.java:203-204` folds NULL to 0, so such a row forwards 0 as if it were the current value. Please document that. Finally, #4772 is the same fix and still open, so only one can land; §5.4 of `docs/api-spec.md` is now at `:821-822`, so a rebase is needed either way. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
