Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: find changelists across projects (#8460)
Danny Xu573bb922be43
diff --git a/backend/api/v1/changelist_service.go b/backend/api/v1/changelist_service.goindex 7e77b312ff..2e2540b6af 100644--- a/backend/api/v1/changelist_service.go+++ b/backend/api/v1/changelist_service.go@@ -101,20 +101,24 @@ func (s *ChangelistService) ListChangelists(ctx context.Context, request *v1pb.Lif err != nil {return nil, status.Errorf(codes.InvalidArgument, err.Error())}- project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{- ResourceID: &projectResourceID,- })- if err != nil {- return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get project with resource id %q, err: %s", projectResourceID, err.Error()))- }- if project == nil {- return nil, status.Errorf(codes.NotFound, fmt.Sprintf("project with resource id %q not found", projectResourceID))- }- if project.Deleted {- return nil, status.Errorf(codes.NotFound, fmt.Sprintf("project with resource id %q had deleted", projectResourceID))- }- changelists, err := s.store.ListChangelists(ctx, &store.FindChangelistMessage{ProjectID: &project.ResourceID})+ find := &store.FindChangelistMessage{}+ if projectResourceID != "-" {+ project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{+ ResourceID: &projectResourceID,+ })+ if err != nil {+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get project with resource id %q, err: %s", projectResourceID, err.Error()))+ }+ if project == nil {+ return nil, status.Errorf(codes.NotFound, fmt.Sprintf("project with resource id %q not found", projectResourceID))+ }+ if project.Deleted {+ return nil, status.Errorf(codes.NotFound, fmt.Sprintf("project with resource id %q had deleted", projectResourceID))+ }+ find.ProjectID = &projectResourceID+ }+ changelists, err := s.store.ListChangelists(ctx, find)if err != nil {return nil, err}