jenkinsci / jenkinsci/git-plugin
[JENKINS-30345] broken workspace less polling
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
Job configuration is pretty simple:
url to repo, credentials, one branchspec with
```
**
```
or
```
*
```
. Worked before updates (sorry lost previous versions). Job assigned to cloud based slave. After update constantly prints "no workspace triggering build immediately" (lost exact message because bypassed issue atm).
- First of all with groovy build step i checked that job configuration returns true for requiresWorkspaceForPolling()
- I have no extensions so this line of code is bad https://github.com/jenkinsci/git-plugin/blob/054359b8601dff8234b6c45bf2c701c1616f635d/src/main/java/hudson/plugins/git/GitSCM.java#L521
- Then there are many inconsistency in code:
- https://github.com/jenkinsci/git-plugin/blob/054359b8601dff8234b6c45bf2c701c1616f635d/src/main/java/hudson/plugins/git/GitSCM.java#L489-L503 If i want all branches, then i have
```
**
```, but it will return null, that ends in requireWorkspace. If i have blank, then it will be converted to
```
**
```that is weird...
- https://github.com/jenkinsci/git-plugin/blob/3a83b2c181dd7bfb32e44c306b6360db8a83471c/src/main/java/hudson/plugins/git/BranchSpec.java#L40-L47 If you have blank, then treat as '**', but if you have space, then it will be trimmed and saved as empty. First of all trim must be done always before any checks, secondary use guava/commons checkNotNull and StringUtils.isEmpty, nonNull and etc helper codes, third place braces as such code ends to not obvious bugs, fourth replace tabs into spaces, that mixed in one line and screw screen (that ends again to bugs).
So to get working polling i set SPACE in branchspec.
Sorry, but have no time for providing any fixes in this over hacked plugin code.
Status blocker, because with cloud based slaves it triggers builds infinitely.
---
Originally reported by
integer, imported from: broken workspace less polling
Raw content of original issue
Job configuration is pretty simple:
url to repo, credentials, one branchspec with**or
*. Worked before updates (sorry lost previous versions). Job assigned to cloud based slave. After update constantly prints "no workspace triggering build immediately" (lost exact message because bypassed issue atm).
- First of all with groovy build step i checked that job configuration returns true for requiresWorkspaceForPolling()
- I have no extensions so this line of code is bad https://github.com/jenkinsci/git-plugin/blob/054359b8601dff8234b6c45bf2c701c1616f635d/src/main/java/hudson/plugins/git/GitSCM.java#L521
- Then there are many inconsistency in code:
- https://github.com/jenkinsci/git-plugin/blob/054359b8601dff8234b6c45bf2c701c1616f635d/src/main/java/hudson/plugins/git/GitSCM.java#L489-L503 If i want all branches, then i have
**
, but it will return null, that ends in requireWorkspace. If i have blank, then it will be converted to
**
that is weird...
- https://github.com/jenkinsci/git-plugin/blob/3a83b2c181dd7bfb32e44c306b6360db8a83471c/src/main/java/hudson/plugins/git/BranchSpec.java#L40-L47 If you have blank, then treat as '**', but if you have space, then it will be trimmed and saved as empty. First of all trim must be done always before any checks, secondary use guava/commons checkNotNull and StringUtils.isEmpty, nonNull and etc helper codes, third place braces as such code ends to not obvious bugs, fourth replace tabs into spaces, that mixed in one line and screw screen (that ends again to bugs).
So to get working polling i set SPACE in branchspec.
Sorry, but have no time for providing any fixes in this over hacked plugin code.
Status blocker, because with cloud based slaves it triggers builds infinitely.
environment
```
git-plugin 2.4.0, 2.3.5
git-client-plugin 1.18.0, 1.19.0
jenkins-lts 1.609.3
```
Contributor guide
Assessment
This issue has not been assessed yet.