From 7596701d6ccca351333abb3d9624502551b50f0b Mon Sep 17 00:00:00 2001 From: Tim Etchells Date: Fri, 30 Oct 2020 00:35:21 -0400 Subject: [PATCH 1/2] feat: Add autocomplete for repo Revisions - Introduces api/v1/repositories/{repo}/refs which returns branches and tags - Add new RevisionFormField component to Create and Edit Application pages Signed-off-by: Tim Etchells --- assets/swagger.json | 50 ++ pkg/apiclient/repository/repository.pb.go | 165 +++-- pkg/apiclient/repository/repository.pb.gw.go | 113 +++ .../mocks/RepoServerServiceClient.go | 32 +- reposerver/apiclient/repository.pb.go | 662 +++++++++++++++--- reposerver/metrics/gitwrapper.go | 4 + reposerver/repository/repository.go | 31 + reposerver/repository/repository.proto | 14 + reposerver/repository/repository_test.go | 2 + server/repository/repository.go | 20 + server/repository/repository.proto | 13 +- .../application-create-panel.tsx | 4 +- .../application-summary.tsx | 8 +- .../revision-form-field.tsx | 52 ++ .../shared/components/revision-help-icon.tsx | 6 +- ui/src/app/shared/models.ts | 5 + ui/src/app/shared/services/repo-service.ts | 4 + util/git/client.go | 77 +- util/git/git_test.go | 27 + util/git/mocks/Client.go | 31 +- 20 files changed, 1129 insertions(+), 191 deletions(-) create mode 100644 ui/src/app/applications/components/revision-form-field/revision-form-field.tsx diff --git a/assets/swagger.json b/assets/swagger.json index b816d98135955..486204dee9f45 100644 --- a/assets/swagger.json +++ b/assets/swagger.json @@ -2069,6 +2069,38 @@ } } }, + "/api/v1/repositories/{repo}/refs": { + "get": { + "tags": [ + "RepositoryService" + ], + "operationId": "ListRefs", + "parameters": [ + { + "type": "string", + "description": "Repo URL for query", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "boolean", + "format": "boolean", + "description": "Whether to force a cache refresh on repo's connection state.", + "name": "forceRefresh", + "in": "query" + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/repositoryRefs" + } + } + } + } + }, "/api/v1/repositories/{repo}/validate": { "post": { "tags": [ @@ -3070,6 +3102,24 @@ } } }, + "repositoryRefs": { + "type": "object", + "title": "A subset of the repository's named refs", + "properties": { + "branches": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "repositoryRepoAppDetailsQuery": { "type": "object", "title": "RepoAppDetailsQuery contains query information for app details request", diff --git a/pkg/apiclient/repository/repository.pb.go b/pkg/apiclient/repository/repository.pb.go index 5e9ca4d3a66a0..d5a5ae68d2594 100644 --- a/pkg/apiclient/repository/repository.pb.go +++ b/pkg/apiclient/repository/repository.pb.go @@ -601,68 +601,69 @@ func init() { } var fileDescriptor_8d38260443475705 = []byte{ - // 970 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1c, 0x35, - 0x14, 0xd6, 0xa4, 0xe9, 0x36, 0x71, 0x9a, 0xb0, 0x75, 0x4b, 0xb5, 0x6c, 0xb7, 0x69, 0xe4, 0x96, - 0x2a, 0x44, 0x65, 0x86, 0x5d, 0x40, 0x42, 0x45, 0x08, 0x25, 0x1b, 0x54, 0x22, 0x22, 0x15, 0xa6, - 0x2a, 0x12, 0x5c, 0x90, 0x33, 0xfb, 0xb2, 0x6b, 0x32, 0x3b, 0x36, 0xb6, 0x77, 0xd1, 0x2a, 0xea, - 0x85, 0x53, 0xe1, 0x06, 0x88, 0x1b, 0x17, 0x24, 0x0e, 0xfc, 0x17, 0x5c, 0x39, 0x22, 0xf1, 0x0f, - 0xa0, 0x88, 0x3f, 0x04, 0xd9, 0x9e, 0x5f, 0x9b, 0xfd, 0xd1, 0x56, 0x84, 0xdc, 0xec, 0xcf, 0xf6, - 0xfb, 0xbe, 0xf7, 0xf9, 0xcd, 0x1b, 0x23, 0xa2, 0x40, 0x0e, 0x41, 0x06, 0x12, 0x04, 0x57, 0x4c, - 0x73, 0x39, 0x2a, 0x0d, 0x7d, 0x21, 0xb9, 0xe6, 0x18, 0x15, 0x48,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0xbf, 0xa8, 0xf5, 0x5f, 0x4c, 0x2d, 0xa6, 0xa8, 0xb2, 0x0b, 0x31, 0x68, 0x98, 0x55, - 0xf6, 0xb5, 0xd3, 0x70, 0x5e, 0xf0, 0x77, 0x5d, 0xd7, 0xdb, 0x9a, 0xd7, 0xf5, 0x8c, 0x1b, 0x3d, - 0x54, 0x75, 0x14, 0x25, 0x33, 0x5e, 0x98, 0xec, 0xf6, 0x73, 0x90, 0xe1, 0x63, 0xb4, 0xf6, 0x29, - 0x8d, 0x99, 0xb1, 0xd5, 0xbd, 0x7d, 0xf0, 0x8d, 0x89, 0xee, 0x51, 0xbc, 0x89, 0xe6, 0xb0, 0xb5, - 0x2c, 0xdb, 0x3d, 0x72, 0x67, 0xde, 0xb7, 0x3c, 0x4c, 0xa9, 0x9c, 0x93, 0x3b, 0x3b, 0x7f, 0x9c, - 0xac, 0x7b, 0x7f, 0x9e, 0xac, 0x7b, 0x7f, 0x9f, 0xac, 0x7b, 0x9f, 0xbf, 0xf5, 0x1c, 0xef, 0xf0, - 0xc8, 0xbe, 0x5c, 0x4a, 0x8f, 0xe6, 0x83, 0x8a, 0x7d, 0x35, 0xbf, 0xf9, 0x6f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x4d, 0x12, 0x9c, 0xe8, 0x4e, 0x0c, 0x00, 0x00, + // 989 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0xc5, + 0x1b, 0xd6, 0x26, 0xa9, 0x9b, 0x4c, 0x9a, 0xfc, 0xdc, 0x69, 0x7f, 0x95, 0x71, 0xdd, 0x34, 0x9a, + 0x96, 0x2a, 0x44, 0x65, 0x17, 0x1b, 0x90, 0x50, 0x11, 0x42, 0x89, 0x83, 0x4a, 0x44, 0xa4, 0xc2, + 0x56, 0x45, 0x02, 0x09, 0xa1, 0xc9, 0xfa, 0xb5, 0xb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, 0xde, 0xe4, 0x87, 0x15, 0xf3, 0x28, 0x7f, 0xfd, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x11, 0x28, 0x6f, 0x6f, 0xad, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -683,7 +684,8 @@ type RepositoryServiceClient interface { Get(ctx context.Context, in *RepoQuery, opts ...grpc.CallOption) (*v1alpha1.Repository, error) // ListRepositories gets a list of all configured repositories ListRepositories(ctx context.Context, in *RepoQuery, opts ...grpc.CallOption) (*v1alpha1.RepositoryList, error) - // ListApps returns list of apps in the repo + ListRefs(ctx context.Context, in *RepoQuery, opts ...grpc.CallOption) (*apiclient.Refs, error) + // ListApps returns list of apps in the repe ListApps(ctx context.Context, in *RepoAppsQuery, opts ...grpc.CallOption) (*RepoAppsResponse, error) // GetAppDetails returns application details by given path GetAppDetails(ctx context.Context, in *RepoAppDetailsQuery, opts ...grpc.CallOption) (*apiclient.RepoAppDetailsResponse, error) @@ -741,6 +743,15 @@ func (c *repositoryServiceClient) ListRepositories(ctx context.Context, in *Repo return out, nil } +func (c *repositoryServiceClient) ListRefs(ctx context.Context, in *RepoQuery, opts ...grpc.CallOption) (*apiclient.Refs, error) { + out := new(apiclient.Refs) + err := c.cc.Invoke(ctx, "/repository.RepositoryService/ListRefs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *repositoryServiceClient) ListApps(ctx context.Context, in *RepoAppsQuery, opts ...grpc.CallOption) (*RepoAppsResponse, error) { out := new(RepoAppsResponse) err := c.cc.Invoke(ctx, "/repository.RepositoryService/ListApps", in, out, opts...) @@ -842,7 +853,8 @@ type RepositoryServiceServer interface { Get(context.Context, *RepoQuery) (*v1alpha1.Repository, error) // ListRepositories gets a list of all configured repositories ListRepositories(context.Context, *RepoQuery) (*v1alpha1.RepositoryList, error) - // ListApps returns list of apps in the repo + ListRefs(context.Context, *RepoQuery) (*apiclient.Refs, error) + // ListApps returns list of apps in the repe ListApps(context.Context, *RepoAppsQuery) (*RepoAppsResponse, error) // GetAppDetails returns application details by given path GetAppDetails(context.Context, *RepoAppDetailsQuery) (*apiclient.RepoAppDetailsResponse, error) @@ -877,6 +889,9 @@ func (*UnimplementedRepositoryServiceServer) Get(ctx context.Context, req *RepoQ func (*UnimplementedRepositoryServiceServer) ListRepositories(ctx context.Context, req *RepoQuery) (*v1alpha1.RepositoryList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListRepositories not implemented") } +func (*UnimplementedRepositoryServiceServer) ListRefs(ctx context.Context, req *RepoQuery) (*apiclient.Refs, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRefs not implemented") +} func (*UnimplementedRepositoryServiceServer) ListApps(ctx context.Context, req *RepoAppsQuery) (*RepoAppsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListApps not implemented") } @@ -966,6 +981,24 @@ func _RepositoryService_ListRepositories_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _RepositoryService_ListRefs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RepoQuery) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryServiceServer).ListRefs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/repository.RepositoryService/ListRefs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryServiceServer).ListRefs(ctx, req.(*RepoQuery)) + } + return interceptor(ctx, in, info, handler) +} + func _RepositoryService_ListApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RepoAppsQuery) if err := dec(in); err != nil { @@ -1162,6 +1195,10 @@ var _RepositoryService_serviceDesc = grpc.ServiceDesc{ MethodName: "ListRepositories", Handler: _RepositoryService_ListRepositories_Handler, }, + { + MethodName: "ListRefs", + Handler: _RepositoryService_ListRefs_Handler, + }, { MethodName: "ListApps", Handler: _RepositoryService_ListApps_Handler, diff --git a/pkg/apiclient/repository/repository.pb.gw.go b/pkg/apiclient/repository/repository.pb.gw.go index 1e42ea0fc6391..2e5eb30a4579a 100644 --- a/pkg/apiclient/repository/repository.pb.gw.go +++ b/pkg/apiclient/repository/repository.pb.gw.go @@ -166,6 +166,75 @@ func local_request_RepositoryService_ListRepositories_0(ctx context.Context, mar } +var ( + filter_RepositoryService_ListRefs_0 = &utilities.DoubleArray{Encoding: map[string]int{"repo": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_RepositoryService_ListRefs_0(ctx context.Context, marshaler runtime.Marshaler, client RepositoryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RepoQuery + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["repo"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "repo") + } + + protoReq.Repo, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "repo", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RepositoryService_ListRefs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRefs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RepositoryService_ListRefs_0(ctx context.Context, marshaler runtime.Marshaler, server RepositoryServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RepoQuery + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["repo"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "repo") + } + + protoReq.Repo, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "repo", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RepositoryService_ListRefs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRefs(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_RepositoryService_ListApps_0 = &utilities.DoubleArray{Encoding: map[string]int{"repo": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -900,6 +969,26 @@ func RegisterRepositoryServiceHandlerServer(ctx context.Context, mux *runtime.Se }) + mux.Handle("GET", pattern_RepositoryService_ListRefs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RepositoryService_ListRefs_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RepositoryService_ListRefs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_RepositoryService_ListApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1201,6 +1290,26 @@ func RegisterRepositoryServiceHandlerClient(ctx context.Context, mux *runtime.Se }) + mux.Handle("GET", pattern_RepositoryService_ListRefs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RepositoryService_ListRefs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RepositoryService_ListRefs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_RepositoryService_ListApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1411,6 +1520,8 @@ var ( pattern_RepositoryService_ListRepositories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "repositories"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_RepositoryService_ListRefs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "repositories", "repo", "refs"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_RepositoryService_ListApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "repositories", "repo", "apps"}, "", runtime.AssumeColonVerbOpt(true))) pattern_RepositoryService_GetAppDetails_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "repositories", "source.repoURL", "appdetails"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1439,6 +1550,8 @@ var ( forward_RepositoryService_ListRepositories_0 = runtime.ForwardResponseMessage + forward_RepositoryService_ListRefs_0 = runtime.ForwardResponseMessage + forward_RepositoryService_ListApps_0 = runtime.ForwardResponseMessage forward_RepositoryService_GetAppDetails_0 = runtime.ForwardResponseMessage diff --git a/reposerver/apiclient/mocks/RepoServerServiceClient.go b/reposerver/apiclient/mocks/RepoServerServiceClient.go index 8026f9609687a..39d0a15afc23e 100644 --- a/reposerver/apiclient/mocks/RepoServerServiceClient.go +++ b/reposerver/apiclient/mocks/RepoServerServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.3.0. DO NOT EDIT. package mocks @@ -168,3 +168,33 @@ func (_m *RepoServerServiceClient) ListApps(ctx context.Context, in *apiclient.L return r0, r1 } + +// ListRefs provides a mock function with given fields: ctx, in, opts +func (_m *RepoServerServiceClient) ListRefs(ctx context.Context, in *apiclient.ListRefsRequest, opts ...grpc.CallOption) (*apiclient.Refs, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *apiclient.Refs + if rf, ok := ret.Get(0).(func(context.Context, *apiclient.ListRefsRequest, ...grpc.CallOption) *apiclient.Refs); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*apiclient.Refs) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *apiclient.ListRefsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/reposerver/apiclient/repository.pb.go b/reposerver/apiclient/repository.pb.go index 39957f29dbaf7..210daf73f685a 100644 --- a/reposerver/apiclient/repository.pb.go +++ b/reposerver/apiclient/repository.pb.go @@ -265,6 +265,109 @@ func (m *ManifestResponse) GetVerifyResult() string { return "" } +type ListRefsRequest struct { + Repo *v1alpha1.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListRefsRequest) Reset() { *m = ListRefsRequest{} } +func (m *ListRefsRequest) String() string { return proto.CompactTextString(m) } +func (*ListRefsRequest) ProtoMessage() {} +func (*ListRefsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dd8723cfcc820480, []int{2} +} +func (m *ListRefsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListRefsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListRefsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListRefsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListRefsRequest.Merge(m, src) +} +func (m *ListRefsRequest) XXX_Size() int { + return m.Size() +} +func (m *ListRefsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListRefsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListRefsRequest proto.InternalMessageInfo + +func (m *ListRefsRequest) GetRepo() *v1alpha1.Repository { + if m != nil { + return m.Repo + } + return nil +} + +// A subset of the repository's named refs +type Refs struct { + Branches []string `protobuf:"bytes,1,rep,name=branches,proto3" json:"branches,omitempty"` + Tags []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Refs) Reset() { *m = Refs{} } +func (m *Refs) String() string { return proto.CompactTextString(m) } +func (*Refs) ProtoMessage() {} +func (*Refs) Descriptor() ([]byte, []int) { + return fileDescriptor_dd8723cfcc820480, []int{3} +} +func (m *Refs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Refs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Refs.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Refs) XXX_Merge(src proto.Message) { + xxx_messageInfo_Refs.Merge(m, src) +} +func (m *Refs) XXX_Size() int { + return m.Size() +} +func (m *Refs) XXX_DiscardUnknown() { + xxx_messageInfo_Refs.DiscardUnknown(m) +} + +var xxx_messageInfo_Refs proto.InternalMessageInfo + +func (m *Refs) GetBranches() []string { + if m != nil { + return m.Branches + } + return nil +} + +func (m *Refs) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + // ListAppsRequest requests a repository directory structure type ListAppsRequest struct { Repo *v1alpha1.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` @@ -278,7 +381,7 @@ func (m *ListAppsRequest) Reset() { *m = ListAppsRequest{} } func (m *ListAppsRequest) String() string { return proto.CompactTextString(m) } func (*ListAppsRequest) ProtoMessage() {} func (*ListAppsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{2} + return fileDescriptor_dd8723cfcc820480, []int{4} } func (m *ListAppsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -333,7 +436,7 @@ func (m *AppList) Reset() { *m = AppList{} } func (m *AppList) String() string { return proto.CompactTextString(m) } func (*AppList) ProtoMessage() {} func (*AppList) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{3} + return fileDescriptor_dd8723cfcc820480, []int{5} } func (m *AppList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -384,7 +487,7 @@ func (m *RepoServerAppDetailsQuery) Reset() { *m = RepoServerAppDetailsQ func (m *RepoServerAppDetailsQuery) String() string { return proto.CompactTextString(m) } func (*RepoServerAppDetailsQuery) ProtoMessage() {} func (*RepoServerAppDetailsQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{4} + return fileDescriptor_dd8723cfcc820480, []int{6} } func (m *RepoServerAppDetailsQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -457,7 +560,7 @@ func (m *RepoAppDetailsResponse) Reset() { *m = RepoAppDetailsResponse{} func (m *RepoAppDetailsResponse) String() string { return proto.CompactTextString(m) } func (*RepoAppDetailsResponse) ProtoMessage() {} func (*RepoAppDetailsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{5} + return fileDescriptor_dd8723cfcc820480, []int{7} } func (m *RepoAppDetailsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -535,7 +638,7 @@ func (m *RepoServerRevisionMetadataRequest) Reset() { *m = RepoServerRev func (m *RepoServerRevisionMetadataRequest) String() string { return proto.CompactTextString(m) } func (*RepoServerRevisionMetadataRequest) ProtoMessage() {} func (*RepoServerRevisionMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{6} + return fileDescriptor_dd8723cfcc820480, []int{8} } func (m *RepoServerRevisionMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -593,7 +696,7 @@ func (m *KsonnetAppSpec) Reset() { *m = KsonnetAppSpec{} } func (m *KsonnetAppSpec) String() string { return proto.CompactTextString(m) } func (*KsonnetAppSpec) ProtoMessage() {} func (*KsonnetAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{7} + return fileDescriptor_dd8723cfcc820480, []int{9} } func (m *KsonnetAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -662,7 +765,7 @@ func (m *HelmAppSpec) Reset() { *m = HelmAppSpec{} } func (m *HelmAppSpec) String() string { return proto.CompactTextString(m) } func (*HelmAppSpec) ProtoMessage() {} func (*HelmAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{8} + return fileDescriptor_dd8723cfcc820480, []int{10} } func (m *HelmAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -739,7 +842,7 @@ func (m *KustomizeAppSpec) Reset() { *m = KustomizeAppSpec{} } func (m *KustomizeAppSpec) String() string { return proto.CompactTextString(m) } func (*KustomizeAppSpec) ProtoMessage() {} func (*KustomizeAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{9} + return fileDescriptor_dd8723cfcc820480, []int{11} } func (m *KustomizeAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -791,7 +894,7 @@ func (m *KsonnetEnvironment) Reset() { *m = KsonnetEnvironment{} } func (m *KsonnetEnvironment) String() string { return proto.CompactTextString(m) } func (*KsonnetEnvironment) ProtoMessage() {} func (*KsonnetEnvironment) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{10} + return fileDescriptor_dd8723cfcc820480, []int{12} } func (m *KsonnetEnvironment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -855,7 +958,7 @@ func (m *KsonnetEnvironmentDestination) Reset() { *m = KsonnetEnvironmen func (m *KsonnetEnvironmentDestination) String() string { return proto.CompactTextString(m) } func (*KsonnetEnvironmentDestination) ProtoMessage() {} func (*KsonnetEnvironmentDestination) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{11} + return fileDescriptor_dd8723cfcc820480, []int{13} } func (m *KsonnetEnvironmentDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -909,7 +1012,7 @@ func (m *DirectoryAppSpec) Reset() { *m = DirectoryAppSpec{} } func (m *DirectoryAppSpec) String() string { return proto.CompactTextString(m) } func (*DirectoryAppSpec) ProtoMessage() {} func (*DirectoryAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{12} + return fileDescriptor_dd8723cfcc820480, []int{14} } func (m *DirectoryAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -949,7 +1052,7 @@ func (m *HelmChartsRequest) Reset() { *m = HelmChartsRequest{} } func (m *HelmChartsRequest) String() string { return proto.CompactTextString(m) } func (*HelmChartsRequest) ProtoMessage() {} func (*HelmChartsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{13} + return fileDescriptor_dd8723cfcc820480, []int{15} } func (m *HelmChartsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -997,7 +1100,7 @@ func (m *HelmChart) Reset() { *m = HelmChart{} } func (m *HelmChart) String() string { return proto.CompactTextString(m) } func (*HelmChart) ProtoMessage() {} func (*HelmChart) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{14} + return fileDescriptor_dd8723cfcc820480, []int{16} } func (m *HelmChart) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1051,7 +1154,7 @@ func (m *HelmChartsResponse) Reset() { *m = HelmChartsResponse{} } func (m *HelmChartsResponse) String() string { return proto.CompactTextString(m) } func (*HelmChartsResponse) ProtoMessage() {} func (*HelmChartsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{15} + return fileDescriptor_dd8723cfcc820480, []int{17} } func (m *HelmChartsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1090,6 +1193,8 @@ func (m *HelmChartsResponse) GetItems() []*HelmChart { func init() { proto.RegisterType((*ManifestRequest)(nil), "repository.ManifestRequest") proto.RegisterType((*ManifestResponse)(nil), "repository.ManifestResponse") + proto.RegisterType((*ListRefsRequest)(nil), "repository.ListRefsRequest") + proto.RegisterType((*Refs)(nil), "repository.Refs") proto.RegisterType((*ListAppsRequest)(nil), "repository.ListAppsRequest") proto.RegisterType((*AppList)(nil), "repository.AppList") proto.RegisterMapType((map[string]string)(nil), "repository.AppList.AppsEntry") @@ -1113,84 +1218,87 @@ func init() { } var fileDescriptor_dd8723cfcc820480 = []byte{ - // 1230 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xdd, 0x6e, 0x1b, 0xc5, - 0x17, 0xcf, 0xda, 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xf4, 0x0d, 0x5c, 0xde, - 0x57, 0xd5, 0x2f, 0x79, 0xed, 0xd0, 0x3b, 0xba, 0xde, 0xb9, 0xed, 0x4b, 0xd3, 0x2a, 0xaa, 0xcd, - 0x3f, 0x98, 0xd6, 0x0a, 0xfa, 0xc9, 0x80, 0xab, 0xfb, 0x44, 0x14, 0x1f, 0x0f, 0x74, 0x6b, 0xb1, - 0x93, 0x73, 0x1e, 0x99, 0x66, 0x6f, 0x29, 0x62, 0xcc, 0xda, 0xb4, 0x56, 0xd0, 0x91, 0x3a, 0x73, - 0x7e, 0xc1, 0xe8, 0xc6, 0xc2, 0x9b, 0xcc, 0xa0, 0x6b, 0x9d, 0xb7, 0x9c, 0x9e, 0xf3, 0xd3, 0xfb, - 0x7f, 0x9d, 0xb5, 0x8c, 0xbf, 0xcf, 0x5a, 0xc6, 0x3f, 0x67, 0x2d, 0xe3, 0xab, 0x0f, 0x2f, 0xfa, - 0x8c, 0xd6, 0x3e, 0xf7, 0x31, 0xa3, 0xae, 0x4f, 0x49, 0x20, 0x4e, 0xaa, 0xea, 0xa3, 0xf9, 0xa3, - 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x37, 0xe2, 0x11, 0x0d, 0x10, 0x00, 0x00, + // 1280 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x5b, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xda, 0xce, 0xc5, 0xc7, 0x6d, 0xe3, 0x4c, 0xfb, 0xef, 0x7f, 0x31, 0xa9, 0x15, 0x56, + 0x80, 0x02, 0xa5, 0x36, 0x0d, 0x15, 0x54, 0xad, 0x54, 0x29, 0xf4, 0x8a, 0x92, 0xaa, 0xe9, 0x06, + 0x2a, 0x71, 0x91, 0xaa, 0xc9, 0xfa, 0x64, 0x3d, 0x78, 0xbd, 0x3b, 0xec, 0x8c, 0x8d, 0xdc, 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c, 0xc4, 0x35, 0xb2, 0xed, 0xb3, 0xba, + 0x88, 0x7b, 0x0b, 0x44, 0xdd, 0x2b, 0xb9, 0x74, 0x67, 0x82, 0x28, 0x90, 0x0c, 0x46, 0x47, 0xf8, + 0x04, 0x63, 0x8d, 0xae, 0x73, 0x09, 0x48, 0x0c, 0x51, 0x02, 0x23, 0x96, 0xce, 0x84, 0xbd, 0xbe, + 0x55, 0x4d, 0x60, 0x94, 0x8b, 0xc8, 0x36, 0xac, 0x8f, 0x31, 0x66, 0xc7, 0x93, 0x43, 0xe6, 0x87, + 0x54, 0x8e, 0x62, 0xb4, 0x9b, 0x1a, 0x8a, 0x65, 0xb1, 0xf3, 0x97, 0x05, 0xcd, 0xe2, 0xde, 0x08, + 0x1e, 0x85, 0x42, 0xe3, 0x6b, 0x98, 0xca, 0x84, 0x6d, 0x69, 0xf7, 0x85, 0x60, 0x1a, 0x7d, 0x95, + 0x32, 0xfa, 0x2e, 0xc2, 0x4a, 0xc2, 0x2e, 0x1a, 0xfc, 0x75, 0x37, 0x9d, 0x4d, 0xdd, 0x98, 0x5a, + 0xe9, 0xc6, 0xb4, 0x01, 0x84, 0xc6, 0xcf, 0xe7, 0x13, 0x8e, 0xf6, 0x8a, 0x5e, 0x35, 0x24, 0xc4, + 0x81, 0x33, 0x49, 0xde, 0x2e, 0x8a, 0x51, 0x20, 0xed, 0x55, 0xad, 0x31, 0x25, 0x73, 0x02, 0x58, + 0xdf, 0x67, 0x6a, 0x0f, 0xc7, 0xe2, 0xe5, 0xdf, 0x7f, 0xe7, 0x63, 0xa8, 0xa9, 0x48, 0x6a, 0x57, + 0x47, 0x31, 0x0d, 0xbd, 0x3e, 0x66, 0x85, 0xca, 0xe7, 0x84, 0x40, 0x4d, 0x52, 0x5f, 0xd8, 0x15, + 0x2d, 0xd7, 0x63, 0xe7, 0x47, 0x2b, 0x49, 0x73, 0x97, 0x73, 0xf1, 0x7a, 0x69, 0xca, 0x19, 0xc1, + 0xea, 0x2e, 0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 0xd6, 0xf9, 0x39, 0x8d, 0x92, 0xb3, 0x44, 0xbe, 0x81, 0xb3, + 0xf7, 0x35, 0x75, 0xa6, 0x4f, 0x25, 0x79, 0x67, 0x3a, 0xc8, 0x09, 0xbd, 0x4f, 0xcb, 0x29, 0xab, + 0xcd, 0xbe, 0xb6, 0xce, 0x12, 0xf9, 0xc9, 0x82, 0xf3, 0xf7, 0x51, 0x96, 0x5f, 0x1e, 0x72, 0x65, + 0x7e, 0x90, 0x13, 0x5e, 0xa8, 0xd6, 0xde, 0x42, 0xa8, 0x9a, 0xf6, 0xe9, 0x2c, 0x91, 0x03, 0xbd, + 0xe7, 0x02, 0x1d, 0xe4, 0xd2, 0x5c, 0x18, 0xe4, 0xa5, 0x6b, 0x9f, 0xb4, 0x9c, 0xed, 0xf3, 0xd3, + 0x5b, 0x7f, 0x3f, 0x6f, 0x5b, 0xff, 0x3c, 0x6f, 0x5b, 0xff, 0x3e, 0x6f, 0x5b, 0x5f, 0x7d, 0x78, + 0xda, 0x97, 0x02, 0xe3, 0x8b, 0x06, 0xe5, 0xcc, 0x0b, 0x18, 0x86, 0xf2, 0x68, 0x45, 0x7f, 0x17, + 0xf8, 0xe8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0xb4, 0xe7, 0xb1, 0xf0, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1207,6 +1315,8 @@ const _ = grpc.SupportPackageIsVersion4 type RepoServerServiceClient interface { // GenerateManifest generates manifest for application in specified repo name and revision GenerateManifest(ctx context.Context, in *ManifestRequest, opts ...grpc.CallOption) (*ManifestResponse, error) + // Returns a list of refs (eg. branches and tags) in the repo + ListRefs(ctx context.Context, in *ListRefsRequest, opts ...grpc.CallOption) (*Refs, error) // ListApps returns a list of apps in the repo ListApps(ctx context.Context, in *ListAppsRequest, opts ...grpc.CallOption) (*AppList, error) // Generate manifest for application in specified repo name and revision @@ -1234,6 +1344,15 @@ func (c *repoServerServiceClient) GenerateManifest(ctx context.Context, in *Mani return out, nil } +func (c *repoServerServiceClient) ListRefs(ctx context.Context, in *ListRefsRequest, opts ...grpc.CallOption) (*Refs, error) { + out := new(Refs) + err := c.cc.Invoke(ctx, "/repository.RepoServerService/ListRefs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *repoServerServiceClient) ListApps(ctx context.Context, in *ListAppsRequest, opts ...grpc.CallOption) (*AppList, error) { out := new(AppList) err := c.cc.Invoke(ctx, "/repository.RepoServerService/ListApps", in, out, opts...) @@ -1274,6 +1393,8 @@ func (c *repoServerServiceClient) GetHelmCharts(ctx context.Context, in *HelmCha type RepoServerServiceServer interface { // GenerateManifest generates manifest for application in specified repo name and revision GenerateManifest(context.Context, *ManifestRequest) (*ManifestResponse, error) + // Returns a list of refs (eg. branches and tags) in the repo + ListRefs(context.Context, *ListRefsRequest) (*Refs, error) // ListApps returns a list of apps in the repo ListApps(context.Context, *ListAppsRequest) (*AppList, error) // Generate manifest for application in specified repo name and revision @@ -1291,6 +1412,9 @@ type UnimplementedRepoServerServiceServer struct { func (*UnimplementedRepoServerServiceServer) GenerateManifest(ctx context.Context, req *ManifestRequest) (*ManifestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GenerateManifest not implemented") } +func (*UnimplementedRepoServerServiceServer) ListRefs(ctx context.Context, req *ListRefsRequest) (*Refs, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRefs not implemented") +} func (*UnimplementedRepoServerServiceServer) ListApps(ctx context.Context, req *ListAppsRequest) (*AppList, error) { return nil, status.Errorf(codes.Unimplemented, "method ListApps not implemented") } @@ -1326,6 +1450,24 @@ func _RepoServerService_GenerateManifest_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _RepoServerService_ListRefs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRefsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepoServerServiceServer).ListRefs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/repository.RepoServerService/ListRefs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepoServerServiceServer).ListRefs(ctx, req.(*ListRefsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _RepoServerService_ListApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAppsRequest) if err := dec(in); err != nil { @@ -1406,6 +1548,10 @@ var _RepoServerService_serviceDesc = grpc.ServiceDesc{ MethodName: "GenerateManifest", Handler: _RepoServerService_GenerateManifest_Handler, }, + { + MethodName: "ListRefs", + Handler: _RepoServerService_ListRefs_Handler, + }, { MethodName: "ListApps", Handler: _RepoServerService_ListApps_Handler, @@ -1655,6 +1801,90 @@ func (m *ManifestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ListRefsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListRefsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListRefsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Repo != nil { + { + size, err := m.Repo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRepository(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Refs) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Refs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Refs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Tags[iNdEx]) + copy(dAtA[i:], m.Tags[iNdEx]) + i = encodeVarintRepository(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Branches) > 0 { + for iNdEx := len(m.Branches) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Branches[iNdEx]) + copy(dAtA[i:], m.Branches[iNdEx]) + i = encodeVarintRepository(dAtA, i, uint64(len(m.Branches[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *ListAppsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2501,6 +2731,46 @@ func (m *ManifestResponse) Size() (n int) { return n } +func (m *ListRefsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Repo != nil { + l = m.Repo.Size() + n += 1 + l + sovRepository(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Refs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Branches) > 0 { + for _, s := range m.Branches { + l = len(s) + n += 1 + l + sovRepository(uint64(l)) + } + } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovRepository(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *ListAppsRequest) Size() (n int) { if m == nil { return 0 @@ -3540,6 +3810,214 @@ func (m *ManifestResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *ListRefsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListRefsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListRefsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRepository + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRepository + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Repo == nil { + m.Repo = &v1alpha1.Repository{} + } + if err := m.Repo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRepository(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRepository + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRepository + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Refs) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Refs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Refs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Branches", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRepository + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRepository + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Branches = append(m.Branches, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRepository + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRepository + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRepository(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRepository + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRepository + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ListAppsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/reposerver/metrics/gitwrapper.go b/reposerver/metrics/gitwrapper.go index b6d9f1c5f2112..49bbd3320b3b2 100644 --- a/reposerver/metrics/gitwrapper.go +++ b/reposerver/metrics/gitwrapper.go @@ -34,6 +34,10 @@ func (w *gitClientWrapper) LsRemote(revision string) (string, error) { return sha, err } +func (w *gitClientWrapper) LsRefs() (*git.Refs, error) { + return w.client.LsRefs() +} + func (w *gitClientWrapper) LsFiles(path string) ([]string, error) { return w.client.LsFiles(path) } diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 8b00f9a4596d7..59253148a09ee 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -98,6 +98,37 @@ func NewService(metricsServer *metrics.MetricsServer, cache *reposervercache.Cac } } +// List a subset of the refs (currently, branches and tags) of a git repo +func (s *Service) ListRefs(ctx context.Context, q *apiclient.ListRefsRequest) (*apiclient.Refs, error) { + gitClient, err := s.newClient(q.Repo) + if err != nil { + return nil, err + } + + // TODO check cache + + s.metricsServer.IncPendingRepoRequest(q.Repo.Repo) + defer s.metricsServer.DecPendingRepoRequest(q.Repo.Repo) + + // TODO is locking necessary here? We are not modifying the repository, just running an ls-remote + + //s.repoLock.Lock(gitClient.Root()) + + refs, err := gitClient.LsRefs() + if err != nil { + return nil, err + } + + res := apiclient.Refs{ + Branches: refs.Branches, + Tags: refs.Tags, + } + + // TODO save in cache + + return &res, nil +} + // ListApps lists the contents of a GitHub repo func (s *Service) ListApps(ctx context.Context, q *apiclient.ListAppsRequest) (*apiclient.AppList, error) { gitClient, commitSHA, err := s.newClientResolveRevision(q.Repo, q.Revision) diff --git a/reposerver/repository/repository.proto b/reposerver/repository/repository.proto index 503bbdaa045f8..7802aab3d5a38 100644 --- a/reposerver/repository/repository.proto +++ b/reposerver/repository/repository.proto @@ -38,6 +38,16 @@ message ManifestResponse { string verifyResult = 7; } +message ListRefsRequest { + github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository repo = 1; +} + +// A subset of the repository's named refs +message Refs { + repeated string branches = 1; + repeated string tags = 2; +} + // ListAppsRequest requests a repository directory structure message ListAppsRequest { github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository repo = 1; @@ -140,6 +150,10 @@ service RepoServerService { rpc GenerateManifest(ManifestRequest) returns (ManifestResponse) { } + // Returns a list of refs (eg. branches and tags) in the repo + rpc ListRefs(ListRefsRequest) returns (Refs) { + } + // ListApps returns a list of apps in the repo rpc ListApps(ListAppsRequest) returns (AppList) { } diff --git a/reposerver/repository/repository_test.go b/reposerver/repository/repository_test.go index e9b95e5fcf8bc..ec378fef178c8 100644 --- a/reposerver/repository/repository_test.go +++ b/reposerver/repository/repository_test.go @@ -357,7 +357,9 @@ func TestManifestGenErrorCacheByNumRequests(t *testing.T) { assert.True(t, cachedManifestResponse.FirstFailureTimestamp != 0) // Internal cache values should update correctly based on number of return cache entries, consecutive failures should stay the same + // nolint:staticcheck assert.True(t, cachedManifestResponse.NumberOfConsecutiveFailures == service.initConstants.PauseGenerationAfterFailedGenerationAttempts) + // nolint:staticcheck assert.True(t, cachedManifestResponse.NumberOfCachedResponsesReturned == (adjustedInvocation-service.initConstants.PauseGenerationAfterFailedGenerationAttempts+1)) } } diff --git a/server/repository/repository.go b/server/repository/repository.go index 43f0549f951b6..eb3e13818845b 100644 --- a/server/repository/repository.go +++ b/server/repository/repository.go @@ -153,6 +153,26 @@ func (s *Server) ListRepositories(ctx context.Context, q *repositorypkg.RepoQuer return &appsv1.RepositoryList{Items: items}, nil } +func (s *Server) ListRefs(ctx context.Context, q *repositorypkg.RepoQuery) (*apiclient.Refs, error) { + if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceRepositories, rbacpolicy.ActionGet, q.Repo); err != nil { + return nil, err + } + repo, err := s.db.GetRepository(ctx, q.Repo) + if err != nil { + return nil, err + } + + conn, repoClient, err := s.repoClientset.NewRepoServerClient() + if err != nil { + return nil, err + } + defer io.Close(conn) + + return repoClient.ListRefs(ctx, &apiclient.ListRefsRequest{ + Repo: repo, + }) +} + // ListApps returns list of apps in the repo func (s *Server) ListApps(ctx context.Context, q *repositorypkg.RepoAppsQuery) (*repositorypkg.RepoAppsResponse, error) { if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceRepositories, rbacpolicy.ActionGet, q.Repo); err != nil { diff --git a/server/repository/repository.proto b/server/repository/repository.proto index fc15732a12750..d895a7be1e3e7 100644 --- a/server/repository/repository.proto +++ b/server/repository/repository.proto @@ -3,7 +3,7 @@ option go_package = "github.com/argoproj/argo-cd/pkg/apiclient/repository"; // Repository Service // -// Repository Service API performs CRUD actions against repository resources +// Repository Service API performs CRUD actions against repository resources package repository; import "gogoproto/gogo.proto"; @@ -83,8 +83,7 @@ message RepoUpdateRequest { github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository repo = 1; } - -// RepositoryService +// RepositoryService service RepositoryService { // List returns list of repos or repository credentials @@ -103,7 +102,11 @@ service RepositoryService { option (google.api.http).get = "/api/v1/repositories"; } - // ListApps returns list of apps in the repo + rpc ListRefs(RepoQuery) returns (Refs) { + option (google.api.http).get = "/api/v1/repositories/{repo}/refs"; + } + + // ListApps returns list of apps in the repe rpc ListApps(RepoAppsQuery) returns (RepoAppsResponse) { option (google.api.http).get = "/api/v1/repositories/{repo}/apps"; } @@ -129,7 +132,7 @@ service RepositoryService { }; option deprecated = true; } - + // CreateRepository creates a new repository configuration rpc CreateRepository(RepoCreateRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository) { option (google.api.http) = { diff --git a/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx b/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx index e29cbe12bcaf0..ed84a114b0c45 100644 --- a/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx +++ b/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx @@ -7,6 +7,7 @@ import * as models from '../../../shared/models'; import {services} from '../../../shared/services'; import {ApplicationParameters} from '../application-parameters/application-parameters'; import {ApplicationSyncOptionsField} from '../application-sync-options'; +import {RevisionFormField} from '../revision-form-field/revision-form-field'; const jsonMergePatch = require('json-merge-patch'); @@ -261,8 +262,7 @@ export const ApplicationCreatePanel = (props: { {(repoType === 'git' && (
- - +
, - edit: (formApi: FormApi) => ( - - - {' '} - - ) + edit: (formApi: FormApi) => }, { title: 'PATH', diff --git a/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx b/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx new file mode 100644 index 0000000000000..ea8950e6f6265 --- /dev/null +++ b/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx @@ -0,0 +1,52 @@ +import * as React from 'react'; +import {FormApi} from 'react-form'; + +import {AutocompleteField, DataLoader, FormField} from 'argo-ui'; +import {RevisionHelpIcon} from '../../../shared/components'; +import {services} from '../../../shared/services'; + +interface RevisionFormFieldProps { + formApi: FormApi; + helpIconTop?: string; + hideLabel?: boolean; + repoURL: string; +} + +export class RevisionFormField extends React.PureComponent { + public render() { + return ( + + => { + if (src.repoURL) { + try { + const revisionsRes = await services.repos.revisions(src.repoURL); + // tslint:disable-next-line: prettier + return [ 'HEAD' ] + .concat(revisionsRes.branches) + .concat(revisionsRes.tags); + } catch (err) { + // no-op + } + } + return []; + }}> + {(revisions: string[]) => ( + + )} + + + + ); + } +} diff --git a/ui/src/app/shared/components/revision-help-icon.tsx b/ui/src/app/shared/components/revision-help-icon.tsx index 6f7d557d84868..06752fb5ae9a6 100644 --- a/ui/src/app/shared/components/revision-help-icon.tsx +++ b/ui/src/app/shared/components/revision-help-icon.tsx @@ -3,6 +3,10 @@ import * as React from 'react'; export const RevisionHelpIcon = ({type, top}: {type: string; top?: string}) => (
- {type === 'helm' ? : } + {type === 'helm' ? ( + + ) : ( + + )}
); diff --git a/ui/src/app/shared/models.ts b/ui/src/app/shared/models.ts index a8c166d8ddc51..fc9fcbdc2abd8 100644 --- a/ui/src/app/shared/models.ts +++ b/ui/src/app/shared/models.ts @@ -528,6 +528,11 @@ export interface RepoAppDetails { directory?: {}; } +export interface RefsInfo { + branches: string[]; + tags: string[]; +} + export interface AppInfo { type: string; path: string; diff --git a/ui/src/app/shared/services/repo-service.ts b/ui/src/app/shared/services/repo-service.ts index 4ec3ba42df9d7..29e330c2ba459 100644 --- a/ui/src/app/shared/services/repo-service.ts +++ b/ui/src/app/shared/services/repo-service.ts @@ -71,6 +71,10 @@ export class RepositoriesService { .then(res => res.body as models.Repository); } + public async revisions(repo: string): Promise { + return requests.get(`/repositories/${encodeURIComponent(repo)}/refs`).then(res => res.body as models.RefsInfo); + } + public apps(repo: string, revision: string): Promise { return requests .get(`/repositories/${encodeURIComponent(repo)}/apps`) diff --git a/util/git/client.go b/util/git/client.go index 2423f16a4b84c..8bc9b3cd68f9a 100644 --- a/util/git/client.go +++ b/util/git/client.go @@ -9,6 +9,7 @@ import ( "os" "os/exec" "path/filepath" + "sort" "strconv" "strings" "time" @@ -36,12 +37,20 @@ type RevisionMetadata struct { Message string } +// this should match reposerver/repository/repository.proto/RefsList +type Refs struct { + Branches []string + Tags []string + // heads and remotes are also refs, but are not needed at this time. +} + // Client is a generic git client interface type Client interface { Root() string Init() error Fetch() error Checkout(revision string) error + LsRefs() (*Refs, error) LsRemote(revision string) (string, error) LsFiles(path string) ([]string, error) LsLargeFiles() ([]string, error) @@ -322,6 +331,54 @@ func (m *nativeGitClient) Checkout(revision string) error { return nil } +func (m *nativeGitClient) getRefs() ([]*plumbing.Reference, error) { + repo, err := git.Init(memory.NewStorage(), nil) + if err != nil { + return nil, err + } + remote, err := repo.CreateRemote(&config.RemoteConfig{ + Name: git.DefaultRemoteName, + URLs: []string{m.repoURL}, + }) + if err != nil { + return nil, err + } + auth, err := newAuth(m.repoURL, m.creds) + if err != nil { + return nil, err + } + return listRemote(remote, &git.ListOptions{Auth: auth}, m.insecure, m.creds) +} + +func (m *nativeGitClient) LsRefs() (*Refs, error) { + refs, err := m.getRefs() + + if err != nil { + return nil, err + } + + sortedRefs := &Refs{ + Branches: []string{}, + Tags: []string{}, + } + + for _, revision := range refs { + if revision.Name().IsBranch() { + sortedRefs.Branches = append(sortedRefs.Branches, revision.Name().Short()) + } else if revision.Name().IsTag() { + sortedRefs.Tags = append(sortedRefs.Tags, revision.Name().Short()) + } + } + + log.Debugf("LsRefs resolved %d branches and %d tags on repository", len(sortedRefs.Branches), len(sortedRefs.Tags)) + + // Would prefer to sort by last modified date but that info does not appear to be available without resolving each ref + sort.Strings(sortedRefs.Branches) + sort.Strings(sortedRefs.Tags) + + return sortedRefs, nil +} + // LsRemote resolves the commit SHA of a specific branch, tag, or HEAD. If the supplied revision // does not resolve, and "looks" like a 7+ hexadecimal commit SHA, it return the revision string. // Otherwise, it returns an error indicating that the revision could not be resolved. This method @@ -340,23 +397,9 @@ func (m *nativeGitClient) lsRemote(revision string) (string, error) { if IsCommitSHA(revision) { return revision, nil } - repo, err := git.Init(memory.NewStorage(), nil) - if err != nil { - return "", err - } - remote, err := repo.CreateRemote(&config.RemoteConfig{ - Name: git.DefaultRemoteName, - URLs: []string{m.repoURL}, - }) - if err != nil { - return "", err - } - auth, err := newAuth(m.repoURL, m.creds) - if err != nil { - return "", err - } - //refs, err := remote.List(&git.ListOptions{Auth: auth}) - refs, err := listRemote(remote, &git.ListOptions{Auth: auth}, m.insecure, m.creds) + + refs, err := m.getRefs() + if err != nil { return "", err } diff --git a/util/git/git_test.go b/util/git/git_test.go index 41d45229c15c5..9a334340448b7 100644 --- a/util/git/git_test.go +++ b/util/git/git_test.go @@ -368,3 +368,30 @@ func TestNewFactory(t *testing.T) { assert.Equal(t, commitSHA, commitSHA2) } } + +func TestListRevisions(t *testing.T) { + dir, err := ioutil.TempDir("", "test-list-revisions") + if err != nil { + panic(err.Error()) + } + defer os.RemoveAll(dir) + + repoUrl := "https://github.com/argoproj/argo-cd.git" + client, err := NewClientExt(repoUrl, dir, NopCreds{}, false, false) + assert.NoError(t, err) + + lsResult, err := client.LsRefs() + assert.NoError(t, err) + + testBranch := "master" + testTag := "v1.0.0" + + assert.Contains(t, lsResult.Branches, testBranch) + assert.Contains(t, lsResult.Tags, testTag) + assert.NotContains(t, lsResult.Branches, testTag) + assert.NotContains(t, lsResult.Tags, testBranch) + + //fmt.Printf("BRANCHES: %s\n", strings.Join(lsResult.Branches, ", ")) + //fmt.Printf("TAGS: %s\n", strings.Join(lsResult.Tags, ", ")) + //fmt.Printf("%d branches, %d tags\n", len(lsResult.Branches), len(lsResult.Tags)) +} diff --git a/util/git/mocks/Client.go b/util/git/mocks/Client.go index 937a3bb23cbb7..9ca1f3d5249ce 100644 --- a/util/git/mocks/Client.go +++ b/util/git/mocks/Client.go @@ -1,9 +1,11 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.3.0. DO NOT EDIT. package mocks -import git "github.com/argoproj/argo-cd/util/git" -import mock "github.com/stretchr/testify/mock" +import ( + git "github.com/argoproj/argo-cd/util/git" + mock "github.com/stretchr/testify/mock" +) // Client is an autogenerated mock type for the Client type type Client struct { @@ -119,6 +121,29 @@ func (_m *Client) LsLargeFiles() ([]string, error) { return r0, r1 } +// LsRefs provides a mock function with given fields: +func (_m *Client) LsRefs() (*git.Refs, error) { + ret := _m.Called() + + var r0 *git.Refs + if rf, ok := ret.Get(0).(func() *git.Refs); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*git.Refs) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // LsRemote provides a mock function with given fields: revision func (_m *Client) LsRemote(revision string) (string, error) { ret := _m.Called(revision) From 0de8121245d513dbd8bb41cf1d7e085be780cd08 Mon Sep 17 00:00:00 2001 From: Tim Etchells Date: Sun, 1 Nov 2020 13:41:41 -0500 Subject: [PATCH 2/2] address review comments Signed-off-by: Tim Etchells --- reposerver/repository/repository.go | 8 -------- .../revision-form-field/revision-form-field.tsx | 13 ++++--------- util/git/git_test.go | 8 ++------ 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 59253148a09ee..a1ee13e5e5d89 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -105,15 +105,9 @@ func (s *Service) ListRefs(ctx context.Context, q *apiclient.ListRefsRequest) (* return nil, err } - // TODO check cache - s.metricsServer.IncPendingRepoRequest(q.Repo.Repo) defer s.metricsServer.DecPendingRepoRequest(q.Repo.Repo) - // TODO is locking necessary here? We are not modifying the repository, just running an ls-remote - - //s.repoLock.Lock(gitClient.Root()) - refs, err := gitClient.LsRefs() if err != nil { return nil, err @@ -124,8 +118,6 @@ func (s *Service) ListRefs(ctx context.Context, q *apiclient.ListRefsRequest) (* Tags: refs.Tags, } - // TODO save in cache - return &res, nil } diff --git a/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx b/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx index ea8950e6f6265..2acad61af3cdb 100644 --- a/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx +++ b/ui/src/app/applications/components/revision-form-field/revision-form-field.tsx @@ -20,15 +20,10 @@ export class RevisionFormField extends React.PureComponent => { if (src.repoURL) { - try { - const revisionsRes = await services.repos.revisions(src.repoURL); - // tslint:disable-next-line: prettier - return [ 'HEAD' ] - .concat(revisionsRes.branches) - .concat(revisionsRes.tags); - } catch (err) { - // no-op - } + return services.repos + .revisions(src.repoURL) + .then(revisionsRes => ['HEAD'].concat(revisionsRes.branches).concat(revisionsRes.tags)) + .catch(() => []); } return []; }}> diff --git a/util/git/git_test.go b/util/git/git_test.go index 9a334340448b7..74040a076a8bd 100644 --- a/util/git/git_test.go +++ b/util/git/git_test.go @@ -376,8 +376,8 @@ func TestListRevisions(t *testing.T) { } defer os.RemoveAll(dir) - repoUrl := "https://github.com/argoproj/argo-cd.git" - client, err := NewClientExt(repoUrl, dir, NopCreds{}, false, false) + repoURL := "https://github.com/argoproj/argo-cd.git" + client, err := NewClientExt(repoURL, dir, NopCreds{}, false, false) assert.NoError(t, err) lsResult, err := client.LsRefs() @@ -390,8 +390,4 @@ func TestListRevisions(t *testing.T) { assert.Contains(t, lsResult.Tags, testTag) assert.NotContains(t, lsResult.Branches, testTag) assert.NotContains(t, lsResult.Tags, testBranch) - - //fmt.Printf("BRANCHES: %s\n", strings.Join(lsResult.Branches, ", ")) - //fmt.Printf("TAGS: %s\n", strings.Join(lsResult.Tags, ", ")) - //fmt.Printf("%d branches, %d tags\n", len(lsResult.Branches), len(lsResult.Tags)) }