(ctx context.Context, r *connect.Request[localv1.ListMatchingProjectsRequest])
| 739 | } |
| 740 | |
| 741 | func (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 | |
| 762 | func (s *Server) ListProjectsForOrg(ctx context.Context, r *connect.Request[localv1.ListProjectsForOrgRequest]) (*connect.Response[localv1.ListProjectsForOrgResponse], error) { |
| 763 | // Get authenticated admin client |
nothing calls this directly
no test coverage detected