(ctx context.Context, releaseId string)
| 191 | return m.diff(clusterIds, base, target), true, nil |
| 192 | } |
| 193 | func (m *imlServiceDiff) getReleaseInfo(ctx context.Context, releaseId string) (*projectInfo, error) { |
| 194 | commits, err := m.releaseService.GetCommits(ctx, releaseId) |
| 195 | if err != nil { |
| 196 | return nil, err |
| 197 | } |
| 198 | apiRequestCommitIds := make([]string, 0) |
| 199 | apiProxyCommitIds := make([]string, 0) |
| 200 | apiDocumentCommitIds := make([]string, 0) |
| 201 | upstreamCommitIds := make([]string, 0) |
| 202 | strategyCommitIds := make([]string, 0) |
| 203 | for _, c := range commits { |
| 204 | switch c.Type { |
| 205 | case release.CommitApiRequest: |
| 206 | apiRequestCommitIds = append(apiRequestCommitIds, c.Commit) |
| 207 | case release.CommitApiProxy: |
| 208 | apiProxyCommitIds = append(apiProxyCommitIds, c.Commit) |
| 209 | case release.CommitApiDocument: |
| 210 | apiDocumentCommitIds = append(apiDocumentCommitIds, c.Commit) |
| 211 | case release.CommitUpstream: |
| 212 | upstreamCommitIds = append(upstreamCommitIds, c.Commit) |
| 213 | case release.CommitStrategy: |
| 214 | strategyCommitIds = append(strategyCommitIds, c.Commit) |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | var requestCommits []*commit.Commit[api.Request] |
| 219 | var proxyCommits []*commit.Commit[api.Proxy] |
| 220 | var documentCommits []*commit.Commit[api_doc.DocCommit] |
| 221 | if len(apiRequestCommitIds) > 0 { |
| 222 | requestCommits, err = m.apiService.ListRequestCommit(ctx, apiRequestCommitIds...) |
| 223 | if err != nil { |
| 224 | return nil, err |
| 225 | } |
| 226 | } |
| 227 | if len(apiProxyCommitIds) > 0 { |
| 228 | proxyCommits, err = m.apiService.ListProxyCommit(ctx, apiProxyCommitIds...) |
| 229 | if err != nil { |
| 230 | return nil, err |
| 231 | } |
| 232 | } |
| 233 | if len(apiDocumentCommitIds) > 0 { |
| 234 | documentCommits, err = m.apiDocService.ListDocCommit(ctx, apiDocumentCommitIds...) |
| 235 | if err != nil { |
| 236 | return nil, err |
| 237 | } |
| 238 | } |
| 239 | var upstreamCommits []*commit.Commit[upstream.Config] |
| 240 | if len(upstreamCommitIds) > 0 { |
| 241 | upstreamCommits, err = m.upstreamService.ListCommit(ctx, upstreamCommitIds...) |
| 242 | if err != nil { |
| 243 | return nil, err |
| 244 | } |
| 245 | } |
| 246 | var strategyCommits []*commit.Commit[strategy.Commit] |
| 247 | if len(strategyCommitIds) > 0 { |
| 248 | strategyCommits, err = m.strategyService.ListStrategyCommit(ctx, strategyCommitIds...) |
| 249 | if err != nil { |
| 250 | return nil, err |
no test coverage detected