Repository navigation
chore(deps): bump go-flashduty to main — surface investigation target purpose - #223
Closed
flashduty[bot] wants to merge 1 commit into
Closed
flashduty[bot] wants to merge 1 commit into
flashduty[bot] wants to merge 1 commit into
Conversation
…n target purpose)
Contributor
|
Superseded: #224 already bumped go-flashduty to v0.15.15, which contains the investigation target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
通过 CLI 写入告警规则时,
investigation_targets[].purpose会被静默丢弃(服务端 monit-webapi 支持该字段并会持久化)。复现:
--data提交一条带investigation_targets[].purpose的规则(create 或 update 均可);rule-v2-info读回,target 只剩kind/query(或dashboard)/time_range,purpose不见了;rule-audit-detail)里同样没有purpose—— 说明它在离开客户端之前就被裁掉了。另外两条佐证(本地实测):
purpose里塞控制字符(服务端校验必然拒绝):创建依然成功 ⇒ 该字段根本没到服务端。根因
CLI 的请求体由 SDK 类型反射生成(见
internal/cmd/cligen),而go.mod固定的github.com/flashcatcloud/go-flashduty@v0.15.14的模型里没有Purpose字段。该字段已在 SDK main 落地(flashcatcloud/go-flashduty#96feat/investigation-target-purpose),但尚无新 tag,所以这里只能先 bump 到 main 的伪版本。改动
go.mod/go.sum:go-flashduty v0.15.14→v0.15.15-0.20261010142149-a2783aa8de6dgo run ./internal/cmd/cligen(39 services / 361 commands)purpose字段说明(zz_generated_alert_rules.go、zz_generated_response_help.go)共 4 个文件、+16/−9。
验证
go build ./...通过make fmt通过;make check-cards通过(无需同步 skill 卡片)go test ./...:仅TestRootAutoUpdateCheckTimeoutWarnsAfterCommand失败;把本次改动 stash 掉后在 main 原状下同样失败,属既有失败,与本次改动无关后续
SDK 打 tag 之后可以把伪版本换成正式版本(
go get github.com/flashcatcloud/go-flashduty@vX.Y.Z),无需其它改动。