Fix deprecated warning double-formatting on localized clients

This commit is contained in:
世界
2026-04-07 20:53:53 +08:00
parent 2df43e4d1b
commit 4806d5e588
4 changed files with 48 additions and 13 deletions

View File

@@ -1063,9 +1063,12 @@ func (s *StartedService) GetDeprecatedWarnings(ctx context.Context, empty *empty
return &DeprecatedWarnings{
Warnings: common.Map(notes, func(it deprecated.Note) *DeprecatedWarning {
return &DeprecatedWarning{
Message: it.Message(),
Impending: it.Impending(),
MigrationLink: it.MigrationLink,
Message: it.Message(),
Impending: it.Impending(),
MigrationLink: it.MigrationLink,
Description: it.Description,
DeprecatedVersion: it.DeprecatedVersion,
ScheduledVersion: it.ScheduledVersion,
}
}),
}, nil

View File

@@ -1709,12 +1709,15 @@ func (x *DeprecatedWarnings) GetWarnings() []*DeprecatedWarning {
}
type DeprecatedWarning struct {
state protoimpl.MessageState `protogen:"open.v1"`
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Impending bool `protobuf:"varint,2,opt,name=impending,proto3" json:"impending,omitempty"`
MigrationLink string `protobuf:"bytes,3,opt,name=migrationLink,proto3" json:"migrationLink,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Impending bool `protobuf:"varint,2,opt,name=impending,proto3" json:"impending,omitempty"`
MigrationLink string `protobuf:"bytes,3,opt,name=migrationLink,proto3" json:"migrationLink,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
DeprecatedVersion string `protobuf:"bytes,5,opt,name=deprecatedVersion,proto3" json:"deprecatedVersion,omitempty"`
ScheduledVersion string `protobuf:"bytes,6,opt,name=scheduledVersion,proto3" json:"scheduledVersion,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeprecatedWarning) Reset() {
@@ -1768,6 +1771,27 @@ func (x *DeprecatedWarning) GetMigrationLink() string {
return ""
}
func (x *DeprecatedWarning) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *DeprecatedWarning) GetDeprecatedVersion() string {
if x != nil {
return x.DeprecatedVersion
}
return ""
}
func (x *DeprecatedWarning) GetScheduledVersion() string {
if x != nil {
return x.ScheduledVersion
}
return ""
}
type StartedAt struct {
state protoimpl.MessageState `protogen:"open.v1"`
StartedAt int64 `protobuf:"varint,1,opt,name=startedAt,proto3" json:"startedAt,omitempty"`
@@ -1990,11 +2014,14 @@ const file_daemon_started_service_proto_rawDesc = "" +
"\x16CloseConnectionRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"K\n" +
"\x12DeprecatedWarnings\x125\n" +
"\bwarnings\x18\x01 \x03(\v2\x19.daemon.DeprecatedWarningR\bwarnings\"q\n" +
"\bwarnings\x18\x01 \x03(\v2\x19.daemon.DeprecatedWarningR\bwarnings\"\xed\x01\n" +
"\x11DeprecatedWarning\x12\x18\n" +
"\amessage\x18\x01 \x01(\tR\amessage\x12\x1c\n" +
"\timpending\x18\x02 \x01(\bR\timpending\x12$\n" +
"\rmigrationLink\x18\x03 \x01(\tR\rmigrationLink\")\n" +
"\rmigrationLink\x18\x03 \x01(\tR\rmigrationLink\x12 \n" +
"\vdescription\x18\x04 \x01(\tR\vdescription\x12,\n" +
"\x11deprecatedVersion\x18\x05 \x01(\tR\x11deprecatedVersion\x12*\n" +
"\x10scheduledVersion\x18\x06 \x01(\tR\x10scheduledVersion\")\n" +
"\tStartedAt\x12\x1c\n" +
"\tstartedAt\x18\x01 \x01(\x03R\tstartedAt*U\n" +
"\bLogLevel\x12\t\n" +

View File

@@ -221,6 +221,9 @@ message DeprecatedWarning {
string message = 1;
bool impending = 2;
string migrationLink = 3;
string description = 4;
string deprecatedVersion = 5;
string scheduledVersion = 6;
}
message StartedAt {

View File

@@ -574,8 +574,10 @@ func (c *CommandClient) GetDeprecatedNotes() (DeprecatedNoteIterator, error) {
var notes []*DeprecatedNote
for _, warning := range warnings.Warnings {
notes = append(notes, &DeprecatedNote{
Description: warning.Message,
MigrationLink: warning.MigrationLink,
Description: warning.Description,
DeprecatedVersion: warning.DeprecatedVersion,
ScheduledVersion: warning.ScheduledVersion,
MigrationLink: warning.MigrationLink,
})
}
return newIterator(notes), nil