jenkinsci / jenkinsci/git-plugin

[JENKINS-29765] Build Retry (both Naginator and Rebuild) pick the latest commit, not retrying one

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

Description

This is easily reproduced on a standalone Cent 6 or Cent 7 machine.

Create a job:



  • Uses Git

  • A trivial build step that fails, "false" or "exit 1" in the shell build-step for example

  • Uses one of the above retry mechanisms (Naginator or Rebuilder)

  • In the case of Naginator, stub it with a regex to keep it from automatically retrying

  • In the case of Rebuilder, enable the rebuild without parameters

  • Make a commit and run a build. It should fail. Note Git SHA (This is build #1)

  • Make a second commit, then build it. It should also fail. Note the Git SHA (This is build #2)

  • Now go back to build #1 and retrigger it. (build #3)

Expectation:

The retriggered build (build #3) should use the same Git SHA as build #1.

Observed problem:

The Git SHA is the HEAD of the branch at the time of the retrigger.

---
Originally reported by eegah, imported from: Build Retry (both Naginator and Rebuild) pick the latest commit, not retrying one


  • status: Open
  • priority: Major
  • component(s): git-plugin, naginator-plugin, rebuild-plugin
  • resolution: Unresolved
  • votes: 14
  • watchers: 15
  • imported: 2025-12-02

Raw content of original issue

This is easily reproduced on a standalone Cent 6 or Cent 7 machine.

Create a job:



  • Uses Git

  • A trivial build step that fails, "false" or "exit 1" in the shell build-step for example

  • Uses one of the above retry mechanisms (Naginator or Rebuilder)

  • In the case of Naginator, stub it with a regex to keep it from automatically retrying

  • In the case of Rebuilder, enable the rebuild without parameters

  • Make a commit and run a build. It should fail. Note Git SHA (This is build #1)

  • Make a second commit, then build it. It should also fail. Note the Git SHA (This is build #2)

  • Now go back to build #1 and retrigger it. (build #3)

Expectation:

The retriggered build (build #3) should use the same Git SHA as build #1.

Observed problem:

The Git SHA is the HEAD of the branch at the time of the retrigger.

environment

```
Standalone CentOS 7 machine. Jenkins 1.622; Git plugin 2.4.0; Naginator 1.15; rebuilder 1.25

Replicated on a CentOS 6 machine. Jenkins 1.580.3; Git plugin 2.3.5; Naginator 1.14; Rebuilder 1.22

Replicated on a Win 7 machine. Jenkins 1.596.2; Git plugin 2.4.0; Gerrit plugin 2.16.0; Rebuilder 1.25 (I do have Naginator 1.15 installed, but it is not involved in this job)

Replicated on amazon-linux-ami 2017.03. Jenkins ver. 2.77
```

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.