jenkinsci / jenkinsci/git-plugin

[JENKINS-26540] notifyCommit pushes with a sha1 trigger builds where scm polling is not enabled

Open
#2,590 1 comment 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

Not sure if this is a bug or expected behaviour, but its a bit confusing.

If I call the notifyCommit URL without a sha1, then the build only triggers if 'scm polling' is enabled. However, if a sha1 is provided then the build triggers regardless.

I realise that when the sha1 is provided, strictly speaking this isn't 'polling' happening. However this means that the only way to disable triggering (eg for a nightly sonar build) is to enable the scm trigger, set no time and then select the "Ignore post-commit hooks" option. ie:


  • polling disabled - triggers if and only if a sha1 was provided

  • polling enabled - triggers

  • polling enabled but skipped - doesn't trigger

this is a but unintuitive and confusing. The git plugin should require that polling is enabled (even with an empty time), just like it does if a sha1 isn't provided.

---
Originally reported by bbaetz, imported from: notifyCommit pushes with a sha1 trigger builds where scm polling is not enabled


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

Raw content of original issue

Not sure if this is a bug or expected behaviour, but its a bit confusing.

If I call the notifyCommit URL without a sha1, then the build only triggers if 'scm polling' is enabled. However, if a sha1 is provided then the build triggers regardless.

I realise that when the sha1 is provided, strictly speaking this isn't 'polling' happening. However this means that the only way to disable triggering (eg for a nightly sonar build) is to enable the scm trigger, set no time and then select the "Ignore post-commit hooks" option. ie:


  • polling disabled - triggers if and only if a sha1 was provided

  • polling enabled - triggers

  • polling enabled but skipped - doesn't trigger

this is a but unintuitive and confusing. The git plugin should require that polling is enabled (even with an empty time), just like it does if a sha1 isn't provided.

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.