Skip to content

Commit

Permalink
Fix broken job link.
Browse files Browse the repository at this point in the history
Now simply use the URL `../[build]/[url]` to navigate to the latest results.
Fixes:
- jenkinsci/code-coverage-api-plugin#227
- jenkinsci/code-coverage-api-plugin#231
  • Loading branch information
uhafner committed Nov 3, 2021
1 parent 741e9f0 commit e40ab76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/jenkins/plugins/util/JobAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ public void doIndex(final StaplerRequest request, final StaplerResponse response
Optional<T> action = getLatestAction();
if (action.isPresent()) {
T buildAction = action.get();
response.sendRedirect2(String.format("../../../%s%s",
buildAction.getOwner().getUrl(), buildAction.getUrlName()));
response.sendRedirect2(String.format("../%d/%s",
buildAction.getOwner().getNumber(),
buildAction.getUrlName()));
}
}

Expand Down

0 comments on commit e40ab76

Please sign in to comment.