diff --git a/api/swagger.yml b/api/swagger.yml index e4d1fc5f51b..5328679b8ff 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -5673,12 +5673,12 @@ paths: - $ref: "#/components/parameters/PaginationAfter" - $ref: "#/components/parameters/PaginationAmount" - in: query - name: state + name: status schema: type: string enum: [ open, closed, all ] default: all - description: filter pull requests by state + description: filter pull requests by status responses: 200: description: list of pull requests diff --git a/clients/java-legacy/api/openapi.yaml b/clients/java-legacy/api/openapi.yaml index d3762515863..e08eba3296b 100644 --- a/clients/java-legacy/api/openapi.yaml +++ b/clients/java-legacy/api/openapi.yaml @@ -6798,11 +6798,11 @@ paths: style: form - explode: true in: query - name: state + name: status required: false schema: default: all - description: filter pull requests by state + description: filter pull requests by status enum: - open - closed diff --git a/clients/java-legacy/docs/ExperimentalApi.md b/clients/java-legacy/docs/ExperimentalApi.md index f6b1af07225..c4f2bf45687 100644 --- a/clients/java-legacy/docs/ExperimentalApi.md +++ b/clients/java-legacy/docs/ExperimentalApi.md @@ -1063,7 +1063,7 @@ null (empty response body) # **listPullRequests** -> PullRequestsList listPullRequests(repository, prefix, after, amount, state) +> PullRequestsList listPullRequests(repository, prefix, after, amount, status) list pull requests @@ -1114,9 +1114,9 @@ public class Example { String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return - String state = "open"; // String | + String status = "open"; // String | try { - PullRequestsList result = apiInstance.listPullRequests(repository, prefix, after, amount, state); + PullRequestsList result = apiInstance.listPullRequests(repository, prefix, after, amount, status); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExperimentalApi#listPullRequests"); @@ -1137,7 +1137,7 @@ Name | Type | Description | Notes **prefix** | **String**| return items prefixed with this value | [optional] **after** | **String**| return items after this value | [optional] **amount** | **Integer**| how many items to return | [optional] [default to 100] - **state** | **String**| | [optional] [default to all] [enum: open, closed, all] + **status** | **String**| | [optional] [default to all] [enum: open, closed, all] ### Return type diff --git a/clients/java-legacy/docs/PullsApi.md b/clients/java-legacy/docs/PullsApi.md index f08423af8da..563aa873f42 100644 --- a/clients/java-legacy/docs/PullsApi.md +++ b/clients/java-legacy/docs/PullsApi.md @@ -298,7 +298,7 @@ Name | Type | Description | Notes # **listPullRequests** -> PullRequestsList listPullRequests(repository, prefix, after, amount, state) +> PullRequestsList listPullRequests(repository, prefix, after, amount, status) list pull requests @@ -349,9 +349,9 @@ public class Example { String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return - String state = "open"; // String | + String status = "open"; // String | try { - PullRequestsList result = apiInstance.listPullRequests(repository, prefix, after, amount, state); + PullRequestsList result = apiInstance.listPullRequests(repository, prefix, after, amount, status); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PullsApi#listPullRequests"); @@ -372,7 +372,7 @@ Name | Type | Description | Notes **prefix** | **String**| return items prefixed with this value | [optional] **after** | **String**| return items after this value | [optional] **amount** | **Integer**| how many items to return | [optional] [default to 100] - **state** | **String**| | [optional] [default to all] [enum: open, closed, all] + **status** | **String**| | [optional] [default to all] [enum: open, closed, all] ### Return type diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java index 5c2df9402d6..236ac6a0a1c 100644 --- a/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/ExperimentalApi.java @@ -1707,7 +1707,7 @@ public okhttp3.Call hardResetBranchAsync(String repository, String branch, Strin * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1721,7 +1721,7 @@ public okhttp3.Call hardResetBranchAsync(String repository, String branch, Strin 0 Internal Server Error - */ - public okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -1746,8 +1746,8 @@ public okhttp3.Call listPullRequestsCall(String repository, String prefix, Strin localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); } - if (state != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); } final String[] localVarAccepts = { @@ -1769,7 +1769,7 @@ public okhttp3.Call listPullRequestsCall(String repository, String prefix, Strin } @SuppressWarnings("rawtypes") - private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { @@ -1777,7 +1777,7 @@ private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, Strin } - okhttp3.Call localVarCall = listPullRequestsCall(repository, prefix, after, amount, state, _callback); + okhttp3.Call localVarCall = listPullRequestsCall(repository, prefix, after, amount, status, _callback); return localVarCall; } @@ -1789,7 +1789,7 @@ private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, Strin * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @return PullRequestsList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1802,8 +1802,8 @@ private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, Strin 0 Internal Server Error - */ - public PullRequestsList listPullRequests(String repository, String prefix, String after, Integer amount, String state) throws ApiException { - ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + public PullRequestsList listPullRequests(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); return localVarResp.getData(); } @@ -1814,7 +1814,7 @@ public PullRequestsList listPullRequests(String repository, String prefix, Strin * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @return ApiResponse<PullRequestsList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1827,8 +1827,8 @@ public PullRequestsList listPullRequests(String repository, String prefix, Strin 0 Internal Server Error - */ - public ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + public ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1840,7 +1840,7 @@ public ApiResponse listPullRequestsWithHttpInfo(String reposit * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -1854,9 +1854,9 @@ public ApiResponse listPullRequestsWithHttpInfo(String reposit 0 Internal Server Error - */ - public okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java index bdf8102dd6e..a69fa23d1a3 100644 --- a/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/PullsApi.java @@ -489,7 +489,7 @@ public okhttp3.Call getPullRequestAsync(String repository, String pullRequest, f * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -503,7 +503,7 @@ public okhttp3.Call getPullRequestAsync(String repository, String pullRequest, f 0 Internal Server Error - */ - public okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -528,8 +528,8 @@ public okhttp3.Call listPullRequestsCall(String repository, String prefix, Strin localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); } - if (state != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); } final String[] localVarAccepts = { @@ -551,7 +551,7 @@ public okhttp3.Call listPullRequestsCall(String repository, String prefix, Strin } @SuppressWarnings("rawtypes") - private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { @@ -559,7 +559,7 @@ private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, Strin } - okhttp3.Call localVarCall = listPullRequestsCall(repository, prefix, after, amount, state, _callback); + okhttp3.Call localVarCall = listPullRequestsCall(repository, prefix, after, amount, status, _callback); return localVarCall; } @@ -571,7 +571,7 @@ private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, Strin * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @return PullRequestsList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -584,8 +584,8 @@ private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, Strin 0 Internal Server Error - */ - public PullRequestsList listPullRequests(String repository, String prefix, String after, Integer amount, String state) throws ApiException { - ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + public PullRequestsList listPullRequests(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); return localVarResp.getData(); } @@ -596,7 +596,7 @@ public PullRequestsList listPullRequests(String repository, String prefix, Strin * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @return ApiResponse<PullRequestsList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -609,8 +609,8 @@ public PullRequestsList listPullRequests(String repository, String prefix, Strin 0 Internal Server Error - */ - public ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + public ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -622,7 +622,7 @@ public ApiResponse listPullRequestsWithHttpInfo(String reposit * @param prefix return items prefixed with this value (optional) * @param after return items after this value (optional) * @param amount how many items to return (optional, default to 100) - * @param state (optional, default to all) + * @param status (optional, default to all) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -636,9 +636,9 @@ public ApiResponse listPullRequestsWithHttpInfo(String reposit 0 Internal Server Error - */ - public okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java index adafec2f22b..be50bce6f07 100644 --- a/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/ExperimentalApiTest.java @@ -246,8 +246,8 @@ public void listPullRequestsTest() throws ApiException { String prefix = null; String after = null; Integer amount = null; - String state = null; - PullRequestsList response = api.listPullRequests(repository, prefix, after, amount, state); + String status = null; + PullRequestsList response = api.listPullRequests(repository, prefix, after, amount, status); // TODO: test validations } diff --git a/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java b/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java index 10efd2a8dd6..20816ffbc7d 100644 --- a/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java +++ b/clients/java-legacy/src/test/java/io/lakefs/clients/api/PullsApiTest.java @@ -98,8 +98,8 @@ public void listPullRequestsTest() throws ApiException { String prefix = null; String after = null; Integer amount = null; - String state = null; - PullRequestsList response = api.listPullRequests(repository, prefix, after, amount, state); + String status = null; + PullRequestsList response = api.listPullRequests(repository, prefix, after, amount, status); // TODO: test validations } diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index 2a55db6f9e3..0b53e5b20db 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -6787,11 +6787,11 @@ paths: style: form - explode: true in: query - name: state + name: status required: false schema: default: all - description: filter pull requests by state + description: filter pull requests by status enum: - open - closed diff --git a/clients/java/docs/ExperimentalApi.md b/clients/java/docs/ExperimentalApi.md index 3fdde7644bb..b2ae55491d3 100644 --- a/clients/java/docs/ExperimentalApi.md +++ b/clients/java/docs/ExperimentalApi.md @@ -1080,7 +1080,7 @@ null (empty response body) # **listPullRequests** -> PullRequestsList listPullRequests(repository).prefix(prefix).after(after).amount(amount).state(state).execute(); +> PullRequestsList listPullRequests(repository).prefix(prefix).after(after).amount(amount).status(status).execute(); list pull requests @@ -1131,13 +1131,13 @@ public class Example { String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return - String state = "open"; // String | + String status = "open"; // String | try { PullRequestsList result = apiInstance.listPullRequests(repository) .prefix(prefix) .after(after) .amount(amount) - .state(state) + .status(status) .execute(); System.out.println(result); } catch (ApiException e) { @@ -1159,7 +1159,7 @@ public class Example { | **prefix** | **String**| return items prefixed with this value | [optional] | | **after** | **String**| return items after this value | [optional] | | **amount** | **Integer**| how many items to return | [optional] [default to 100] | -| **state** | **String**| | [optional] [default to all] [enum: open, closed, all] | +| **status** | **String**| | [optional] [default to all] [enum: open, closed, all] | ### Return type diff --git a/clients/java/docs/PullsApi.md b/clients/java/docs/PullsApi.md index 6f24e7fa7ec..11249f2f27a 100644 --- a/clients/java/docs/PullsApi.md +++ b/clients/java/docs/PullsApi.md @@ -301,7 +301,7 @@ public class Example { # **listPullRequests** -> PullRequestsList listPullRequests(repository).prefix(prefix).after(after).amount(amount).state(state).execute(); +> PullRequestsList listPullRequests(repository).prefix(prefix).after(after).amount(amount).status(status).execute(); list pull requests @@ -352,13 +352,13 @@ public class Example { String prefix = "prefix_example"; // String | return items prefixed with this value String after = "after_example"; // String | return items after this value Integer amount = 100; // Integer | how many items to return - String state = "open"; // String | + String status = "open"; // String | try { PullRequestsList result = apiInstance.listPullRequests(repository) .prefix(prefix) .after(after) .amount(amount) - .state(state) + .status(status) .execute(); System.out.println(result); } catch (ApiException e) { @@ -380,7 +380,7 @@ public class Example { | **prefix** | **String**| return items prefixed with this value | [optional] | | **after** | **String**| return items after this value | [optional] | | **amount** | **Integer**| how many items to return | [optional] [default to 100] | -| **state** | **String**| | [optional] [default to all] [enum: open, closed, all] | +| **status** | **String**| | [optional] [default to all] [enum: open, closed, all] | ### Return type diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java index aff5bf85374..dfa4a21b551 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ExperimentalApi.java @@ -2250,7 +2250,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiEx public APIhardResetBranchRequest hardResetBranch(String repository, String branch, String ref) { return new APIhardResetBranchRequest(repository, branch, ref); } - private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -2288,8 +2288,8 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); } - if (state != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); } final String[] localVarAccepts = { @@ -2312,26 +2312,26 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri } @SuppressWarnings("rawtypes") - private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { throw new ApiException("Missing the required parameter 'repository' when calling listPullRequests(Async)"); } - return listPullRequestsCall(repository, prefix, after, amount, state, _callback); + return listPullRequestsCall(repository, prefix, after, amount, status, _callback); } - private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -2342,7 +2342,7 @@ public class APIlistPullRequestsRequest { private String prefix; private String after; private Integer amount; - private String state; + private String status; private APIlistPullRequestsRequest(String repository) { this.repository = repository; @@ -2379,12 +2379,12 @@ public APIlistPullRequestsRequest amount(Integer amount) { } /** - * Set state - * @param state (optional, default to all) + * Set status + * @param status (optional, default to all) * @return APIlistPullRequestsRequest */ - public APIlistPullRequestsRequest state(String state) { - this.state = state; + public APIlistPullRequestsRequest status(String status) { + this.status = status; return this; } @@ -2404,7 +2404,7 @@ public APIlistPullRequestsRequest state(String state) { */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPullRequestsCall(repository, prefix, after, amount, state, _callback); + return listPullRequestsCall(repository, prefix, after, amount, status, _callback); } /** @@ -2422,7 +2422,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { */ public PullRequestsList execute() throws ApiException { - ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); return localVarResp.getData(); } @@ -2441,7 +2441,7 @@ public PullRequestsList execute() throws ApiException { */ public ApiResponse executeWithHttpInfo() throws ApiException { - return listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + return listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); } /** @@ -2460,7 +2460,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { */ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return listPullRequestsAsync(repository, prefix, after, amount, state, _callback); + return listPullRequestsAsync(repository, prefix, after, amount, status, _callback); } } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java index 2d78d29db31..9d62f7448ab 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/PullsApi.java @@ -636,7 +636,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throw public APIgetPullRequestRequest getPullRequest(String repository, String pullRequest) { return new APIgetPullRequestRequest(repository, pullRequest); } - private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -674,8 +674,8 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); } - if (state != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state)); + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); } final String[] localVarAccepts = { @@ -698,26 +698,26 @@ private okhttp3.Call listPullRequestsCall(String repository, String prefix, Stri } @SuppressWarnings("rawtypes") - private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsValidateBeforeCall(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { throw new ApiException("Missing the required parameter 'repository' when calling listPullRequests(Async)"); } - return listPullRequestsCall(repository, prefix, after, amount, state, _callback); + return listPullRequestsCall(repository, prefix, after, amount, status, _callback); } - private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String state) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, null); + private ApiResponse listPullRequestsWithHttpInfo(String repository, String prefix, String after, Integer amount, String status) throws ApiException { + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String state, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listPullRequestsAsync(String repository, String prefix, String after, Integer amount, String status, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, state, _callback); + okhttp3.Call localVarCall = listPullRequestsValidateBeforeCall(repository, prefix, after, amount, status, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -728,7 +728,7 @@ public class APIlistPullRequestsRequest { private String prefix; private String after; private Integer amount; - private String state; + private String status; private APIlistPullRequestsRequest(String repository) { this.repository = repository; @@ -765,12 +765,12 @@ public APIlistPullRequestsRequest amount(Integer amount) { } /** - * Set state - * @param state (optional, default to all) + * Set status + * @param status (optional, default to all) * @return APIlistPullRequestsRequest */ - public APIlistPullRequestsRequest state(String state) { - this.state = state; + public APIlistPullRequestsRequest status(String status) { + this.status = status; return this; } @@ -790,7 +790,7 @@ public APIlistPullRequestsRequest state(String state) { */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return listPullRequestsCall(repository, prefix, after, amount, state, _callback); + return listPullRequestsCall(repository, prefix, after, amount, status, _callback); } /** @@ -808,7 +808,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { */ public PullRequestsList execute() throws ApiException { - ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + ApiResponse localVarResp = listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); return localVarResp.getData(); } @@ -827,7 +827,7 @@ public PullRequestsList execute() throws ApiException { */ public ApiResponse executeWithHttpInfo() throws ApiException { - return listPullRequestsWithHttpInfo(repository, prefix, after, amount, state); + return listPullRequestsWithHttpInfo(repository, prefix, after, amount, status); } /** @@ -846,7 +846,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { */ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return listPullRequestsAsync(repository, prefix, after, amount, state, _callback); + return listPullRequestsAsync(repository, prefix, after, amount, status, _callback); } } diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java index 1432e417a7b..dff4e0e38f1 100644 --- a/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/ExperimentalApiTest.java @@ -234,12 +234,12 @@ public void listPullRequestsTest() throws ApiException { String prefix = null; String after = null; Integer amount = null; - String state = null; + String status = null; PullRequestsList response = api.listPullRequests(repository) .prefix(prefix) .after(after) .amount(amount) - .state(state) + .status(status) .execute(); // TODO: test validations } diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java index 48a35804e5a..2d0e0ee9d1c 100644 --- a/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/PullsApiTest.java @@ -88,12 +88,12 @@ public void listPullRequestsTest() throws ApiException { String prefix = null; String after = null; Integer amount = null; - String state = null; + String status = null; PullRequestsList response = api.listPullRequests(repository) .prefix(prefix) .after(after) .amount(amount) - .state(state) + .status(status) .execute(); // TODO: test validations } diff --git a/clients/python-legacy/docs/ExperimentalApi.md b/clients/python-legacy/docs/ExperimentalApi.md index f6d8c916990..ab66f06adae 100644 --- a/clients/python-legacy/docs/ExperimentalApi.md +++ b/clients/python-legacy/docs/ExperimentalApi.md @@ -1366,7 +1366,7 @@ with lakefs_client.ApiClient(configuration) as api_client: prefix = "prefix_example" # str | return items prefixed with this value (optional) after = "after_example" # str | return items after this value (optional) amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 - state = "all" # str | (optional) if omitted the server will use the default value of "all" + status = "all" # str | (optional) if omitted the server will use the default value of "all" # example passing only required values which don't have defaults set try: @@ -1380,7 +1380,7 @@ with lakefs_client.ApiClient(configuration) as api_client: # and optional values try: # list pull requests - api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, status=status) pprint(api_response) except lakefs_client.ApiException as e: print("Exception when calling ExperimentalApi->list_pull_requests: %s\n" % e) @@ -1395,7 +1395,7 @@ Name | Type | Description | Notes **prefix** | **str**| return items prefixed with this value | [optional] **after** | **str**| return items after this value | [optional] **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 - **state** | **str**| | [optional] if omitted the server will use the default value of "all" + **status** | **str**| | [optional] if omitted the server will use the default value of "all" ### Return type diff --git a/clients/python-legacy/docs/PullsApi.md b/clients/python-legacy/docs/PullsApi.md index 5c1054c058b..b039551c41a 100644 --- a/clients/python-legacy/docs/PullsApi.md +++ b/clients/python-legacy/docs/PullsApi.md @@ -416,7 +416,7 @@ with lakefs_client.ApiClient(configuration) as api_client: prefix = "prefix_example" # str | return items prefixed with this value (optional) after = "after_example" # str | return items after this value (optional) amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 - state = "all" # str | (optional) if omitted the server will use the default value of "all" + status = "all" # str | (optional) if omitted the server will use the default value of "all" # example passing only required values which don't have defaults set try: @@ -430,7 +430,7 @@ with lakefs_client.ApiClient(configuration) as api_client: # and optional values try: # list pull requests - api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, status=status) pprint(api_response) except lakefs_client.ApiException as e: print("Exception when calling PullsApi->list_pull_requests: %s\n" % e) @@ -445,7 +445,7 @@ Name | Type | Description | Notes **prefix** | **str**| return items prefixed with this value | [optional] **after** | **str**| return items after this value | [optional] **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 - **state** | **str**| | [optional] if omitted the server will use the default value of "all" + **status** | **str**| | [optional] if omitted the server will use the default value of "all" ### Return type diff --git a/clients/python-legacy/lakefs_client/api/experimental_api.py b/clients/python-legacy/lakefs_client/api/experimental_api.py index 3e5b7221f7f..c4f5bca7cec 100644 --- a/clients/python-legacy/lakefs_client/api/experimental_api.py +++ b/clients/python-legacy/lakefs_client/api/experimental_api.py @@ -790,7 +790,7 @@ def __init__(self, api_client=None): 'prefix', 'after', 'amount', - 'state', + 'status', ], 'required': [ 'repository', @@ -798,7 +798,7 @@ def __init__(self, api_client=None): 'nullable': [ ], 'enum': [ - 'state', + 'status', ], 'validation': [ 'amount', @@ -813,7 +813,7 @@ def __init__(self, api_client=None): }, }, 'allowed_values': { - ('state',): { + ('status',): { "OPEN": "open", "CLOSED": "closed", @@ -829,7 +829,7 @@ def __init__(self, api_client=None): (str,), 'amount': (int,), - 'state': + 'status': (str,), }, 'attribute_map': { @@ -837,14 +837,14 @@ def __init__(self, api_client=None): 'prefix': 'prefix', 'after': 'after', 'amount': 'amount', - 'state': 'state', + 'status': 'status', }, 'location_map': { 'repository': 'path', 'prefix': 'query', 'after': 'query', 'amount': 'query', - 'state': 'query', + 'status': 'query', }, 'collection_format_map': { } @@ -1852,7 +1852,7 @@ def list_pull_requests( prefix (str): return items prefixed with this value. [optional] after (str): return items after this value. [optional] amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 - state (str): [optional] if omitted the server will use the default value of "all" + status (str): [optional] if omitted the server will use the default value of "all" _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object diff --git a/clients/python-legacy/lakefs_client/api/pulls_api.py b/clients/python-legacy/lakefs_client/api/pulls_api.py index 48971a198eb..5055a4a15f1 100644 --- a/clients/python-legacy/lakefs_client/api/pulls_api.py +++ b/clients/python-legacy/lakefs_client/api/pulls_api.py @@ -246,7 +246,7 @@ def __init__(self, api_client=None): 'prefix', 'after', 'amount', - 'state', + 'status', ], 'required': [ 'repository', @@ -254,7 +254,7 @@ def __init__(self, api_client=None): 'nullable': [ ], 'enum': [ - 'state', + 'status', ], 'validation': [ 'amount', @@ -269,7 +269,7 @@ def __init__(self, api_client=None): }, }, 'allowed_values': { - ('state',): { + ('status',): { "OPEN": "open", "CLOSED": "closed", @@ -285,7 +285,7 @@ def __init__(self, api_client=None): (str,), 'amount': (int,), - 'state': + 'status': (str,), }, 'attribute_map': { @@ -293,14 +293,14 @@ def __init__(self, api_client=None): 'prefix': 'prefix', 'after': 'after', 'amount': 'amount', - 'state': 'state', + 'status': 'status', }, 'location_map': { 'repository': 'path', 'prefix': 'query', 'after': 'query', 'amount': 'query', - 'state': 'query', + 'status': 'query', }, 'collection_format_map': { } @@ -609,7 +609,7 @@ def list_pull_requests( prefix (str): return items prefixed with this value. [optional] after (str): return items after this value. [optional] amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 - state (str): [optional] if omitted the server will use the default value of "all" + status (str): [optional] if omitted the server will use the default value of "all" _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object diff --git a/clients/python/docs/ExperimentalApi.md b/clients/python/docs/ExperimentalApi.md index e9948121a4b..b58e97e9cdb 100644 --- a/clients/python/docs/ExperimentalApi.md +++ b/clients/python/docs/ExperimentalApi.md @@ -1244,7 +1244,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_pull_requests** -> PullRequestsList list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) +> PullRequestsList list_pull_requests(repository, prefix=prefix, after=after, amount=amount, status=status) list pull requests @@ -1312,11 +1312,11 @@ with lakefs_sdk.ApiClient(configuration) as api_client: prefix = 'prefix_example' # str | return items prefixed with this value (optional) after = 'after_example' # str | return items after this value (optional) amount = 100 # int | how many items to return (optional) (default to 100) - state = 'all' # str | (optional) (default to 'all') + status = 'all' # str | (optional) (default to 'all') try: # list pull requests - api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, status=status) print("The response of ExperimentalApi->list_pull_requests:\n") pprint(api_response) except Exception as e: @@ -1334,7 +1334,7 @@ Name | Type | Description | Notes **prefix** | **str**| return items prefixed with this value | [optional] **after** | **str**| return items after this value | [optional] **amount** | **int**| how many items to return | [optional] [default to 100] - **state** | **str**| | [optional] [default to 'all'] + **status** | **str**| | [optional] [default to 'all'] ### Return type diff --git a/clients/python/docs/PullsApi.md b/clients/python/docs/PullsApi.md index dd6214c9961..102400da3b9 100644 --- a/clients/python/docs/PullsApi.md +++ b/clients/python/docs/PullsApi.md @@ -349,7 +349,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_pull_requests** -> PullRequestsList list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) +> PullRequestsList list_pull_requests(repository, prefix=prefix, after=after, amount=amount, status=status) list pull requests @@ -417,11 +417,11 @@ with lakefs_sdk.ApiClient(configuration) as api_client: prefix = 'prefix_example' # str | return items prefixed with this value (optional) after = 'after_example' # str | return items after this value (optional) amount = 100 # int | how many items to return (optional) (default to 100) - state = 'all' # str | (optional) (default to 'all') + status = 'all' # str | (optional) (default to 'all') try: # list pull requests - api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, state=state) + api_response = api_instance.list_pull_requests(repository, prefix=prefix, after=after, amount=amount, status=status) print("The response of PullsApi->list_pull_requests:\n") pprint(api_response) except Exception as e: @@ -439,7 +439,7 @@ Name | Type | Description | Notes **prefix** | **str**| return items prefixed with this value | [optional] **after** | **str**| return items after this value | [optional] **amount** | **int**| how many items to return | [optional] [default to 100] - **state** | **str**| | [optional] [default to 'all'] + **status** | **str**| | [optional] [default to 'all'] ### Return type diff --git a/clients/python/lakefs_sdk/api/experimental_api.py b/clients/python/lakefs_sdk/api/experimental_api.py index 3cd9f612500..09a9d7685bd 100644 --- a/clients/python/lakefs_sdk/api/experimental_api.py +++ b/clients/python/lakefs_sdk/api/experimental_api.py @@ -1792,13 +1792,13 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri _request_auth=_params.get('_request_auth')) @validate_arguments - def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 + def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, status : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 """list pull requests # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_pull_requests(repository, prefix, after, amount, state, async_req=True) + >>> thread = api.list_pull_requests(repository, prefix, after, amount, status, async_req=True) >>> result = thread.get() :param repository: (required) @@ -1809,8 +1809,8 @@ def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional :type after: str :param amount: how many items to return :type amount: int - :param state: - :type state: str + :param status: + :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -1825,16 +1825,16 @@ def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: raise ValueError("Error! Please call the list_pull_requests_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_pull_requests_with_http_info(repository, prefix, after, amount, state, **kwargs) # noqa: E501 + return self.list_pull_requests_with_http_info(repository, prefix, after, amount, status, **kwargs) # noqa: E501 @validate_arguments - def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 + def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, status : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """list pull requests # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_pull_requests_with_http_info(repository, prefix, after, amount, state, async_req=True) + >>> thread = api.list_pull_requests_with_http_info(repository, prefix, after, amount, status, async_req=True) >>> result = thread.get() :param repository: (required) @@ -1845,8 +1845,8 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann :type after: str :param amount: how many items to return :type amount: int - :param state: - :type state: str + :param status: + :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -1879,7 +1879,7 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann 'prefix', 'after', 'amount', - 'state' + 'status' ] _all_params.extend( [ @@ -1922,8 +1922,8 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann if _params.get('amount') is not None: # noqa: E501 _query_params.append(('amount', _params['amount'])) - if _params.get('state') is not None: # noqa: E501 - _query_params.append(('state', _params['state'])) + if _params.get('status') is not None: # noqa: E501 + _query_params.append(('status', _params['status'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) diff --git a/clients/python/lakefs_sdk/api/pulls_api.py b/clients/python/lakefs_sdk/api/pulls_api.py index 39ac873a4a3..4bf145f141f 100644 --- a/clients/python/lakefs_sdk/api/pulls_api.py +++ b/clients/python/lakefs_sdk/api/pulls_api.py @@ -505,13 +505,13 @@ def get_pull_request_with_http_info(self, repository : StrictStr, pull_request : _request_auth=_params.get('_request_auth')) @validate_arguments - def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 + def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, status : Optional[StrictStr] = None, **kwargs) -> PullRequestsList: # noqa: E501 """list pull requests # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_pull_requests(repository, prefix, after, amount, state, async_req=True) + >>> thread = api.list_pull_requests(repository, prefix, after, amount, status, async_req=True) >>> result = thread.get() :param repository: (required) @@ -522,8 +522,8 @@ def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional :type after: str :param amount: how many items to return :type amount: int - :param state: - :type state: str + :param status: + :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one @@ -538,16 +538,16 @@ def list_pull_requests(self, repository : StrictStr, prefix : Annotated[Optional kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: raise ValueError("Error! Please call the list_pull_requests_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_pull_requests_with_http_info(repository, prefix, after, amount, state, **kwargs) # noqa: E501 + return self.list_pull_requests_with_http_info(repository, prefix, after, amount, status, **kwargs) # noqa: E501 @validate_arguments - def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, state : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 + def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, status : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 """list pull requests # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_pull_requests_with_http_info(repository, prefix, after, amount, state, async_req=True) + >>> thread = api.list_pull_requests_with_http_info(repository, prefix, after, amount, status, async_req=True) >>> result = thread.get() :param repository: (required) @@ -558,8 +558,8 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann :type after: str :param amount: how many items to return :type amount: int - :param state: - :type state: str + :param status: + :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -592,7 +592,7 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann 'prefix', 'after', 'amount', - 'state' + 'status' ] _all_params.extend( [ @@ -635,8 +635,8 @@ def list_pull_requests_with_http_info(self, repository : StrictStr, prefix : Ann if _params.get('amount') is not None: # noqa: E501 _query_params.append(('amount', _params['amount'])) - if _params.get('state') is not None: # noqa: E501 - _query_params.append(('state', _params['state'])) + if _params.get('status') is not None: # noqa: E501 + _query_params.append(('status', _params['status'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) diff --git a/clients/rust/docs/ExperimentalApi.md b/clients/rust/docs/ExperimentalApi.md index 04fc3644646..7305a996f5f 100644 --- a/clients/rust/docs/ExperimentalApi.md +++ b/clients/rust/docs/ExperimentalApi.md @@ -360,7 +360,7 @@ Name | Type | Description | Required | Notes ## list_pull_requests -> models::PullRequestsList list_pull_requests(repository, prefix, after, amount, state) +> models::PullRequestsList list_pull_requests(repository, prefix, after, amount, status) list pull requests ### Parameters @@ -372,7 +372,7 @@ Name | Type | Description | Required | Notes **prefix** | Option<**String**> | return items prefixed with this value | | **after** | Option<**String**> | return items after this value | | **amount** | Option<**i32**> | how many items to return | |[default to 100] -**state** | Option<**String**> | | |[default to all] +**status** | Option<**String**> | | |[default to all] ### Return type diff --git a/clients/rust/docs/PullsApi.md b/clients/rust/docs/PullsApi.md index 1c90ac01427..f8a932ec0eb 100644 --- a/clients/rust/docs/PullsApi.md +++ b/clients/rust/docs/PullsApi.md @@ -101,7 +101,7 @@ Name | Type | Description | Required | Notes ## list_pull_requests -> models::PullRequestsList list_pull_requests(repository, prefix, after, amount, state) +> models::PullRequestsList list_pull_requests(repository, prefix, after, amount, status) list pull requests ### Parameters @@ -113,7 +113,7 @@ Name | Type | Description | Required | Notes **prefix** | Option<**String**> | return items prefixed with this value | | **after** | Option<**String**> | return items after this value | | **amount** | Option<**i32**> | how many items to return | |[default to 100] -**state** | Option<**String**> | | |[default to all] +**status** | Option<**String**> | | |[default to all] ### Return type diff --git a/clients/rust/src/apis/experimental_api.rs b/clients/rust/src/apis/experimental_api.rs index f50f7483f68..aefceaa641f 100644 --- a/clients/rust/src/apis/experimental_api.rs +++ b/clients/rust/src/apis/experimental_api.rs @@ -573,7 +573,7 @@ pub async fn hard_reset_branch(configuration: &configuration::Configuration, rep } } -pub async fn list_pull_requests(configuration: &configuration::Configuration, repository: &str, prefix: Option<&str>, after: Option<&str>, amount: Option, state: Option<&str>) -> Result> { +pub async fn list_pull_requests(configuration: &configuration::Configuration, repository: &str, prefix: Option<&str>, after: Option<&str>, amount: Option, status: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -590,8 +590,8 @@ pub async fn list_pull_requests(configuration: &configuration::Configuration, re if let Some(ref local_var_str) = amount { local_var_req_builder = local_var_req_builder.query(&[("amount", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = state { - local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); diff --git a/clients/rust/src/apis/pulls_api.rs b/clients/rust/src/apis/pulls_api.rs index ce1498ef760..77d07981b4c 100644 --- a/clients/rust/src/apis/pulls_api.rs +++ b/clients/rust/src/apis/pulls_api.rs @@ -176,7 +176,7 @@ pub async fn get_pull_request(configuration: &configuration::Configuration, repo } } -pub async fn list_pull_requests(configuration: &configuration::Configuration, repository: &str, prefix: Option<&str>, after: Option<&str>, amount: Option, state: Option<&str>) -> Result> { +pub async fn list_pull_requests(configuration: &configuration::Configuration, repository: &str, prefix: Option<&str>, after: Option<&str>, amount: Option, status: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -193,8 +193,8 @@ pub async fn list_pull_requests(configuration: &configuration::Configuration, re if let Some(ref local_var_str) = amount { local_var_req_builder = local_var_req_builder.query(&[("amount", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = state { - local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + if let Some(ref local_var_str) = status { + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index e4d1fc5f51b..5328679b8ff 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -5673,12 +5673,12 @@ paths: - $ref: "#/components/parameters/PaginationAfter" - $ref: "#/components/parameters/PaginationAmount" - in: query - name: state + name: status schema: type: string enum: [ open, closed, all ] default: all - description: filter pull requests by state + description: filter pull requests by status responses: 200: description: list of pull requests diff --git a/pkg/api/controller.go b/pkg/api/controller.go index d06711a86b1..7fc85142372 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -71,6 +71,9 @@ const ( httpStatusClientClosedRequest = 499 // httpStatusClientClosedRequestText text used for client closed request status code httpStatusClientClosedRequestText = "Client closed request" + + pullRequestClosed = "CLOSED" + pullRequestOpen = "OPEN" ) type actionsHandler interface { @@ -5178,13 +5181,50 @@ func (c *Controller) PostStatsEvents(w http.ResponseWriter, r *http.Request, bod } func (c *Controller) ListPullRequests(w http.ResponseWriter, r *http.Request, repository string, params apigen.ListPullRequestsParams) { - writeResponse(w, r, http.StatusNotImplemented, nil) + if !c.authorize(w, r, permissions.Node{ + Permission: permissions.Permission{ + Action: permissions.ListPullRequestsAction, + Resource: permissions.RepoArn(repository), + }, + }) { + return + } + ctx := r.Context() + c.LogAction(ctx, "list_pull_requests", r, repository, "", "") + + res, hasMore, err := c.Catalog.ListPullRequest(ctx, repository, paginationPrefix(params.Prefix), paginationAmount(params.Amount), paginationAfter(params.After), pullRequestStatus(params.Status)) + if c.handleAPIError(ctx, w, r, err) { + return + } + + pulls := make([]apigen.PullRequest, 0, len(res)) + for _, p := range res { + pulls = append(pulls, apigen.PullRequest{ + PullRequestBasic: apigen.PullRequestBasic{ + // Explicitly not passing description so to maintain permissions requirements + Description: nil, + Status: swag.String(p.Status), + Title: swag.String(p.Title), + }, + Id: p.ID, + Author: p.Author, + CreationDate: p.CreationDate, + DestinationBranch: p.DestinationBranch, + SourceBranch: p.SourceBranch, + MergedCommitId: nil, + }) + } + response := apigen.PullRequestsList{ + Results: pulls, + Pagination: paginationFor(hasMore, pulls, "Id"), + } + writeResponse(w, r, http.StatusOK, response) } func (c *Controller) CreatePullRequest(w http.ResponseWriter, r *http.Request, body apigen.CreatePullRequestJSONRequestBody, repository string) { if !c.authorize(w, r, permissions.Node{ Permission: permissions.Permission{ - Action: permissions.CreatePullReqeustAction, + Action: permissions.WritePullReqeustAction, Resource: permissions.RepoArn(repository), }, }) { @@ -5222,7 +5262,7 @@ func (c *Controller) DeletePullRequest(w http.ResponseWriter, r *http.Request, r func (c *Controller) GetPullRequest(w http.ResponseWriter, r *http.Request, repository string, pullRequestID string) { if !c.authorize(w, r, permissions.Node{ Permission: permissions.Permission{ - Action: permissions.GetPullReqeustAction, + Action: permissions.ReadPullReqeustAction, Resource: permissions.RepoArn(repository), }, }) { @@ -5317,6 +5357,20 @@ func paginationAmount(v *apigen.PaginationAmount) int { return i } +func pullRequestStatus(v *string) string { + if v == nil { + return "" + } + switch *v { + case "open": + return pullRequestOpen + case "closed": + return pullRequestClosed + default: + return "" + } +} + func resolvePathList(objects, prefixes *[]string) []catalog.PathRecord { var pathRecords []catalog.PathRecord if objects == nil && prefixes == nil { diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index 5b726db9e5f..69032c1171a 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -5326,10 +5326,12 @@ func TestController_CreatePullRequest(t *testing.T) { SourceBranch: "branch_b", Title: "My title", } - _, err := clt.CreateBranchWithResponse(ctx, repo, apigen.CreateBranchJSONRequestBody{ + branchResp, err := clt.CreateBranchWithResponse(ctx, repo, apigen.CreateBranchJSONRequestBody{ Name: body.SourceBranch, Source: "main", }) + require.NoError(t, err) + require.Equal(t, http.StatusCreated, branchResp.StatusCode()) resp, err := clt.CreatePullRequestWithResponse(ctx, repo, body) require.NoError(t, err) @@ -5354,6 +5356,141 @@ func TestController_CreatePullRequest(t *testing.T) { }) } +func TestController_ListPullRequestsHandler(t *testing.T) { + clt, deps := setupClientWithAdmin(t) + ctx := context.Background() + repo := testUniqueRepoName() + _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + require.NoError(t, err) + + t.Run("no pull requests", func(t *testing.T) { + resp, err := clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + Amount: apiutil.Ptr(apigen.PaginationAmount(-1)), + }) + verifyResponseOK(t, resp, err) + require.Equal(t, 0, len(resp.JSON200.Results)) + }) + + t.Run("repo doesnt exist", func(t *testing.T) { + resp, err := clt.ListPullRequestsWithResponse(ctx, "repo666", &apigen.ListPullRequestsParams{ + Amount: apiutil.Ptr(apigen.PaginationAmount(2)), + }) + testutil.Must(t, err) + require.NotNil(t, resp.JSON404) + }) + + t.Run("with pull requests", func(t *testing.T) { + // Create Data + expected := make([]catalog.PullRequest, 100) + for i := range expected { + expected[i].Title = fmt.Sprintf("pull_%d", i) + expected[i].DestinationBranch = "main" + expected[i].SourceBranch = fmt.Sprintf("src_%d", i) + expected[i].Description = fmt.Sprintf("description_%d", i) + expected[i].Status = "OPEN" + + branchResp, err := clt.CreateBranchWithResponse(ctx, repo, apigen.CreateBranchJSONRequestBody{ + Name: expected[i].SourceBranch, + Source: "main", + }) + require.NoError(t, err) + require.Equal(t, http.StatusCreated, branchResp.StatusCode()) + + resp, err := clt.CreatePullRequestWithResponse(ctx, repo, apigen.CreatePullRequestJSONRequestBody{ + Description: expected[i].Description, + DestinationBranch: expected[i].DestinationBranch, + SourceBranch: expected[i].SourceBranch, + Title: expected[i].Title, + }) + require.NoError(t, err) + require.Equal(t, http.StatusCreated, resp.StatusCode()) + expected[i].ID = string(resp.Body) + } + // Sort by p.ID + sort.Slice(expected, func(i, j int) bool { + return expected[i].ID < expected[j].ID + }) + + // list 10 + amount := 10 + resp, err := clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + Amount: apiutil.Ptr(apigen.PaginationAmount(amount)), + }) + verifyResponseOK(t, resp, err) + require.Equal(t, amount, len(resp.JSON200.Results)) + require.True(t, resp.JSON200.Pagination.HasMore) + require.Equal(t, expected[amount-1].ID, resp.JSON200.Pagination.NextOffset) + + for i := range amount { + require.Equal(t, expected[i].ID, resp.JSON200.Results[i].Id) + } + + // List all + resp, err = clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + Amount: apiutil.Ptr(apigen.PaginationAmount(-1)), + }) + verifyResponseOK(t, resp, err) + + require.Equal(t, len(expected), len(resp.JSON200.Results)) + userResp, err := clt.GetCurrentUserWithResponse(ctx) + require.NoError(t, err) + require.NotNil(t, userResp.JSON200) + + for i, p := range resp.JSON200.Results { + require.Equal(t, expected[i].ID, p.Id) + require.Equal(t, expected[i].Title, swag.StringValue(p.Title)) + require.Equal(t, userResp.JSON200.User.Id, p.Author) + require.Equal(t, expected[i].SourceBranch, p.SourceBranch) + require.Equal(t, expected[i].DestinationBranch, p.DestinationBranch) + require.Equal(t, expected[i].Status, swag.StringValue(p.Status)) + } + + require.False(t, resp.JSON200.Pagination.HasMore) + require.Empty(t, resp.JSON200.Pagination.NextOffset) + + // Test out of bounds + after := expected[len(expected)-1].ID + resp, err = clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + Amount: apiutil.Ptr(apigen.PaginationAmount(-1)), + After: apiutil.Ptr(apigen.PaginationAfter(after)), + }) + verifyResponseOK(t, resp, err) + require.Equal(t, 0, len(resp.JSON200.Results)) + + // Test Pagination + afterInt := 35 + after = expected[afterInt].ID + amount = 2 + resp, err = clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + After: apiutil.Ptr[apigen.PaginationAfter](apigen.PaginationAfter(after)), + Amount: apiutil.Ptr[apigen.PaginationAmount](apigen.PaginationAmount(amount)), + }) + verifyResponseOK(t, resp, err) + require.NotNil(t, resp.JSON200) + require.Equal(t, amount, len(resp.JSON200.Results)) + require.True(t, resp.JSON200.Pagination.HasMore) + require.Equal(t, expected[afterInt+amount].ID, resp.JSON200.Pagination.NextOffset) + for i := range amount { + require.Equal(t, expected[afterInt+i+1].ID, resp.JSON200.Results[i].Id) + } + + // TODO (niro): Add tests for open / closed after we implement update + status := "closed" + resp, err = clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + Status: &status, + }) + verifyResponseOK(t, resp, err) + require.Equal(t, 0, len(resp.JSON200.Results)) + + status = "open" + resp, err = clt.ListPullRequestsWithResponse(ctx, repo, &apigen.ListPullRequestsParams{ + Status: &status, + }) + verifyResponseOK(t, resp, err) + require.Equal(t, len(expected), len(resp.JSON200.Results)) + }) +} + // pollRestoreStatus polls the restore status endpoint until the restore is complete or times out. // test will fail in case of error. // will return nil in case of timeout. diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 011ea8dbedb..899b08d80c1 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -243,6 +243,7 @@ const ( ListBranchesLimitMax = 1000 ListTagsLimitMax = 1000 DiffLimitMax = 1000 + ListPullsLimitMax = 1000 ListEntriesLimitMax = 10000 sharedWorkers = 30 pendingTasksPerWorker = 3 @@ -2941,6 +2942,87 @@ func (c *Catalog) CreatePullRequest(ctx context.Context, repositoryID string, re return pullID, nil } +func shouldSkipByStatus(requested string, status graveler.PullRequestStatus) bool { + if status.String() == requested { + return false + } + + switch requested { + case graveler.PullRequestStatus_CLOSED.String(): // CLOSED can be either CLOSED OR MERGED + return status != graveler.PullRequestStatus_CLOSED && status != graveler.PullRequestStatus_MERGED + case graveler.PullRequestStatus_OPEN.String(): // OPEN must be equal to OPEN + return status != graveler.PullRequestStatus_OPEN + default: // Anything else should return all + return false + } +} + +func (c *Catalog) ListPullRequest(ctx context.Context, repositoryID, prefix string, limit int, after, status string) ([]*PullRequest, bool, error) { + if err := validator.Validate([]validator.ValidateArg{ + {Name: "repository", Value: repositoryID, Fn: graveler.ValidateRepositoryID}, + }); err != nil { + return nil, false, err + } + repository, err := c.getRepository(ctx, repositoryID) + if err != nil { + return nil, false, err + } + + // normalize limit + if limit < 0 || limit > ListPullsLimitMax { + limit = ListPullsLimitMax + } + it, err := c.Store.ListPullRequests(ctx, repository) + if err != nil { + return nil, false, err + } + defer it.Close() + + afterPR := graveler.PullRequestID(after) + prefixPR := graveler.PullRequestID(prefix) + if afterPR < prefixPR { + it.SeekGE(prefixPR) + } else { + it.SeekGE(afterPR) + } + var pulls []*PullRequest + for it.Next() { + v := it.Value() + if v.ID == afterPR || shouldSkipByStatus(status, v.Status) { + continue + } + pullID := v.ID.String() + // break in case we got to a pull outside our prefix + if !strings.HasPrefix(pullID, prefix) { + break + } + p := &PullRequest{ + ID: pullID, + Title: v.Title, + Status: v.Status.String(), + Description: v.Description, + Author: v.Author, + SourceBranch: v.Source, + DestinationBranch: v.Destination, + CreationDate: v.CreationDate, + } + pulls = append(pulls, p) + if len(pulls) >= limit+1 { + break + } + } + if err := it.Err(); err != nil { + return nil, false, err + } + // return results (optionally trimmed) and hasMore + hasMore := false + if len(pulls) > limit { + hasMore = true + pulls = pulls[:limit] + } + return pulls, hasMore, nil +} + func newCatalogEntryFromEntry(commonPrefix bool, path string, ent *Entry) DBEntry { b := NewDBEntryBuilder(). CommonLevel(commonPrefix). diff --git a/pkg/catalog/fake_graveler_test.go b/pkg/catalog/fake_graveler_test.go index d922d2e6fa3..cd0742a84ad 100644 --- a/pkg/catalog/fake_graveler_test.go +++ b/pkg/catalog/fake_graveler_test.go @@ -310,6 +310,10 @@ func (g *FakeGraveler) CreatePullRequest(context.Context, *graveler.RepositoryRe panic("implement me") } +func (g *FakeGraveler) ListPullRequests(context.Context, *graveler.RepositoryRecord) (graveler.PullsIterator, error) { + panic("implement me") +} + type FakeValueIterator struct { Data []*graveler.ValueRecord Index int diff --git a/pkg/catalog/model.go b/pkg/catalog/model.go index 5649998535c..e47bab0944e 100644 --- a/pkg/catalog/model.go +++ b/pkg/catalog/model.go @@ -67,9 +67,11 @@ type PullRequest struct { Author string SourceBranch string DestinationBranch string + Status string + CreationDate time.Time } -// AddressType is the type of an entry address +// AddressType is the type of entry address type AddressType int32 const ( diff --git a/pkg/graveler/graveler.go b/pkg/graveler/graveler.go index a4f86bb2e12..a67447bc401 100644 --- a/pkg/graveler/graveler.go +++ b/pkg/graveler/graveler.go @@ -745,6 +745,9 @@ type Collaborator interface { // CreatePullRequest creates a pull request on a repository for the given source and destination branches CreatePullRequest(ctx context.Context, repository *RepositoryRecord, pullRequest *PullRequestRecord) error + + // ListPullRequests lists pull requests on repository + ListPullRequests(ctx context.Context, repository *RepositoryRecord) (PullsIterator, error) } // Internal structures used by Graveler @@ -3383,6 +3386,10 @@ func (g *Graveler) CreatePullRequest(ctx context.Context, repository *Repository return g.RefManager.CreatePullRequest(ctx, repository, record.ID, &record.PullRequest) } +func (g *Graveler) ListPullRequests(ctx context.Context, repository *RepositoryRecord) (PullsIterator, error) { + return g.RefManager.ListPullRequests(ctx, repository) +} + func tagsToValueIterator(src TagIterator) ValueIterator { return &tagValueIterator{ src: src, diff --git a/pkg/graveler/mock/graveler.go b/pkg/graveler/mock/graveler.go index 9f7bb2144ed..5a6bdaeaf7f 100644 --- a/pkg/graveler/mock/graveler.go +++ b/pkg/graveler/mock/graveler.go @@ -1269,6 +1269,21 @@ func (mr *MockCollaboratorMockRecorder) GetPullRequest(ctx, repository, pullRequ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPullRequest", reflect.TypeOf((*MockCollaborator)(nil).GetPullRequest), ctx, repository, pullRequestID) } +// ListPullRequests mocks base method. +func (m *MockCollaborator) ListPullRequests(ctx context.Context, repository *graveler.RepositoryRecord) (graveler.PullsIterator, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListPullRequests", ctx, repository) + ret0, _ := ret[0].(graveler.PullsIterator) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListPullRequests indicates an expected call of ListPullRequests. +func (mr *MockCollaboratorMockRecorder) ListPullRequests(ctx, repository interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPullRequests", reflect.TypeOf((*MockCollaborator)(nil).ListPullRequests), ctx, repository) +} + // MockRepositoryIterator is a mock of RepositoryIterator interface. type MockRepositoryIterator struct { ctrl *gomock.Controller diff --git a/pkg/permissions/actions.gen.go b/pkg/permissions/actions.gen.go index 293f1d54da9..4fbc5eff01f 100644 --- a/pkg/permissions/actions.gen.go +++ b/pkg/permissions/actions.gen.go @@ -60,6 +60,7 @@ var Actions = []string{ "retention:PrepareGarbageCollectionUncommitted", "branches:GetBranchProtectionRules", "branches:SetBranchProtectionRules", - "pr:GetPullRequest", - "pr:CreatePullRequest", + "pr:ReadPullRequest", + "pr:WritePullRequest", + "pr:ListPullRequests", } diff --git a/pkg/permissions/actions.go b/pkg/permissions/actions.go index 51e767f8e85..117475e1c05 100644 --- a/pkg/permissions/actions.go +++ b/pkg/permissions/actions.go @@ -71,8 +71,9 @@ const ( PrepareGarbageCollectionUncommittedAction = "retention:PrepareGarbageCollectionUncommitted" GetBranchProtectionRulesAction = "branches:GetBranchProtectionRules" SetBranchProtectionRulesAction = "branches:SetBranchProtectionRules" - GetPullReqeustAction = "pr:GetPullRequest" - CreatePullReqeustAction = "pr:CreatePullRequest" + ReadPullReqeustAction = "pr:ReadPullRequest" + WritePullReqeustAction = "pr:WritePullRequest" + ListPullRequestsAction = "pr:ListPullRequests" ) var serviceSet = map[string]struct{}{