Skip to content

Commit

Permalink
Add message to the build log when a build is running as SYSTEM (#3908)
Browse files Browse the repository at this point in the history
* Add message to the build log when a build is running as SYSTEM

* Match previous log message
  • Loading branch information
daniel-beck authored and oleg-nenashev committed Mar 1, 2019
1 parent dcf354c commit c43610c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/hudson/model/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,9 @@ protected final void execute(@Nonnull RunExecution job) {
listener.started(getCauses());

Authentication auth = Jenkins.getAuthentication();
if (!auth.equals(ACL.SYSTEM)) {
if (auth.equals(ACL.SYSTEM)) {
listener.getLogger().println(Messages.Run_running_as_SYSTEM());
} else {
String id = auth.getName();
if (!auth.equals(Jenkins.ANONYMOUS)) {
final User usr = User.getById(id, false);
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/hudson/model/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ Run.BuildAborted=Build was aborted
Run.MarkedExplicitly=This record is explicitly marked to be kept.
Run.Permissions.Title=Run
Run.running_as_=Running as {0}
Run.running_as_SYSTEM=Running as SYSTEM
Run.UnableToDelete=Unable to delete {0}: {1}
Run.DeletePermission.Description=\
This permission allows users to manually delete specific builds from the build history.
Expand Down

0 comments on commit c43610c

Please sign in to comment.