Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: git-plugin
-
Labels:
-
Similar Issues:
Description
Using the following groovy code:
def thr = Thread.currentThread();
def currentBuild = thr?.executable;
def changes = currentBuild.getChangeSet();
changes.getItems().each {
ChangeLogSet.Entry lastChange = (ChangeLogSet.Entry)it;
lastChange.getTimestamp();
}
Produces a wrong timestamp (0).
Reverting to git plugin 2.0.1 fixes the issue.
Attachments
Issue Links
- is related to
-
JENKINS-21906 NumberFormatException occurs when accessing the JSON api
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Summary | Wrong timestamp retrieved from ChangeSet | Wrong timestamp retrieved from git ChangeSet |
Link |
This issue is related to |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Workflow | JNJira [ 156581 ] | JNJira + In-Review [ 207853 ] |
Hi, I have checked code. the issue is in GitChangeSet:isoDateFormat method. git tool returns the time in seconds but java Date class requires milliseconds - so just multiply time by 1000
fix: