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

   <!-- Make sure the base branch is `master`: that is the RocketMQ Studio 
trunk. -->
   
   ### Which Issue(s) This PR Fixes
   
   Trivial fix, no issue.
   
   ### Brief Description
   
   `AliyunInstanceProvider.normalizeDeliveryOrderType` mapped only `FIFO` and 
`ORDERLY` to the OpenAPI `Orderly` value and sent everything else as 
`Concurrently`. The console never submits those two spellings:
   
   - `web/src/pages/instance/consumer.tsx` (the 顺序类型 select, shown when 订阅组类型 
is FIFO) offers `PARTITON_ORDER` (分区顺序) and `MESSAGES_ORDER` (全局顺序), with 
`PARTITON_ORDER` as the initial value.
   - `web/src/utils/resourceCsvImport.ts` accepts `PARTITON_ORDER`, 
`PARTITION_ORDER` and `MESSAGES_ORDER`.
   - `docs/api-spec.md` documents the field as `PARTITON_ORDER` / 
`MESSAGES_ORDER`.
   
   So every ordered consumer group created on an Aliyun instance was submitted 
as `deliveryOrderType=Concurrently`, together with `DefaultRetryPolicy` instead 
of the `FixedRetryPolicy` the ordered branch selects. The ordering guarantee 
was silently dropped and nothing surfaced an error - the group is created 
successfully, it just does not do what the form said.
   
   `TencentInstanceProvider#isOrderly`, which reads the same 
`ConsumerGroupVO.deliveryOrderType`, already classified these values correctly 
because it matches on the `ORDER` substring. This aligns the Aliyun adapter 
with that rule so the two vendors cannot disagree about the same input.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -o test -Dtest=AliyunInstanceProviderTest 
-DfailIfNoTests=false
   [INFO] Tests run: 37, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   
   mvn -o checkstyle:check
   (exit 0)
   ```
   
   Two tests were added:
   
   - `createConsumerGroupShouldKeepPartitionOrderedGroupsOrderlyTest` drives 
`createConsumerGroup` with the value the form actually submits and asserts the 
captured `CreateConsumerGroupRequest` carries `Orderly` plus `FixedRetryPolicy` 
/ `fixedIntervalRetryTime=10`.
   - `normalizeDeliveryOrderTypeShouldMapConsoleOrderTypesToOrderlyTest` covers 
`PARTITON_ORDER`, `MESSAGES_ORDER`, `PARTITION_ORDER`, a lower-case and a 
padded spelling, and keeps `Concurrently` / blank on the default branch.
   
   Both were mutation-checked: reverting the one-line condition to 
`"FIFO".equalsIgnoreCase(value) || "ORDERLY".equalsIgnoreCase(value)` makes 
exactly these two fail (`expected: "Orderly" but was: "Concurrently"`) while 
the other 35 stay green.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no UI text added)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header (no new files)
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


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