v6: groups/UserType spells db_env_user as db_end_user, and is an unreferenced duplicate
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- api, authorization
調査の方向性
io/weaviate/client6/v1/api/rbac/groups/UserType.java から始め、rbac/users/UserType と比較します。報告された src/ 全体に対する grep を使って groups enum が参照されているか確認し、その後、選択した修正または削除が public API とサーバー値 db_env_user に一致することを確認します。重複と wire-value の動作が一貫して解決されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
rbac/groups/UserType spells one of its wire values db_end_user. The server's value is db_env_user — env, not end. So DB_ENV_USER can never be produced by a read, and writing it would emit a value the server rejects.
It is also unreferenced, which is almost certainly why the typo survived: nothing in src/main, src/test or src/it uses this enum. That makes it a latent defect rather than a live one, and it may be that the right fix is deletion rather than a correction — see below.
Where it comes from
io/weaviate/client6/v1/api/rbac/groups/UserType.java (6.3.1) — the whole file:
public enum UserType {
@SerializedName("db_user")
DB_USER,
@SerializedName("db_end_user") // <-- server value is db_env_user
DB_ENV_USER,
@SerializedName("oidc")
OIDC
}
The server's enumeration, entities/models/d_b_user_info.go:142:
if err := json.Unmarshal([]byte(`["db_user","db_env_user"]`), &res); err != nil {
The constant is named DB_ENV_USER, so the intent was clearly db_env_user; only the string is wrong.
It is a duplicate, not the live one
There are two public UserType enums in sibling packages:
| used by | db_env_user |
|
|---|---|---|
rbac/users/UserType |
UserAssignment, GetAssignedRolesRequest, DbUsersClient, NamespacedUsersClient, RbacITest |
via @SerializedName(value = "db", alternate = "db_env_user") |
rbac/groups/UserType |
nothing | db_end_user — wrong |
grep -rn "UserType" src/ returns the users copy everywhere and the groups copy nowhere. (GroupType, in the same package, is used — this is not a case of the whole package being dead.)
Suggested fix
Two options, and I do not want to presume which you want:
-
Delete
rbac/groups/UserType. It is an unreferenced duplicate of a type that already exists and already handles this value correctly. The typo is evidence that nothing has ever exercised it. This removes a trap for whoever wires up the groups client next — they would reach for the enum in their own package and get the broken one. It is a public type, so removing it is a breaking change on paper, even though nothing inside the client can be broken by it. -
Correct the string to
db_env_user. Safe and non-breaking, but leaves two divergent copies of the same concept in the tree, which is how this happened.
The attached PR does (2), as the lower-risk default. Say the word and I will switch it to (1).
Version
- java-client 6.3.1
- Weaviate 1.39.0
- 主要言語
- Java
- スター
- 34
- フォーク
- 30
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
weaviate/java-client のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
weaviate/java-client#621 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
weaviate/java-client#619 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
weaviate/java-client#615 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
weaviate/java-client#607 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
weaviate/java-client#603 ·
weaviate/java-client の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
infinispan/infinispan#18150 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
opensearch-project/k-NN#3597 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100