MCPcopy Index your code
hub / github.com/rilldata/rill / ListMatchingProjects

Method ListMatchingProjects

cli/pkg/local/server.go:741–760  ·  view source on GitHub ↗
(ctx context.Context, r *connect.Request[localv1.ListMatchingProjectsRequest])

Source from the content-addressed store, hash-verified

739}
740
741func (s *Server) ListMatchingProjects(ctx context.Context, r *connect.Request[localv1.ListMatchingProjectsRequest]) (*connect.Response[localv1.ListMatchingProjectsResponse], error) {
742 // Get authenticated admin client
743 if !s.app.ch.IsAuthenticated() {
744 return nil, errors.New("must authenticate before performing this action")
745 }
746
747 projects, err := s.app.ch.InferProjects(ctx, "", s.app.ProjectPath)
748 if err != nil {
749 if errors.Is(err, cmdutil.ErrInferProjectFailed) {
750 return connect.NewResponse(&localv1.ListMatchingProjectsResponse{
751 Projects: nil,
752 }), nil
753 }
754 }
755
756 // TODO : filter projects that deploy from a different branch than the current one
757 return connect.NewResponse(&localv1.ListMatchingProjectsResponse{
758 Projects: projects,
759 }), nil
760}
761
762func (s *Server) ListProjectsForOrg(ctx context.Context, r *connect.Request[localv1.ListProjectsForOrgRequest]) (*connect.Response[localv1.ListProjectsForOrgResponse], error) {
763 // Get authenticated admin client

Callers

nothing calls this directly

Calls 2

IsAuthenticatedMethod · 0.80
InferProjectsMethod · 0.80

Tested by

no test coverage detected