zmuxuny opened a new pull request, #4499:
URL: https://github.com/apache/rocketmq-dashboard/pull/4499
### Which Issue(s) This PR Fixes
- Fixes #4498
### Brief Description
Aliyun's async SDK can complete normally while its response body reports a
failed business operation. Studio previously discarded mutation responses, so a
provider-side failure could be returned and audited as success.
This change validates the existing Aliyun business result before returning
from:
- Topic create / update / delete;
- Consumer Group create / delete;
- consumer-offset reset.
The validator requires `success=true`; resource mutations also require
`data=true`. Null/incomplete responses and unsuccessful business responses now
become HTTP-style 502 `BusinessException`s using the provider message/code when
available. Existing SDK exceptional completions still use
`AliyunClientFactory`'s established mapping.
No frontend/API shape, dependency, schema, or Tencent/Apache behavior
changes.
### Reproduction and Tests
Fail-before on unmodified `master@987b748e8f4f421c5cd3c4c4e51a064cc7e59f18`:
- added six provider regressions returning normally completed SDK futures
with `success=false`;
- `AliyunInstanceProviderTest`: **39 tests, exactly 6 failures**;
- every new failure was `Expecting code to raise a throwable`, proving all
six mutations were reported as success.
Green, Java 21:
- `mvn -B -ntp -Dtest=AliyunInstanceProviderTest test`
- **41/41 passed** after adding `success=true,data=false` and
null-response coverage.
- `mvn -B -ntp
-Dtest=AliyunInstanceProviderTest,AliyunClientFactoryTest,MetadataServiceTest
test`
- **103/103 passed**, 0 failures/errors.
- Checkstyle: **0 violations**.
- `mvn -B -ntp -DskipTests package`: **BUILD SUCCESS**.
- `git diff --check`: clean.
### Compatibility / Risk
The change is fail-closed only for Aliyun responses that already declare the
mutation unsuccessful or incomplete. Successful response contracts remain
unchanged. The main operational benefit is preventing false success/audit
records, especially for consumer-offset reset where a failed reset must not
look applied.
AI-assisted source audit and implementation; the response fields were
verified against the pinned `alibabacloud-rocketmq20220801:5.0.8` SDK and
fail-before behavior was reproduced before changing production code.
--
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]