This is an automated email from the ASF dual-hosted git repository.
pvillard31 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 58b3c3d520b NIFI-16391 Limit commits to the first page instead of
paging the full history (#11727)
58b3c3d520b is described below
commit 58b3c3d520bbb879aa0d3491ce5a3c775d952440
Author: Jannik Rebmann <[email protected]>
AuthorDate: Wed Sep 30 12:54:47 2026 +0200
NIFI-16391 Limit commits to the first page instead of paging the full
history (#11727)
---
.../src/main/java/org/apache/nifi/gitlab/GitLabFlowRegistryClient.java | 3 ++-
.../src/main/java/org/apache/nifi/gitlab/GitLabRepositoryClient.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git
a/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabFlowRegistryClient.java
b/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabFlowRegistryClient.java
index 20af7b1a38e..632f54c8097 100644
---
a/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabFlowRegistryClient.java
+++
b/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabFlowRegistryClient.java
@@ -32,7 +32,8 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
@Tags({"git", "gitlab", "registry", "flow"})
-@CapabilityDescription("Flow Registry Client that uses the GitLab REST API to
version control flows in a GitLab Project.")
+@CapabilityDescription("Flow Registry Client that uses the GitLab REST API to
version control flows in a GitLab Project. "
+ + "Note that for a given flow, the registry client will retrieve at
most the last 10 commits to limit API calls.")
public class GitLabFlowRegistryClient extends AbstractGitFlowRegistryClient {
static final PropertyDescriptor GITLAB_API_URL = new
PropertyDescriptor.Builder()
diff --git
a/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabRepositoryClient.java
b/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabRepositoryClient.java
index 7e5db4d4d19..aea6064589f 100644
---
a/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabRepositoryClient.java
+++
b/nifi-extension-bundles/nifi-gitlab-bundle/nifi-gitlab-extensions/src/main/java/org/apache/nifi/gitlab/GitLabRepositoryClient.java
@@ -81,6 +81,7 @@ public class GitLabRepositoryClient implements
GitRepositoryClient {
private static final String DIRECTORY_MODE = "040000";
private static final int DEFAULT_ITEMS_PER_PAGE = 100;
+ private static final int COMMIT_PAGE_SIZE = 10;
private static final TokenInfo UNKNOWN_TOKEN = new TokenInfo("unknown",
false, false);
@@ -212,7 +213,7 @@ public class GitLabRepositoryClient implements
GitRepositoryClient {
logger.debug("Getting commits for path [{}] on branch [{}] in
repository [{}]", resolvedPath, branch, projectPath);
final CommitsApi commitsApi = gitLab.getCommitsApi();
- return execute(() -> commitsApi.getCommits(projectPath, branch,
resolvedPath).stream()
+ return execute(() -> commitsApi.getCommits(projectPath, branch, null,
null, resolvedPath, COMMIT_PAGE_SIZE).next().stream()
.map(this::toGitCommit)
.toList()
);