iloveeyjafjalla opened a new pull request, #6867:
URL: https://github.com/apache/rocketmq-dashboard/pull/6867

   Fixes #6866
   
   ## The defect
   
   The DLQ query tool has two modes and drops input that cannot apply to the 
selected one without a word — `--search` belongs to the group listing, 
`--start-time`/`--end-time` to the message listing — and the message listing 
silently narrows itself to one hour when no start time is given 
(`RocketMQDLQProvider.listMessages:334-338`: `begin = startTime ?? end - 
ONE_HOUR_MILLIS`). The four input properties carried no description at all, so 
`--help` rendered them as bare names (`--search string   search`) and an MCP 
client received nothing else.
   
   ## The fix
   
   The properties now state what applies where, in which unit, and what an 
omitted window means:
   
   ```
   $ rmqctl message query-dlq --help
         --end-time int        Epoch milliseconds. Message listing only; 
defaults to now.
         --group-name string   Dead-letter group whose messages are listed; 
omit it to list the dead-letter groups instead.
         --search string       Group name filter for the group listing; it has 
no effect once groupName is given.
         --start-time int      Epoch milliseconds. Message listing only; 
defaults to one hour before endTime, so an omitted window returns the last hour 
of dead letters.
   ```
   
   These strings are the whole contract for MCP callers: the schema is what 
`--help`, `explain` and the tool discovery endpoint render. A payload-level 
disclosure of the effective window would be the stronger fix, but it needs the 
provider's default to travel back through the service and the output contract — 
this change makes the contract honest first.
   
   ## Tests
   
   Red without it — the usage strings were the flag names themselves:
   
   ```
   --- FAIL: TestQueryDlqDeclaresHowItsFiltersApply
       catalog_docs_test.go:64: groupName usage = "group name", want it to 
mention "omit it to list the dead-letter groups instead"
       catalog_docs_test.go:64: search usage = "search", want it to mention "it 
has no effect once groupName is given"
       catalog_docs_test.go:64: time.startTime usage = "start time", want it to 
mention "defaults to one hour before endTime"
       catalog_docs_test.go:64: time.endTime usage = "end time", want it to 
mention "Message listing only"
   ```
   
   Green after, with the generated catalog regenerated and every gate:
   
   ```
   go test ./...                     ok
   gofmt -l cmd internal             (no output)
   catalog-verify (generate -check)  exit 0
   [INFO] Tests run: 12, Failures: 0, Errors: 0 -- ToolCatalogTest, 
ToolSchemaValidatorTest, MessageQueryDlqToolHandlerTest, 
ToolOutputSchemaContractTest
   [INFO] You have 0 Checkstyle violations.
   ```
   


-- 
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]

Reply via email to