fix(ai): add @AdminOnlyTag to SYNC_AI_METADATA to hide internal system tag#3354
fix(ai): add @AdminOnlyTag to SYNC_AI_METADATA to hide internal system tag#3354MatheMatrix wants to merge 1 commit into5.5.6from
Conversation
…m tag from non-admin users ZSTAC-74908 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
概览两个查询构建器类现在在排序时添加了 UUID 作为次级排序字段。当按非 UUID 字段排序时,会自动追加 UUID ASC 作为平局断路器;当未指定排序且非计数查询时,添加默认的 UUID ASC 排序。 变更
预期代码审查工作量🎯 2 (简单) | ⏱️ ~10 分钟 诗歌
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 3 warnings)
✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@search/src/main/java/org/zstack/query/MysqlQueryBuilderImpl3.java`:
- Around line 736-741: Replace the Chinese comments in MysqlQueryBuilderImpl3
near the code that appends ordering (the block using variables ret, entityName,
msg.getSortBy(), msg.getSortDirection(), and msg.isCount()) with English
comments; specifically change the comment at the branch that adds uuid as a
tiebreaker to something like "append uuid as tiebreaker to ensure stable
ordering" and change the comment at the branch that adds default ordering when
no sort field is provided to something like "add default ordering by uuid when
no sort field is specified."
In `@search/src/main/java/org/zstack/query/QueryFacadeImpl.java`:
- Around line 489-494: Replace the Chinese comments on the block that appends
ordering to the query with English comments: change the comment before the
sb.add(String.format("order by %s %s, uuid asc", msg.getSortBy(),
msg.getSortDirection())) to something like "add uuid as a tiebreaker to ensure
stable ordering" and change the comment before the sb.add("order by uuid asc")
in the !msg.isCount() branch to "apply default ordering when no sort field
provided"; locate these near the code that calls sb.add and references
msg.getSortBy(), msg.getSortDirection(), and msg.isCount() and update only the
comment text to English.
| // 追加 uuid 作为 tiebreaker,确保排序稳定 | ||
| ret = String.format("%s order by %s.%s %s, %s.uuid ASC", ret, entityName, msg.getSortBy(), msg.getSortDirection().toUpperCase(), entityName); | ||
| } | ||
| } else if (!msg.isCount()) { | ||
| // 无排序字段时添加默认排序 | ||
| ret = String.format("%s order by %s.uuid ASC", ret, entityName); |
There was a problem hiding this comment.
注释应使用英文,不应包含中文。
根据编码规范,代码中不应有中文,包括注释。请将第 736 行和第 740 行的中文注释改为英文。
建议修复
} else {
- // 追加 uuid 作为 tiebreaker,确保排序稳定
+ // Append uuid as tiebreaker to ensure stable sorting
ret = String.format("%s order by %s.%s %s, %s.uuid ASC", ret, entityName, msg.getSortBy(), msg.getSortDirection().toUpperCase(), entityName);
}
} else if (!msg.isCount()) {
- // 无排序字段时添加默认排序
+ // Add default sorting when no sortBy is specified
ret = String.format("%s order by %s.uuid ASC", ret, entityName);As per coding guidelines: "代码里不应当有有中文,包括报错、注释等都应当使用正确的、无拼写错误的英文来写"
🤖 Prompt for AI Agents
In `@search/src/main/java/org/zstack/query/MysqlQueryBuilderImpl3.java` around
lines 736 - 741, Replace the Chinese comments in MysqlQueryBuilderImpl3 near the
code that appends ordering (the block using variables ret, entityName,
msg.getSortBy(), msg.getSortDirection(), and msg.isCount()) with English
comments; specifically change the comment at the branch that adds uuid as a
tiebreaker to something like "append uuid as tiebreaker to ensure stable
ordering" and change the comment at the branch that adds default ordering when
no sort field is provided to something like "add default ordering by uuid when
no sort field is specified."
| // 追加 uuid 作为 tiebreaker,确保排序稳定 | ||
| sb.add(String.format("order by %s %s, uuid asc", msg.getSortBy(), msg.getSortDirection())); | ||
| } | ||
| } else if (!msg.isCount()) { | ||
| // 无排序字段时添加默认排序 | ||
| sb.add("order by uuid asc"); |
There was a problem hiding this comment.
注释应使用英文,不应包含中文。
根据编码规范,代码中不应有中文,包括注释。请将第 489 行和第 493 行的中文注释改为英文。
建议修复
} else {
- // 追加 uuid 作为 tiebreaker,确保排序稳定
+ // Append uuid as tiebreaker to ensure stable sorting
sb.add(String.format("order by %s %s, uuid asc", msg.getSortBy(), msg.getSortDirection()));
}
} else if (!msg.isCount()) {
- // 无排序字段时添加默认排序
+ // Add default sorting when no sortBy is specified
sb.add("order by uuid asc");As per coding guidelines: "代码里不应当有有中文,包括报错、注释等都应当使用正确的、无拼写错误的英文来写"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // 追加 uuid 作为 tiebreaker,确保排序稳定 | |
| sb.add(String.format("order by %s %s, uuid asc", msg.getSortBy(), msg.getSortDirection())); | |
| } | |
| } else if (!msg.isCount()) { | |
| // 无排序字段时添加默认排序 | |
| sb.add("order by uuid asc"); | |
| // Append uuid as tiebreaker to ensure stable sorting | |
| sb.add(String.format("order by %s %s, uuid asc", msg.getSortBy(), msg.getSortDirection())); | |
| } | |
| } else if (!msg.isCount()) { | |
| // Add default sorting when no sortBy is specified | |
| sb.add("order by uuid asc"); |
🤖 Prompt for AI Agents
In `@search/src/main/java/org/zstack/query/QueryFacadeImpl.java` around lines 489
- 494, Replace the Chinese comments on the block that appends ordering to the
query with English comments: change the comment before the
sb.add(String.format("order by %s %s, uuid asc", msg.getSortBy(),
msg.getSortDirection())) to something like "add uuid as a tiebreaker to ensure
stable ordering" and change the comment before the sb.add("order by uuid asc")
in the !msg.isCount() branch to "apply default ordering when no sort field
provided"; locate these near the code that calls sb.add and references
msg.getSortBy(), msg.getSortDirection(), and msg.isCount() and update only the
comment text to English.
Resolves: ZSTAC-74908
Target: 5.5.6
sync from gitlab !9184