File tree Expand file tree Collapse file tree 5 files changed +34
-26
lines changed
java/io/jenkins/plugins/pipelinegraphview/cards/items
resources/io/jenkins/plugins/pipelinegraphview Expand file tree Collapse file tree 5 files changed +34
-26
lines changed Original file line number Diff line number Diff line change @@ -17,21 +17,21 @@ public static Optional<RunDetailsItem> get(WorkflowRun run) {
1717
1818 AbstractTestResultAction <?> action = run .getAction (AbstractTestResultAction .class );
1919
20- if (action != null ) {
21- RunDetailsItem testResult = new RunDetailsItem .Builder ()
22- .ionicon ("clipboard-outline" )
23- .text (Messages .testResults ())
24- .href ("../%s" .formatted (action .getUrlName ()))
25- .tooltip ("Passed: %s%nFailed: %s%nSkipped: %s%nTotal: %s"
26- .formatted (
27- action .getTotalCount () - action .getFailCount () - action .getSkipCount (),
28- action .getFailCount (),
29- action .getSkipCount (),
30- action .getTotalCount ()))
31- .build ();
32- return Optional .of (testResult );
20+ if (action == null ) {
21+ return Optional .empty ();
3322 }
3423
35- return Optional .empty ();
24+ String passed =
25+ Messages .testResults_passed (action .getTotalCount () - action .getFailCount () - action .getSkipCount ());
26+ String failed = Messages .testResults_failed (action .getFailCount ());
27+ String skipped = Messages .testResults_skipped (action .getSkipCount ());
28+ String total = Messages .testResults_total (action .getTotalCount ());
29+ RunDetailsItem testResult = new RunDetailsItem .Builder ()
30+ .ionicon ("clipboard-outline" )
31+ .text (Messages .testResults ())
32+ .href ("../" + action .getUrlName ())
33+ .tooltip (passed + "\n " + failed + "\n " + skipped + "\n " + total )
34+ .build ();
35+ return Optional .of (testResult );
3636 }
3737}
Original file line number Diff line number Diff line change 11package io .jenkins .plugins .pipelinegraphview .cards .items ;
22
33import hudson .Util ;
4+ import io .jenkins .plugins .pipelinegraphview .Messages ;
45import io .jenkins .plugins .pipelinegraphview .cards .RunDetailsItem ;
56import java .util .ArrayList ;
67import java .util .Date ;
@@ -15,9 +16,8 @@ public static List<RunDetailsItem> get(WorkflowRun run) {
1516
1617 RunDetailsItem startedItem = new RunDetailsItem .Builder ()
1718 .ionicon ("time-outline" )
18- .text ("Started "
19- + Util .getTimeSpanString (Math .abs (run .getTime ().getTime () - new Date ().getTime ()))
20- + " ago" )
19+ .text (Messages .startedAgo (
20+ Util .getTimeSpanString (Math .abs (run .getTime ().getTime () - new Date ().getTime ()))))
2121 .build ();
2222 runDetailsItems .add (startedItem );
2323
@@ -26,15 +26,15 @@ public static List<RunDetailsItem> get(WorkflowRun run) {
2626 if (timeInQueueAction != null ) {
2727 RunDetailsItem queuedItem = new RunDetailsItem .Builder ()
2828 .ionicon ("hourglass-outline" )
29- .text ("Queued " + Util .getTimeSpanString (timeInQueueAction .getQueuingDurationMillis ()))
29+ .text (Messages . queued ( Util .getTimeSpanString (timeInQueueAction .getQueuingDurationMillis () )))
3030 .build ();
3131
3232 runDetailsItems .add (queuedItem );
3333 }
3434
3535 RunDetailsItem timerItem = new RunDetailsItem .Builder ()
3636 .ionicon ("timer-outline" )
37- .text ("Took " + run .getDurationString ())
37+ .text (Messages . took ( run .getDurationString () ))
3838 .build ();
3939
4040 runDetailsItems .add (timerItem );
Original file line number Diff line number Diff line change 22
33import hudson .model .Cause ;
44import hudson .model .CauseAction ;
5+ import io .jenkins .plugins .pipelinegraphview .Messages ;
56import io .jenkins .plugins .pipelinegraphview .cards .RunDetailsItem ;
67import java .util .List ;
78import java .util .Objects ;
@@ -17,12 +18,11 @@ public static Optional<RunDetailsItem> get(WorkflowRun run) {
1718 return causes .stream ()
1819 .filter (cause -> cause instanceof Cause .UpstreamCause )
1920 .map (upstreamCause -> (Cause .UpstreamCause ) upstreamCause )
20- .map (upstreamCause -> upstreamCause . getUpstreamRun () )
21+ .map (Cause . UpstreamCause :: getUpstreamRun )
2122 .filter (Objects ::nonNull )
22- // TODO i18n
2323 .map (upstreamRun -> new RunDetailsItem .Builder ()
2424 .ionicon ("play-circle-outline" )
25- .text ("Started by upstream pipeline " + upstreamRun .getDisplayName ())
25+ .text (Messages . cause_upstream ( upstreamRun .getDisplayName () ))
2626 .href (DisplayURLProvider .get ().getRunURL (upstreamRun ))
2727 .build ())
2828 .findAny ();
Original file line number Diff line number Diff line change 33import hudson .model .Cause ;
44import hudson .model .CauseAction ;
55import hudson .model .User ;
6+ import io .jenkins .plugins .pipelinegraphview .Messages ;
67import io .jenkins .plugins .pipelinegraphview .cards .RunDetailsItem ;
78import java .util .HashMap ;
89import java .util .List ;
@@ -20,11 +21,9 @@ public static Optional<RunDetailsItem> get(WorkflowRun run) {
2021 .map (userIdCause -> (Cause .UserIdCause ) userIdCause )
2122 .map (userIdCause -> User .get (userIdCause .getUserId (), false , new HashMap <>()))
2223 .filter (Objects ::nonNull )
23- // TODO i18n
24- .map (user -> "Manually run by " + user .getDisplayName ())
25- .map (startedAt -> new RunDetailsItem .Builder ()
24+ .map (user -> new RunDetailsItem .Builder ()
2625 .ionicon ("person-outline" )
27- .text (startedAt )
26+ .text (Messages . cause_user ( user . getDisplayName ()) )
2827 .build ())
2928 .findAny ();
3029 }
Original file line number Diff line number Diff line change 11startedAgo =Started {0} ago
22noBuilds =No builds
3+ queued =Queued {0}
4+ took =Took {0}
35
46node.start =Start
57node.end =End
@@ -13,4 +15,11 @@ timings.month ={0} mo
1315timings.year ={0} yr
1416
1517testResults =Test results
18+ testResults.passed =Passed {0}
19+ testResults.failed =Failed {0}
20+ testResults.skipped =Skipped {0}
21+ testResults.total = Total {0}
1622artifacts =Artifacts
23+
24+ cause.upstream =Started by upstream pipeline {0}
25+ cause.user =Manually run by {0}
You can’t perform that action at this time.
0 commit comments