diff --git a/api/swagger.yml b/api/swagger.yml index bb6806d6440..31c5690400e 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -3152,13 +3152,13 @@ paths: type: boolean - in: query name: since - description: Show commits more recent than a specific date-time + description: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. schema: type: string format: date-time - in: query name: stop_at - description: a reference to stop at + description: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. schema: type: string responses: diff --git a/clients/java-legacy/api/openapi.yaml b/clients/java-legacy/api/openapi.yaml index be33cae8b21..c8a8aec7825 100644 --- a/clients/java-legacy/api/openapi.yaml +++ b/clients/java-legacy/api/openapi.yaml @@ -2977,7 +2977,9 @@ paths: schema: type: boolean style: form - - description: Show commits more recent than a specific date-time + - description: Show commits more recent than a specific date-time. In case used + with stop_at parameter, will stop at the first commit that meets any of + the conditions. explode: true in: query name: since @@ -2986,7 +2988,8 @@ paths: format: date-time type: string style: form - - description: a reference to stop at + - description: A reference to stop at. In case used with since parameter, will + stop at the first commit that meets any of the conditions. explode: true in: query name: stop_at diff --git a/clients/java-legacy/docs/RefsApi.md b/clients/java-legacy/docs/RefsApi.md index b0bd6bc9d6d..944f4b55ee3 100644 --- a/clients/java-legacy/docs/RefsApi.md +++ b/clients/java-legacy/docs/RefsApi.md @@ -270,8 +270,8 @@ public class Example { List prefixes = Arrays.asList(); // List | list of paths, each element is a path of a prefix Boolean limit = true; // Boolean | limit the number of items in return to 'amount'. Without further indication on actual number of items. Boolean firstParent = true; // Boolean | if set to true, follow only the first parent upon reaching a merge commit - OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | Show commits more recent than a specific date-time - String stopAt = "stopAt_example"; // String | a reference to stop at + OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. + String stopAt = "stopAt_example"; // String | A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. try { CommitList result = apiInstance.logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent, since, stopAt); System.out.println(result); @@ -298,8 +298,8 @@ Name | Type | Description | Notes **prefixes** | [**List<String>**](String.md)| list of paths, each element is a path of a prefix | [optional] **limit** | **Boolean**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] **firstParent** | **Boolean**| if set to true, follow only the first parent upon reaching a merge commit | [optional] - **since** | **OffsetDateTime**| Show commits more recent than a specific date-time | [optional] - **stopAt** | **String**| a reference to stop at | [optional] + **since** | **OffsetDateTime**| Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. | [optional] + **stopAt** | **String**| A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. | [optional] ### Return type diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/RefsApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/RefsApi.java index da1b50b571e..026a3bb1b74 100644 --- a/clients/java-legacy/src/main/java/io/lakefs/clients/api/RefsApi.java +++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/RefsApi.java @@ -410,8 +410,8 @@ public okhttp3.Call findMergeBaseAsync(String repository, String sourceRef, Stri * @param prefixes list of paths, each element is a path of a prefix (optional) * @param limit limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) * @param firstParent if set to true, follow only the first parent upon reaching a merge commit (optional) - * @param since Show commits more recent than a specific date-time (optional) - * @param stopAt a reference to stop at (optional) + * @param since Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) + * @param stopAt A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -519,8 +519,8 @@ private okhttp3.Call logCommitsValidateBeforeCall(String repository, String ref, * @param prefixes list of paths, each element is a path of a prefix (optional) * @param limit limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) * @param firstParent if set to true, follow only the first parent upon reaching a merge commit (optional) - * @param since Show commits more recent than a specific date-time (optional) - * @param stopAt a reference to stop at (optional) + * @param since Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) + * @param stopAt A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) * @return CommitList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -549,8 +549,8 @@ public CommitList logCommits(String repository, String ref, String after, Intege * @param prefixes list of paths, each element is a path of a prefix (optional) * @param limit limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) * @param firstParent if set to true, follow only the first parent upon reaching a merge commit (optional) - * @param since Show commits more recent than a specific date-time (optional) - * @param stopAt a reference to stop at (optional) + * @param since Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) + * @param stopAt A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) * @return ApiResponse<CommitList> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -580,8 +580,8 @@ public ApiResponse logCommitsWithHttpInfo(String repository, String * @param prefixes list of paths, each element is a path of a prefix (optional) * @param limit limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) * @param firstParent if set to true, follow only the first parent upon reaching a merge commit (optional) - * @param since Show commits more recent than a specific date-time (optional) - * @param stopAt a reference to stop at (optional) + * @param since Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) + * @param stopAt A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) * @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 diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index 122c0752078..ce24f3a7b65 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -2977,7 +2977,9 @@ paths: schema: type: boolean style: form - - description: Show commits more recent than a specific date-time + - description: "Show commits more recent than a specific date-time. In case\ + \ used with stop_at parameter, will stop at the first commit that meets\ + \ any of the conditions." explode: true in: query name: since @@ -2986,7 +2988,8 @@ paths: format: date-time type: string style: form - - description: a reference to stop at + - description: "A reference to stop at. In case used with since parameter, will\ + \ stop at the first commit that meets any of the conditions." explode: true in: query name: stop_at diff --git a/clients/java/docs/RefsApi.md b/clients/java/docs/RefsApi.md index 106f750ff5f..36100c42bf4 100644 --- a/clients/java/docs/RefsApi.md +++ b/clients/java/docs/RefsApi.md @@ -277,8 +277,8 @@ public class Example { List prefixes = Arrays.asList(); // List | list of paths, each element is a path of a prefix Boolean limit = true; // Boolean | limit the number of items in return to 'amount'. Without further indication on actual number of items. Boolean firstParent = true; // Boolean | if set to true, follow only the first parent upon reaching a merge commit - OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | Show commits more recent than a specific date-time - String stopAt = "stopAt_example"; // String | a reference to stop at + OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. + String stopAt = "stopAt_example"; // String | A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. try { CommitList result = apiInstance.logCommits(repository, ref) .after(after) @@ -314,8 +314,8 @@ public class Example { | **prefixes** | [**List<String>**](String.md)| list of paths, each element is a path of a prefix | [optional] | | **limit** | **Boolean**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] | | **firstParent** | **Boolean**| if set to true, follow only the first parent upon reaching a merge commit | [optional] | -| **since** | **OffsetDateTime**| Show commits more recent than a specific date-time | [optional] | -| **stopAt** | **String**| a reference to stop at | [optional] | +| **since** | **OffsetDateTime**| Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. | [optional] | +| **stopAt** | **String**| A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. | [optional] | ### Return type diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java index c9b24af89c8..e266e9d9cd4 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/RefsApi.java @@ -726,7 +726,7 @@ public APIlogCommitsRequest firstParent(Boolean firstParent) { /** * Set since - * @param since Show commits more recent than a specific date-time (optional) + * @param since Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) * @return APIlogCommitsRequest */ public APIlogCommitsRequest since(OffsetDateTime since) { @@ -736,7 +736,7 @@ public APIlogCommitsRequest since(OffsetDateTime since) { /** * Set stopAt - * @param stopAt a reference to stop at (optional) + * @param stopAt A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) * @return APIlogCommitsRequest */ public APIlogCommitsRequest stopAt(String stopAt) { diff --git a/clients/python-legacy/docs/RefsApi.md b/clients/python-legacy/docs/RefsApi.md index e5f3930c748..b66a3d0afa8 100644 --- a/clients/python-legacy/docs/RefsApi.md +++ b/clients/python-legacy/docs/RefsApi.md @@ -330,8 +330,8 @@ with lakefs_client.ApiClient(configuration) as api_client: ] # [str] | list of paths, each element is a path of a prefix (optional) limit = True # bool | limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) first_parent = True # bool | if set to true, follow only the first parent upon reaching a merge commit (optional) - since = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Show commits more recent than a specific date-time (optional) - stop_at = "stop_at_example" # str | a reference to stop at (optional) + since = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) + stop_at = "stop_at_example" # str | A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) # example passing only required values which don't have defaults set try: @@ -364,8 +364,8 @@ Name | Type | Description | Notes **prefixes** | **[str]**| list of paths, each element is a path of a prefix | [optional] **limit** | **bool**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] **first_parent** | **bool**| if set to true, follow only the first parent upon reaching a merge commit | [optional] - **since** | **datetime**| Show commits more recent than a specific date-time | [optional] - **stop_at** | **str**| a reference to stop at | [optional] + **since** | **datetime**| Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. | [optional] + **stop_at** | **str**| A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. | [optional] ### Return type diff --git a/clients/python-legacy/lakefs_client/api/refs_api.py b/clients/python-legacy/lakefs_client/api/refs_api.py index fdc15c5e8a0..1b6549c4c77 100644 --- a/clients/python-legacy/lakefs_client/api/refs_api.py +++ b/clients/python-legacy/lakefs_client/api/refs_api.py @@ -571,8 +571,8 @@ def log_commits( prefixes ([str]): list of paths, each element is a path of a prefix. [optional] limit (bool): limit the number of items in return to 'amount'. Without further indication on actual number of items.. [optional] first_parent (bool): if set to true, follow only the first parent upon reaching a merge commit. [optional] - since (datetime): Show commits more recent than a specific date-time. [optional] - stop_at (str): a reference to stop at. [optional] + since (datetime): Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.. [optional] + stop_at (str): A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.. [optional] _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/RefsApi.md b/clients/python/docs/RefsApi.md index 8b555cf2178..ac999a2ff24 100644 --- a/clients/python/docs/RefsApi.md +++ b/clients/python/docs/RefsApi.md @@ -322,8 +322,8 @@ with lakefs_sdk.ApiClient(configuration) as api_client: prefixes = ['prefixes_example'] # List[str] | list of paths, each element is a path of a prefix (optional) limit = True # bool | limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional) first_parent = True # bool | if set to true, follow only the first parent upon reaching a merge commit (optional) - since = '2013-10-20T19:20:30+01:00' # datetime | Show commits more recent than a specific date-time (optional) - stop_at = 'stop_at_example' # str | a reference to stop at (optional) + since = '2013-10-20T19:20:30+01:00' # datetime | Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional) + stop_at = 'stop_at_example' # str | A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional) try: # get commit log from ref. If both objects and prefixes are empty, return all commits. @@ -349,8 +349,8 @@ Name | Type | Description | Notes **prefixes** | [**List[str]**](str.md)| list of paths, each element is a path of a prefix | [optional] **limit** | **bool**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional] **first_parent** | **bool**| if set to true, follow only the first parent upon reaching a merge commit | [optional] - **since** | **datetime**| Show commits more recent than a specific date-time | [optional] - **stop_at** | **str**| a reference to stop at | [optional] + **since** | **datetime**| Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. | [optional] + **stop_at** | **str**| A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. | [optional] ### Return type diff --git a/clients/python/lakefs_sdk/api/refs_api.py b/clients/python/lakefs_sdk/api/refs_api.py index ed4a67b223a..abc0529b5f8 100644 --- a/clients/python/lakefs_sdk/api/refs_api.py +++ b/clients/python/lakefs_sdk/api/refs_api.py @@ -406,7 +406,7 @@ def find_merge_base_with_http_info(self, repository : StrictStr, source_ref : An _request_auth=_params.get('_request_auth')) @validate_arguments - def log_commits(self, repository : StrictStr, ref : StrictStr, 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, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="a reference to stop at")] = None, **kwargs) -> CommitList: # noqa: E501 + def log_commits(self, repository : StrictStr, ref : StrictStr, 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, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, **kwargs) -> CommitList: # noqa: E501 """get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -431,9 +431,9 @@ def log_commits(self, repository : StrictStr, ref : StrictStr, after : Annotated :type limit: bool :param first_parent: if set to true, follow only the first parent upon reaching a merge commit :type first_parent: bool - :param since: Show commits more recent than a specific date-time + :param since: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. :type since: datetime - :param stop_at: a reference to stop at + :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. :type stop_at: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -452,7 +452,7 @@ def log_commits(self, repository : StrictStr, ref : StrictStr, after : Annotated return self.log_commits_with_http_info(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, **kwargs) # noqa: E501 @validate_arguments - def log_commits_with_http_info(self, repository : StrictStr, ref : StrictStr, 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, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="a reference to stop at")] = None, **kwargs) -> ApiResponse: # noqa: E501 + def log_commits_with_http_info(self, repository : StrictStr, ref : StrictStr, 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, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -477,9 +477,9 @@ def log_commits_with_http_info(self, repository : StrictStr, ref : StrictStr, af :type limit: bool :param first_parent: if set to true, follow only the first parent upon reaching a merge commit :type first_parent: bool - :param since: Show commits more recent than a specific date-time + :param since: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. :type since: datetime - :param stop_at: a reference to stop at + :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. :type stop_at: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index bb6806d6440..31c5690400e 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -3152,13 +3152,13 @@ paths: type: boolean - in: query name: since - description: Show commits more recent than a specific date-time + description: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. schema: type: string format: date-time - in: query name: stop_at - description: a reference to stop at + description: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. schema: type: string responses: diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 18419a9fbf7..bd4b3f66a2e 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -1209,6 +1209,13 @@ func (c *Catalog) ListCommits(ctx context.Context, repositoryID string, branch s if err != nil { return nil, false, fmt.Errorf("branch ref: %w", err) } + if params.StopAt != "" { + stopAtCommitID, err := c.dereferenceCommitID(ctx, repository, graveler.Ref(params.StopAt)) + if err != nil { + return nil, false, fmt.Errorf("stop_at: %w", err) + } + params.StopAt = stopAtCommitID.String() + } it, err := c.Store.Log(ctx, repository, commitID, params.FirstParent, params.Since) if err != nil { return nil, false, err