Skip to content

Commit

Permalink
Merge pull request #8676 from yaoxuwan/issue_8675
Browse files Browse the repository at this point in the history
fix: 流水线变量版本仓库过滤器,最多仅支持1w个文件 #8675
  • Loading branch information
bkci-bot authored Apr 23, 2023
2 parents a482870 + 3c03994 commit eabf718
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,9 @@ class BkRepoClient constructor(
pathNamePairs: List<Pair<String, String>>, // (path eq and name match) or
metadata: Map<String, String>, // eq and
page: Int,
pageSize: Int
pageSize: Int,
sortBy: String? = null,
direction: Sort.Direction? = null
): QueryData {
logger.info(
"queryByPathNamePairOrMetadataEqAnd, userId: $userId, projectId: $projectId," +
Expand Down Expand Up @@ -956,7 +958,7 @@ class BkRepoClient constructor(
}
val rule = Rule.NestedRule(ruleList, Rule.NestedRule.RelationType.AND)

return query(userId, projectId, rule, page, pageSize)
return query(userId, projectId, rule, page, pageSize, sortBy, direction)
}

fun queryByPattern(
Expand Down Expand Up @@ -1059,11 +1061,23 @@ class BkRepoClient constructor(
return doRequest(request).resolveResponse<Response<PackageVersionInfo>>()!!.data!!
}

private fun query(userId: String, projectId: String, rule: Rule, page: Int, pageSize: Int): QueryData {
private fun query(
userId: String,
projectId: String,
rule: Rule,
page: Int,
pageSize: Int,
sortBy: String? = null,
direction: Sort.Direction? = null
): QueryData {
logger.info("query, userId: $userId, rule: $rule, page: $page, pageSize: $pageSize")
val queryModel = QueryModel(
page = PageLimit(page, pageSize),
sort = Sort(listOf("fullPath"), Sort.Direction.ASC),
sort = if (!sortBy.isNullOrBlank() && direction != null) {
Sort(listOf(sortBy), direction)
} else {
Sort(listOf("fullPath"), Sort.Direction.ASC)
},
select = mutableListOf(),
rule = rule
)
Expand Down

0 comments on commit eabf718

Please sign in to comment.