Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62688

User.toString() should print the users ID not fullname

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:
    • Released As:
      Jenkins 2.243

      Description

      User.toString rturns the users full name. 

      However a full name may not be unique and as such when used in log messages we get something that is less than helpful.

       

      toString is generally only used for for debugging and logging aids and as such we should print the user's Id so we can actually identify the user. 
      This also makes it easier to use in log statements as you can just use the code user  rather than user != null ? user.getId() : null  (which when coupled with logging that may not happen removes some code without having to utilize messageSuppliers or surround a one line block with if (Logger.isEnabled(Level.BLAH)) { ... } 

       

        Attachments

          Issue Links

            Activity

            Hide
            danielbeck Daniel Beck added a comment -

            Caused JENKINS-63712.

            Show
            danielbeck Daniel Beck added a comment - Caused JENKINS-63712 .
            Hide
            markewaite Mark Waite added a comment -

            Caused JENKINS-63744. Fixed for JENKINS-63744 in PR-964. I assume this means that there are likely more places in Jelly forms where the git plugin needs to stop using the implict toString() and use an explicit field instead.

            Show
            markewaite Mark Waite added a comment - Caused JENKINS-63744 . Fixed for JENKINS-63744 in PR-964 . I assume this means that there are likely more places in Jelly forms where the git plugin needs to stop using the implict toString() and use an explicit field instead.

              People

              Assignee:
              teilo James Nord
              Reporter:
              teilo James Nord
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: