From 655e54ecf81890e98ca93744966914a5a6a2adce Mon Sep 17 00:00:00 2001 From: Simon Tucker Date: Thu, 9 Jan 2020 16:09:01 -0800 Subject: [PATCH 1/2] Alerts on an empty config --- githubtasks.go | 21 +++++++ githubtasks_test.go | 2 +- githubtasksutils.go | 13 +++- proto/githubtasks.pb.go | 133 ++++++++++++++++++++++++++-------------- proto/githubtasks.proto | 4 ++ 5 files changed, 125 insertions(+), 48 deletions(-) diff --git a/githubtasks.go b/githubtasks.go index 8ed62ee5..fe44b9e2 100644 --- a/githubtasks.go +++ b/githubtasks.go @@ -10,12 +10,19 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" + pb "github.com/brotherlogic/githubtasks/proto" pbg "github.com/brotherlogic/goserver/proto" ) +const ( + // KEY where the config is stored + KEY = "/github.com/brotherlogic/githubtasks/config" +) + //Server main server type type Server struct { *goserver.GoServer + config *pb.Config } // Init builds the server @@ -53,6 +60,20 @@ func (s *Server) GetState() []*pbg.State { } } +func (s *Server) save(ctx context.Context) { + s.KSclient.Save(ctx, KEY, s.config) +} + +func (s *Server) load(ctx context.Context) error { + data, _, err := s.KSclient.Read(ctx, KEY, s.config) + if err != nil { + return err + } + + s.config = data.(*pb.Config) + return nil +} + func main() { var quiet = flag.Bool("quiet", false, "Show all output") flag.Parse() diff --git a/githubtasks_test.go b/githubtasks_test.go index 6b3299c8..5d6587dd 100644 --- a/githubtasks_test.go +++ b/githubtasks_test.go @@ -3,5 +3,5 @@ package main import "testing" func TestNothing(t *testing.T) { - dummy() + } diff --git a/githubtasksutils.go b/githubtasksutils.go index 19a10b69..0c8dc957 100644 --- a/githubtasksutils.go +++ b/githubtasksutils.go @@ -1,4 +1,15 @@ package main -func dummy() { +import ( + "fmt" + + "golang.org/x/net/context" +) + +func (s *Server) validateIntegrity(ctx context.Context) error { + if len(s.config.GetProjects()) == 0 { + s.RaiseIssue(ctx, "Task Issue", fmt.Sprintf("There are no projects listed"), false) + } + + return nil } diff --git a/proto/githubtasks.pb.go b/proto/githubtasks.pb.go index 0480d7ac..01dda5db 100644 --- a/proto/githubtasks.pb.go +++ b/proto/githubtasks.pb.go @@ -50,7 +50,7 @@ func (x Milestone_MilestoneState) String() string { } func (Milestone_MilestoneState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{1, 0} + return fileDescriptor_0d888ecb083325cf, []int{2, 0} } type Task_TaskState int32 @@ -78,7 +78,46 @@ func (x Task_TaskState) String() string { } func (Task_TaskState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{2, 0} + return fileDescriptor_0d888ecb083325cf, []int{3, 0} +} + +type Config struct { + Projects []*Project `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Config) Reset() { *m = Config{} } +func (m *Config) String() string { return proto.CompactTextString(m) } +func (*Config) ProtoMessage() {} +func (*Config) Descriptor() ([]byte, []int) { + return fileDescriptor_0d888ecb083325cf, []int{0} +} + +func (m *Config) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Config.Unmarshal(m, b) +} +func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Config.Marshal(b, m, deterministic) +} +func (m *Config) XXX_Merge(src proto.Message) { + xxx_messageInfo_Config.Merge(m, src) +} +func (m *Config) XXX_Size() int { + return xxx_messageInfo_Config.Size(m) +} +func (m *Config) XXX_DiscardUnknown() { + xxx_messageInfo_Config.DiscardUnknown(m) +} + +var xxx_messageInfo_Config proto.InternalMessageInfo + +func (m *Config) GetProjects() []*Project { + if m != nil { + return m.Projects + } + return nil } type Project struct { @@ -94,7 +133,7 @@ func (m *Project) Reset() { *m = Project{} } func (m *Project) String() string { return proto.CompactTextString(m) } func (*Project) ProtoMessage() {} func (*Project) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{0} + return fileDescriptor_0d888ecb083325cf, []int{1} } func (m *Project) XXX_Unmarshal(b []byte) error { @@ -150,7 +189,7 @@ func (m *Milestone) Reset() { *m = Milestone{} } func (m *Milestone) String() string { return proto.CompactTextString(m) } func (*Milestone) ProtoMessage() {} func (*Milestone) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{1} + return fileDescriptor_0d888ecb083325cf, []int{2} } func (m *Milestone) XXX_Unmarshal(b []byte) error { @@ -213,7 +252,7 @@ func (m *Task) Reset() { *m = Task{} } func (m *Task) String() string { return proto.CompactTextString(m) } func (*Task) ProtoMessage() {} func (*Task) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{2} + return fileDescriptor_0d888ecb083325cf, []int{3} } func (m *Task) XXX_Unmarshal(b []byte) error { @@ -273,7 +312,7 @@ func (m *AddProjectRequest) Reset() { *m = AddProjectRequest{} } func (m *AddProjectRequest) String() string { return proto.CompactTextString(m) } func (*AddProjectRequest) ProtoMessage() {} func (*AddProjectRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{3} + return fileDescriptor_0d888ecb083325cf, []int{4} } func (m *AddProjectRequest) XXX_Unmarshal(b []byte) error { @@ -311,7 +350,7 @@ func (m *AddProjectResponse) Reset() { *m = AddProjectResponse{} } func (m *AddProjectResponse) String() string { return proto.CompactTextString(m) } func (*AddProjectResponse) ProtoMessage() {} func (*AddProjectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{4} + return fileDescriptor_0d888ecb083325cf, []int{5} } func (m *AddProjectResponse) XXX_Unmarshal(b []byte) error { @@ -344,7 +383,7 @@ func (m *UpdateProjectRequest) Reset() { *m = UpdateProjectRequest{} } func (m *UpdateProjectRequest) String() string { return proto.CompactTextString(m) } func (*UpdateProjectRequest) ProtoMessage() {} func (*UpdateProjectRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{5} + return fileDescriptor_0d888ecb083325cf, []int{6} } func (m *UpdateProjectRequest) XXX_Unmarshal(b []byte) error { @@ -390,7 +429,7 @@ func (m *UpdateProjectResponse) Reset() { *m = UpdateProjectResponse{} } func (m *UpdateProjectResponse) String() string { return proto.CompactTextString(m) } func (*UpdateProjectResponse) ProtoMessage() {} func (*UpdateProjectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{6} + return fileDescriptor_0d888ecb083325cf, []int{7} } func (m *UpdateProjectResponse) XXX_Unmarshal(b []byte) error { @@ -432,7 +471,7 @@ func (m *AddTaskRequest) Reset() { *m = AddTaskRequest{} } func (m *AddTaskRequest) String() string { return proto.CompactTextString(m) } func (*AddTaskRequest) ProtoMessage() {} func (*AddTaskRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{7} + return fileDescriptor_0d888ecb083325cf, []int{8} } func (m *AddTaskRequest) XXX_Unmarshal(b []byte) error { @@ -492,7 +531,7 @@ func (m *AddTaskResponse) Reset() { *m = AddTaskResponse{} } func (m *AddTaskResponse) String() string { return proto.CompactTextString(m) } func (*AddTaskResponse) ProtoMessage() {} func (*AddTaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d888ecb083325cf, []int{8} + return fileDescriptor_0d888ecb083325cf, []int{9} } func (m *AddTaskResponse) XXX_Unmarshal(b []byte) error { @@ -523,6 +562,7 @@ func (m *AddTaskResponse) GetTask() *Task { func init() { proto.RegisterEnum("githubtasks.Milestone_MilestoneState", Milestone_MilestoneState_name, Milestone_MilestoneState_value) proto.RegisterEnum("githubtasks.Task_TaskState", Task_TaskState_name, Task_TaskState_value) + proto.RegisterType((*Config)(nil), "githubtasks.config") proto.RegisterType((*Project)(nil), "githubtasks.Project") proto.RegisterType((*Milestone)(nil), "githubtasks.Milestone") proto.RegisterType((*Task)(nil), "githubtasks.Task") @@ -537,41 +577,42 @@ func init() { func init() { proto.RegisterFile("githubtasks.proto", fileDescriptor_0d888ecb083325cf) } var fileDescriptor_0d888ecb083325cf = []byte{ - // 533 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x5d, 0x6f, 0xd3, 0x30, - 0x14, 0x6d, 0xbe, 0xda, 0xe5, 0x76, 0xcd, 0xd2, 0xab, 0x32, 0x45, 0x1d, 0x82, 0x62, 0xa9, 0x50, - 0x5e, 0x8a, 0x28, 0x08, 0x21, 0xed, 0x29, 0xea, 0x02, 0x9a, 0xb4, 0xb1, 0x29, 0x2b, 0x88, 0xb7, - 0x91, 0x2e, 0x16, 0x94, 0xad, 0x4d, 0xa9, 0x5d, 0x24, 0x24, 0x5e, 0x78, 0xe7, 0xa7, 0xf0, 0xa3, - 0xf8, 0x29, 0x53, 0x9c, 0x2f, 0xa7, 0xcb, 0xfa, 0x12, 0xd9, 0xbe, 0xe7, 0x1e, 0x9f, 0xe3, 0x7b, - 0x14, 0x68, 0x7f, 0x9d, 0xf1, 0x6f, 0xeb, 0x29, 0x0f, 0xd8, 0x35, 0x1b, 0x2e, 0x57, 0x11, 0x8f, - 0xb0, 0x29, 0x1d, 0x91, 0xdf, 0xd0, 0x38, 0x5f, 0x45, 0xdf, 0xe9, 0x15, 0x47, 0x04, 0x7d, 0x11, - 0xcc, 0xa9, 0xa3, 0xf4, 0x94, 0x81, 0xe9, 0x8b, 0x35, 0xbe, 0x01, 0x98, 0xcf, 0x6e, 0x28, 0xe3, - 0xd1, 0x82, 0x32, 0x47, 0xed, 0x69, 0x83, 0xe6, 0x68, 0x7f, 0x28, 0x73, 0x9e, 0x66, 0x65, 0x5f, - 0x42, 0x62, 0x1f, 0xac, 0x04, 0x74, 0xb9, 0x4c, 0xd8, 0x1d, 0x4d, 0xb0, 0xb6, 0x92, 0xd3, 0xf4, - 0x4a, 0xf2, 0x5f, 0x01, 0x33, 0x27, 0xa8, 0x14, 0xb0, 0x0f, 0xf5, 0xc5, 0x7a, 0x3e, 0xa5, 0x2b, - 0x47, 0xed, 0x29, 0x03, 0xc3, 0x4f, 0x77, 0x78, 0x08, 0x06, 0xe3, 0x01, 0xa7, 0x82, 0xd7, 0x1a, - 0xf5, 0xab, 0x35, 0x15, 0xab, 0x8b, 0x18, 0xec, 0x27, 0x3d, 0xf8, 0x0c, 0x0c, 0x01, 0x74, 0x74, - 0x61, 0xa8, 0x5d, 0x6a, 0x9e, 0x04, 0xec, 0xda, 0x4f, 0xea, 0xc4, 0x05, 0xab, 0xcc, 0x80, 0x4d, - 0x68, 0x8c, 0x7d, 0xcf, 0x9d, 0x78, 0x47, 0x76, 0x0d, 0x77, 0x40, 0x3f, 0x3e, 0x3a, 0xf1, 0x6c, - 0x05, 0x01, 0xea, 0xee, 0x78, 0x72, 0xfc, 0xc9, 0xb3, 0x55, 0xdc, 0x85, 0x9d, 0xf1, 0xd9, 0xe9, - 0xf9, 0x89, 0x37, 0xf1, 0x6c, 0x8d, 0xfc, 0x53, 0x40, 0x8f, 0x29, 0xb1, 0x03, 0x06, 0x9f, 0xf1, - 0x9b, 0xcc, 0x5e, 0xb2, 0x89, 0x3d, 0x4f, 0xa3, 0xf0, 0x97, 0x70, 0x67, 0xfa, 0x62, 0x8d, 0x2f, - 0x33, 0x6f, 0xba, 0xf0, 0x76, 0x70, 0x47, 0x9e, 0xf8, 0x94, 0x1c, 0x15, 0xcf, 0x64, 0xc8, 0xcf, - 0x44, 0x5e, 0x80, 0x99, 0x63, 0x73, 0xb9, 0x35, 0x49, 0xae, 0x52, 0x92, 0xab, 0x92, 0x43, 0x68, - 0xbb, 0x61, 0x98, 0xce, 0xc7, 0xa7, 0x3f, 0xd6, 0x94, 0x71, 0x7c, 0x0a, 0x5a, 0x10, 0x86, 0x42, - 0x78, 0x73, 0xd4, 0x29, 0xc9, 0xc9, 0x90, 0x31, 0x80, 0x74, 0x00, 0xe5, 0x66, 0xb6, 0x8c, 0x16, - 0x8c, 0x92, 0x2f, 0xd0, 0xf9, 0xb8, 0x0c, 0x03, 0x4e, 0x37, 0x58, 0xab, 0xc6, 0xfd, 0x1a, 0xcc, - 0x3c, 0x45, 0xe2, 0x4d, 0xee, 0x8f, 0x5b, 0x01, 0x24, 0xef, 0xe1, 0xc1, 0xc6, 0x0d, 0xc9, 0xd5, - 0x38, 0x84, 0xc6, 0x5a, 0x14, 0xb6, 0x8b, 0xcf, 0x40, 0xe4, 0xaf, 0x02, 0x96, 0x1b, 0x86, 0x22, - 0x02, 0xa9, 0xca, 0x3e, 0x58, 0xf9, 0x45, 0x97, 0x92, 0xde, 0x56, 0x7e, 0xfa, 0x21, 0x16, 0xfe, - 0x1c, 0x6c, 0x09, 0x26, 0x27, 0x76, 0xaf, 0x00, 0x26, 0xd1, 0xcd, 0x83, 0xa0, 0x55, 0x05, 0x41, - 0x2f, 0x82, 0x40, 0xde, 0xc2, 0x5e, 0xae, 0x26, 0x75, 0xd4, 0x07, 0x3d, 0xd6, 0x9e, 0xda, 0xa9, - 0x48, 0xae, 0x28, 0x8f, 0xfe, 0xa8, 0xb0, 0x1b, 0x6f, 0xd9, 0x05, 0x5d, 0xfd, 0x9c, 0x5d, 0x51, - 0x3c, 0x03, 0x28, 0x46, 0x83, 0x8f, 0x4a, 0x7d, 0x77, 0x06, 0xde, 0x7d, 0x7c, 0x6f, 0x3d, 0x9d, - 0x69, 0x0d, 0x3f, 0x43, 0xab, 0xf4, 0xe6, 0xf8, 0xa4, 0xd4, 0x53, 0x35, 0xf1, 0x2e, 0xd9, 0x06, - 0xc9, 0x99, 0xdf, 0x41, 0x23, 0x75, 0x8d, 0x07, 0x9b, 0x3a, 0xa4, 0xc9, 0x74, 0x1f, 0x56, 0x17, - 0x33, 0x9e, 0x69, 0x5d, 0xfc, 0xee, 0x5e, 0xdd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x41, 0xf8, 0xd7, - 0xc0, 0x03, 0x05, 0x00, 0x00, + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 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 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/githubtasks.proto b/proto/githubtasks.proto index 9d98733f..b5a1cde4 100644 --- a/proto/githubtasks.proto +++ b/proto/githubtasks.proto @@ -2,6 +2,10 @@ syntax = "proto3"; package githubtasks; +message config { + repeated Project projects = 1; +} + message Project { string name = 1; repeated Milestone milestones = 2; From f56f3a89b533005ddb54e2421ca1caf063043061 Mon Sep 17 00:00:00 2001 From: Simon Tucker Date: Thu, 9 Jan 2020 16:09:09 -0800 Subject: [PATCH 2/2] Adds file --- githubtasksutils_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 githubtasksutils_test.go diff --git a/githubtasksutils_test.go b/githubtasksutils_test.go new file mode 100644 index 00000000..064ebd47 --- /dev/null +++ b/githubtasksutils_test.go @@ -0,0 +1,25 @@ +package main + +import ( + "context" + "testing" + + "github.com/brotherlogic/keystore/client" +) + +func InitTestServer() *Server { + s := Init() + s.SkipLog = true + s.SkipIssue = true + s.GoServer.KSclient = *keystoreclient.GetTestClient(".test") + return s +} + +func TestEmptyConfig(t *testing.T) { + s := InitTestServer() + err := s.validateIntegrity(context.Background()) + + if err != nil { + t.Errorf("Error in validation") + } +}