This pull request introduces a configurable indexingTimeout parameter to the gitlab-branch-source plugin in Jenkins, enabling users to set a maximum wait time in seconds for indexing GitLab repositories. This timeout is applied in two key methods:
retrieve(SCMHead head, TaskListener listener): Updated to use an ExecutorService and Future, allowing the operation to be cancelled if it exceeds the specified timeout.
retrieveActions(SCMSourceCriteria criteria, SCMHeadObserver observer, SCMHeadEvent<?> event, TaskListener listener): Modified to respect the indexingTimeout configuration across the indexing process, including checks on branches, merge requests, and tags.
Additionally, a new indexingTimeout property has been added to the UI configuration in the config-detail.jelly file, enabling users to set the timeout through Jenkins' interface.
Testing Done
Manual tests were conducted to validate indexingTimeout functionality in various scenarios:
Defined Timeout (greater than 0): A sample timeout was set, and it was verified that the operation would be interrupted if it exceeded the specified time.
Undefined Timeout (0): Confirmed that the operation continued without interruption when indexingTimeout was set to 0.
Regression: Tested across different projects and merge requests to ensure the new functionality did not interfere with standard GitLab indexing.
Submitter Checklist
[x] Opening from a topic/feature/bugfix branch and not from the main branch.
[x] The pull request title represents the desired changelog entry.
[x] Clear description of changes made.
[x] Links to relevant issues in GitHub or Jira.
[ ] Links to relevant pull requests, especially upstream and downstream changes.
[x] Provided tests that demonstrate feature works or fixes the issue.
Description of Changes
This pull request introduces a configurable
indexingTimeout
parameter to thegitlab-branch-source
plugin in Jenkins, enabling users to set a maximum wait time in seconds for indexing GitLab repositories. This timeout is applied in two key methods:retrieve(SCMHead head, TaskListener listener)
: Updated to use anExecutorService
andFuture
, allowing the operation to be cancelled if it exceeds the specified timeout.retrieveActions(SCMSourceCriteria criteria, SCMHeadObserver observer, SCMHeadEvent<?> event, TaskListener listener)
: Modified to respect theindexingTimeout
configuration across the indexing process, including checks on branches, merge requests, and tags.Additionally, a new
indexingTimeout
property has been added to the UI configuration in theconfig-detail.jelly
file, enabling users to set the timeout through Jenkins' interface.Testing Done
Manual tests were conducted to validate
indexingTimeout
functionality in various scenarios:indexingTimeout
was set to 0.Submitter Checklist