Class CustomIssueRepositoryImpl
java.lang.Object
org.qubership.atp.ram.repositories.impl.CustomIssueRepositoryImpl
- All Implemented Interfaces:
CustomIssueRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCreatedIssuesByLogRecordsMessage(List<UUID> logRecords, UUID executionRequestId) Example of generated query: db.issue.aggregate( [ { "$match": { "executionRequestId": JUUID("481fde38-238f-4a78-9bd5-a7bf923babf8") } }, { "$lookup": { "from": "logrecord", "let": { "issue_message": "$message", "issue_lrs": "$logRecordIds" }, "pipeline": [ { "$match": { "_id": { "$in": [JUUID("481fde38-238f-4a78-9bd5-a7bf923babf8")] } } }, { "$match": { "$expr": { "$and": [ { "$eq": ["$message", "$$issue_message"]}, { "$not": { "$in": ["$_id","$$issue_lrs"] } } ] } } }, { "$project": { "_id": 1, "testRunId": 1, "emptyArray": [] } } ], "as": "logrecords" } }, { "$match": { "logrecords": { "$ne": [] } } }, { "$project": { "logRecordIds": { "$setDifference": [ { "$concatArrays": ["$logRecordIds","$logrecords._id"] }, "$logrecords.emptyArray" ] }, "failedTestRunIds": { "$setDifference": [ { "$concatArrays": ["$failedTestRunIds","$logrecords.testRunId"] }, "$logrecords.emptyArray" ] }, "failedTestRunsCount": { "$size": { "$setDifference": [ { "$concatArrays": ["$failedTestRunIds","$logrecords.testRunId"] }, "$logrecords.emptyArray" ] } }, "executionRequestId": 1, "message": 1 } } ])getProjectIdByIssueId(UUID issueId) Example of generated query: db.issue.aggregate([ { $match: { _id: JUUID("2dcdefd1-a4a4-44fe-b608-514806d981ed") } }, { $lookup: { from: "executionRequests", localField: "executionRequestId", foreignField: "_id", as: "executionRequest" } }, { $unwind: "$executionRequest" }, { $project: { "_id" : "$executionRequest.projectId" } } ])getSortedAndPaginatedIssuesByFilters(IssueFilteringParams issueFilteringParams, String columnType, String sortType, int startIndex, int endIndex) Example of generated query: db.issue.aggregate( [ { $match: { executionRequestId: executionRequestIdVar } }, { $match : { message : { $regex: /.*?message.*?/ } } }, { $match : { jiraTicket : { $regex: /.*?ATPII-1.*?/ } } }, * { $lookup: { from: "failPattern", localField: "failPatternId", foreignField: "_id", as: "failPattern" } }, { $unwind: { path: "$failPattern", preserveNullAndEmptyArrays: true } }, { $match : { "failPattern.name" : { $regex: /.*?fail pattern.*?/ } } }, { $lookup: { from: "rootCause", localField: "failReasonId", foreignField: "_id", as: "failReason" } }, { $unwind: { path: "$failReason", preserveNullAndEmptyArrays: true } }, { $match : { "failReason.name" : { $regex: /.*?fail reason.*?/ } } }, { $facet: { metadata: [ { $count: "totalCount" } ], data: [ { $skip: 5 }, { $limit: 5 } ] } } ] )
-
Constructor Details
-
CustomIssueRepositoryImpl
public CustomIssueRepositoryImpl()
-
-
Method Details
-
getSortedAndPaginatedIssuesByFilters
public IssueDto getSortedAndPaginatedIssuesByFilters(IssueFilteringParams issueFilteringParams, String columnType, String sortType, int startIndex, int endIndex) Example of generated query: db.issue.aggregate( [ { $match: { executionRequestId: executionRequestIdVar } }, { $match : { message : { $regex: /.*?message.*?/ } } }, { $match : { jiraTicket : { $regex: /.*?ATPII-1.*?/ } } }, * { $lookup: { from: "failPattern", localField: "failPatternId", foreignField: "_id", as: "failPattern" } }, { $unwind: { path: "$failPattern", preserveNullAndEmptyArrays: true } }, { $match : { "failPattern.name" : { $regex: /.*?fail pattern.*?/ } } }, { $lookup: { from: "rootCause", localField: "failReasonId", foreignField: "_id", as: "failReason" } }, { $unwind: { path: "$failReason", preserveNullAndEmptyArrays: true } }, { $match : { "failReason.name" : { $regex: /.*?fail reason.*?/ } } }, { $facet: { metadata: [ { $count: "totalCount" } ], data: [ { $skip: 5 }, { $limit: 5 } ] } } ] )- Specified by:
getSortedAndPaginatedIssuesByFiltersin interfaceCustomIssueRepository
-
getProjectIdByIssueId
Example of generated query: db.issue.aggregate([ { $match: { _id: JUUID("2dcdefd1-a4a4-44fe-b608-514806d981ed") } }, { $lookup: { from: "executionRequests", localField: "executionRequestId", foreignField: "_id", as: "executionRequest" } }, { $unwind: "$executionRequest" }, { $project: { "_id" : "$executionRequest.projectId" } } ])- Specified by:
getProjectIdByIssueIdin interfaceCustomIssueRepository
-
getCreatedIssuesByLogRecordsMessage
public List<Issue> getCreatedIssuesByLogRecordsMessage(List<UUID> logRecords, UUID executionRequestId) Example of generated query: db.issue.aggregate( [ { "$match": { "executionRequestId": JUUID("481fde38-238f-4a78-9bd5-a7bf923babf8") } }, { "$lookup": { "from": "logrecord", "let": { "issue_message": "$message", "issue_lrs": "$logRecordIds" }, "pipeline": [ { "$match": { "_id": { "$in": [JUUID("481fde38-238f-4a78-9bd5-a7bf923babf8")] } } }, { "$match": { "$expr": { "$and": [ { "$eq": ["$message", "$$issue_message"]}, { "$not": { "$in": ["$_id","$$issue_lrs"] } } ] } } }, { "$project": { "_id": 1, "testRunId": 1, "emptyArray": [] } } ], "as": "logrecords" } }, { "$match": { "logrecords": { "$ne": [] } } }, { "$project": { "logRecordIds": { "$setDifference": [ { "$concatArrays": ["$logRecordIds","$logrecords._id"] }, "$logrecords.emptyArray" ] }, "failedTestRunIds": { "$setDifference": [ { "$concatArrays": ["$failedTestRunIds","$logrecords.testRunId"] }, "$logrecords.emptyArray" ] }, "failedTestRunsCount": { "$size": { "$setDifference": [ { "$concatArrays": ["$failedTestRunIds","$logrecords.testRunId"] }, "$logrecords.emptyArray" ] } }, "executionRequestId": 1, "message": 1 } } ])- Specified by:
getCreatedIssuesByLogRecordsMessagein interfaceCustomIssueRepository
-