Skip to content

Commit

Permalink
feat: update proto to v0.4.22
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Sep 22, 2024
1 parent 52aa741 commit 93eafb0
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 19 deletions.
12 changes: 12 additions & 0 deletions app/sephirah/internal/data/internal/converter/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/sephirah/internal/data/tiphereth.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ func (t tipherethRepo) ListPorterGroups(
GlobalName: p.GlobalName,
Regions: []string{p.Region},
ContextJSONSchema: p.ContextJSONSchema,
FeatureSummary: p.FeatureSummary,
}
} else {
pgm[p.GlobalName].Regions = append(pgm[p.GlobalName].Regions, p.Region)
Expand Down
3 changes: 1 addition & 2 deletions app/sephirah/internal/model/converter/biz_to_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
type toPBConverter interface { //nolint:unused // used by generator
ToPBTimeRange(*model.TimeRange) *librarian.TimeRange
ToPBInternalIDList([]model.InternalID) []*librarian.InternalID
ToPBServerFeatureSummary(*modelsupervisor.ServerFeatureSummary) *pb.ServerFeatureSummary
ToPBServerFeatureSummary(*modelsupervisor.ServerFeatureSummary) *librarian.FeatureSummary
ToPBFeatureFlag(*modelsupervisor.FeatureFlag) *librarian.FeatureFlag
ToPBFeatureFlagList([]*modelsupervisor.FeatureFlag) []*librarian.FeatureFlag
ToPBFeatureRequest(*modelsupervisor.FeatureRequest) *librarian.FeatureRequest
Expand Down Expand Up @@ -73,7 +73,6 @@ type toPBConverter interface { //nolint:unused // used by generator
ToPBAccount(*modeltiphereth.Account) *librarian.Account
ToPBAccountList([]*modeltiphereth.Account) []*librarian.Account

// goverter:ignore FeatureSummary
// goverter:autoMap PorterInstance
ToPBPorter(*modelsupervisor.PorterInstanceController) *pb.Porter
ToPBPorterList([]*modelsupervisor.PorterInstanceController) []*pb.Porter
Expand Down
53 changes: 41 additions & 12 deletions app/sephirah/internal/model/converter/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions app/sephirah/internal/model/converter/pb_to_biz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/tuihub/librarian/internal/lib/libauth"
"github.com/tuihub/librarian/internal/model"
"github.com/tuihub/librarian/internal/model/modelfeed"
porter "github.com/tuihub/protos/pkg/librarian/porter/v1"
pb "github.com/tuihub/protos/pkg/librarian/sephirah/v1"
librarian "github.com/tuihub/protos/pkg/librarian/v1"

Expand All @@ -33,7 +32,7 @@ import (
// goverter:extend DurationPBToDuration
type toBizConverter interface { //nolint:unused // used by generator
ToBizTimeRange(*librarian.TimeRange) *model.TimeRange
ToBizPorterFeatureSummary(*porter.PorterFeatureSummary) *modelsupervisor.PorterFeatureSummary
ToBizPorterFeatureSummary(*librarian.FeatureSummary) *modelsupervisor.PorterFeatureSummary
ToBizFeatureFlag(*librarian.FeatureFlag) *modelsupervisor.FeatureFlag
ToBizFeatureRequest(*librarian.FeatureRequest) *modelsupervisor.FeatureRequest
// goverter:enum:unknown AccountAppRelationTypeUnspecified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ type PorterFeatureSummary struct {
FeedSources []*FeatureFlag `json:"feed_sources"`
NotifyDestinations []*FeatureFlag `json:"notify_destinations"`
FeedItemActions []*FeatureFlag `json:"feed_item_actions"`
FeedGetters []*FeatureFlag `json:"feed_getters"`
FeedSetters []*FeatureFlag `json:"feed_setters"`
}

type FeatureFlag struct {
Expand Down Expand Up @@ -76,6 +78,8 @@ type ServerFeatureSummary struct {
FeedSources []*FeatureFlag
NotifyDestinations []*FeatureFlag
FeedItemActions []*FeatureFlag
FeedSetters []*FeatureFlag
FeedGetters []*FeatureFlag
}

type PorterConnectionStatus int
Expand Down Expand Up @@ -122,6 +126,7 @@ type PorterGroup struct {
GlobalName string
Regions []string
ContextJSONSchema string
FeatureSummary *PorterFeatureSummary
}

type ServerFeatureSummaryMap struct {
Expand Down
1 change: 1 addition & 0 deletions app/sephirah/internal/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func (s *Supervisor) RefreshAliveInstances( //nolint:gocognit,funlen // TODO
s.instanceController.Range(func(address string, ctl modelsupervisor.PorterInstanceController) bool {
var ins *modelsupervisor.PorterInstance
if ins, err = s.instanceCache.Get(ctx, address); err != nil ||
ins == nil ||
ins.Status != modeltiphereth.UserStatusActive {
return true
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/redis/go-redis/v9 v9.6.1
github.com/sony/sonyflake v1.2.0
github.com/stretchr/testify v1.9.0
github.com/tuihub/protos v0.4.21
github.com/tuihub/protos v0.4.22
github.com/zhihu/norm v0.1.11
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,8 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tuihub/protos v0.4.21 h1:G/Apuh9sCMiKeVZ2O5ohDLlO/tOgXpA6/+x07f3yxas=
github.com/tuihub/protos v0.4.21/go.mod h1:lmf29LH3wf7Fb0in47Q/ar2qf2V7ogckV6dnlBrsZ1I=
github.com/tuihub/protos v0.4.22 h1:HtbZSsA8/t1vzWXYKGqRIU07mVEn8v3mrbsllNAON6c=
github.com/tuihub/protos v0.4.22/go.mod h1:lmf29LH3wf7Fb0in47Q/ar2qf2V7ogckV6dnlBrsZ1I=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/tylertreat/BoomFilters v0.0.0-20181028192813-611b3dbe80e8/go.mod h1:OYRfF6eb5wY9VRFkXJH8FFBi3plw2v+giaIu7P054pM=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
Expand Down

0 comments on commit 93eafb0

Please sign in to comment.