You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Frun1na (via GitHub)" <gi...@apache.org> on 2026/09/21 17:54:50 UTC

[I] [Bug] Audit mock and the cluster contract test pin values the backend never sends [rocketmq-dashboard]

Frun1na opened a new issue, #4788:
URL: https://github.com/apache/rocketmq-dashboard/issues/4788

   ### Before Creating the Bug Report
   
   - [x] Searched open and closed issues/PRs and checked related diffs.
   - [x] This concerns RocketMQ Studio.
   - [x] The exact inspected version and runtime scope are stated below.
   
   ### Studio Version
   
   `rocketmq-studio` at `4c697f07acde460e2344375cb1f82669f5b270fd`.
   
   ### Runtime Environment
   
   Source inspection of the frontend test fixtures against the backend sources; no live backend
   required.
   
   ### Summary
   
   Two test-only fixtures pin values the backend never sends, so the tests assert a contract the API
   does not have (and mock mode offers filter options for operations that cannot exist):
   
   1. **`web/src/mock/audit.ts`** carries `RESTART_BROKER` rows (no producer anywhere in
      `server/src/main/java` — the operation is absent from `OperationAuditConstants` and from every
      `auditService.record(...)` call), `UPDATE_ACL` + resourceType `TOPIC` (ACL changes are recorded
      as `*_ACL_RULE` against `ACL_RULE`, `AclService.java:117,158,172`), and
      `UPDATE_BROKER_CONFIG` + resourceType `CLUSTER` (recorded against `BROKER`,
      `RocketMQBrokerConfigService.java:94`). `getMockAuditFilterOptions` derives the audit page's
      filter options from these rows, so mock mode offers filters for operations nothing can produce.
   2. **`web/src/api/clusterContract.test.ts`** pins `status: 'RUNNING'` on the cluster, broker,
      proxy and NameServer, while `ClusterStatus` serializes as
      `healthy/warning/error/offline` and `BrokerStatus` as `running/readonly/maintenance` — the
      contract test pins a value the API never serializes.
   
   ### Expected
   
   Test fixtures and mocks should pin the values the backend actually records/serializes, per the
   same rationale as #4733 (mock fixtures teaching the old contract kept the rendering bug alive).
   
   ### Reproduction
   
   `grep -n "RESTART_BROKER" web/src/mock/audit.ts` (fixture rows) vs
   `grep -rn "RESTART_BROKER" server/src/main/java` (zero hits); same for `UPDATE_ACL` and
   `'RUNNING'` in the two fixture files.
   
   Fix: PR #4787.
   


-- 
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@rocketmq.apache.org.apache.org

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


Re: [I] [Bug] Audit mock and the cluster contract test pin values the backend never sends [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #4788: [Bug] Audit mock and the cluster contract test pin values the backend never sends
URL: https://github.com/apache/rocketmq-dashboard/issues/4788


-- 
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@rocketmq.apache.org

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


Re: [I] [Bug] Audit mock and the cluster contract test pin values the backend never sends [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4788:
URL: https://github.com/apache/rocketmq-dashboard/issues/4788#issuecomment-5881198881

   This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.


-- 
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@rocketmq.apache.org

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


Re: [I] [Bug] Audit mock and the cluster contract test pin values the backend never sends [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4788:
URL: https://github.com/apache/rocketmq-dashboard/issues/4788#issuecomment-5765170874

   ## Evaluation
   
   **Classification:** Bug — test fixtures out of sync with backend contract
   **Severity:** LOW-MEDIUM
   **Status:** ✅ Confirmed
   
   ### Verification
   
   Code references verified against `rocketmq-studio @ 4c697f07`:
   
   1. **`RESTART_BROKER`** in `web/src/mock/audit.ts` (lines 83, 157, 230) — `grep -rn RESTART_BROKER server/src/main/java` returns zero hits. The operation does not exist in `OperationAuditConstants` or any `auditService.record(...)` call.
   2. **`UPDATE_ACL`** in mock (lines 71, 132, 206) — backend records as `UPDATE_ACL_RULE` (`AclService.java:158`) and `UPDATE_ACL_USER` (`AclService.java:258`), not `UPDATE_ACL`. Resource type mismatch: mock uses `TOPIC`, backend uses `ACL_RULE`.
   3. **`RUNNING`** in `web/src/api/clusterContract.test.ts` (lines 31, 37, 47, 53) — backend `ClusterStatus` serializes as `healthy/warning/error/offline`, `BrokerStatus` as `running/readonly/maintenance`. `RUNNING` is never serialized.
   
   ### Impact
   
   - Mock mode offers filter options for operations that cannot exist, misleading UI testing.
   - Contract test asserts values the API never produces, giving false confidence in serialization correctness.
   
   ### Associated PR
   
   PR #4787 (by @Frun1na) — test fix: pin mock and contract values to what the backend actually records.
   
   ---
   *Evaluated by github-manager bot*


-- 
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@rocketmq.apache.org

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