jenkinsci / jenkinsci/git-plugin

[JENKINS-37407] Builds which should ignore commits in certain paths build anyway when no workspace is available

Open
#2,926 0 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

This issue relates to the comment here.

We use notifyCommit and the "Polling ignores commits in certain paths" option of the git plugin. This works well for the most part, except when the node used to build the project does not have a workspace:

Polling log when there is a workspace:


Started on 15-Aug-2016 10:50:16

Polling SCM changes on ci-jenkinsslavef-005

Using strategy: Default

[poll] Last Built Revision: Revision 066a44ba25df315a04e74fcccb357ae263e5b0f2 (origin/master)

> git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repositories

> git config remote.origin.url http://git/git/exemplar.git # timeout=10

Fetching upstream changes from http://git/git/exemplar.git

> git --version # timeout=10

> git -c core.askpass=true fetch --tags --progress http://git/git/exemplar.git +refs/heads/:refs/remotes/origin/

Polling for changes in

> git rev-parse origin/master^


Unknown macro: {commit}

# timeout=10

> git log --full-history --no-abbrev --format=raw -M -m --raw 066a44ba25df315a04e74fcccb357ae263e5b0f2..0ce3e7603c9facc5ebabfa60c31349345169a630 # timeout=10

Ignored commit 0ce3e7603c9facc5ebabfa60c31349345169a630: No paths matched included region whitelist

Done. Took 0.1 sec

No changes

Polling log when there is no workspace (rm'd workspace/$job on the node it last built on)


Started on 15-Aug-2016 10:51:55

No workspace is available, so can't check for updates.

Scheduling a new build to get a workspace. (nonexisting_workspace)

Done. Took 64 ms

Changes found

Unfortunately for us, when the project is built, it has effects downstream that we want to avoid. I understand that remote polling is not available with some of the more complex rules that require a git clone, but I would expect the repository to be cloned and checked without performing all the rest of the build steps.

I get the same behaviour whether the job is configured with "Force polling using workspace" option or not.

I'm not aware of any workaround at the moment. Is there any way to avoid triggering a full build in this case?

---
Originally reported by grahamallan, imported from: Builds which should ignore commits in certain paths build anyway when no workspace is available


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

This issue relates to the comment here.

We use notifyCommit and the "Polling ignores commits in certain paths" option of the git plugin. This works well for the most part, except when the node used to build the project does not have a workspace:

Polling log when there is a workspace:


Started on 15-Aug-2016 10:50:16
Polling SCM changes on ci-jenkinsslavef-005
Using strategy: Default
[poll] Last Built Revision: Revision 066a44ba25df315a04e74fcccb357ae263e5b0f2 (origin/master)
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
> git config remote.origin.url http://git/git/exemplar.git # timeout=10
Fetching upstream changes from http://git/git/exemplar.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress http://git/git/exemplar.git +refs/heads/:refs/remotes/origin/
Polling for changes in
> git rev-parse origin/master^


Unknown macro: {commit}

# timeout=10
> git log --full-history --no-abbrev --format=raw -M -m --raw 066a44ba25df315a04e74fcccb357ae263e5b0f2..0ce3e7603c9facc5ebabfa60c31349345169a630 # timeout=10
Ignored commit 0ce3e7603c9facc5ebabfa60c31349345169a630: No paths matched included region whitelist
Done. Took 0.1 sec
No changes

Polling log when there is no workspace (rm'd workspace/$job on the node it last built on)


Started on 15-Aug-2016 10:51:55
No workspace is available, so can't check for updates.
Scheduling a new build to get a workspace. (nonexisting_workspace)
Done. Took 64 ms
Changes found

Unfortunately for us, when the project is built, it has effects downstream that we want to avoid. I understand that remote polling is not available with some of the more complex rules that require a git clone, but I would expect the repository to be cloned and checked without performing all the rest of the build steps.

I get the same behaviour whether the job is configured with "Force polling using workspace" option or not.

I'm not aware of any workaround at the moment. Is there any way to avoid triggering a full build in this case?

environment

```
git plugin: 2.4.0

gitolite server using notifyCommit
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.