• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline

      At least within a block step, it should be possible to set something like a ConsoleLogFilter to decorate the output written to TaskListener. Possible use cases:

      • Replacement for decorateLogger in SimpleBuildWrapper.
      • Ability to mask passwords from BindingStep in credentials-binding (unless there is an equivalent to getSensitiveBuildVariables moved up to Run).

          [JENKINS-27392] API to decorate console output

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-24673 [ JENKINS-24673 ]

          Jesse Glick added a comment - - edited

          Suggested API: reuse ConsoleLogFilter (passing null for the AbstractBuild argument and requiring implementations to be Serializable), where you can pass this in to BodyInvoker.withContexts (first checking for an instance in your own context to delegate to).

          OutputStream SimpleBuildWrapper.decorateLogger(AbstractBuild, OutputStream) could then be made to delegate to a new method ConsoleLogFilter SimpleBuildWrapper.createDecorator(Run<?,?> build) if the API were copied into core, and CoreWrapperStep (PR 37) needs to call that.

          Jesse Glick added a comment - - edited Suggested API: reuse ConsoleLogFilter (passing null for the AbstractBuild argument and requiring implementations to be Serializable ), where you can pass this in to BodyInvoker.withContexts (first checking for an instance in your own context to delegate to). OutputStream SimpleBuildWrapper.decorateLogger(AbstractBuild, OutputStream) could then be made to delegate to a new method ConsoleLogFilter SimpleBuildWrapper.createDecorator(Run<?,?> build) if the API were copied into core, and CoreWrapperStep (PR 37) needs to call that.
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-27207 [ JENKINS-27207 ]

          Tom FENNELLY added a comment - - edited

          Just stashing something I experimented with for this last week (before this JIRA was created). Not based on TaskListener, but instead filtering the logs inside a block based on an Action. We'll more than likely throw this away but just wanted to attach in case.

          https://github.com/tfennelly/workflow-plugin/tree/mask-log-entries (link to the branch - press "Compare" etc if you want)

          (totally incomplete and only kinda works)

          Tom FENNELLY added a comment - - edited Just stashing something I experimented with for this last week (before this JIRA was created). Not based on TaskListener, but instead filtering the logs inside a block based on an Action. We'll more than likely throw this away but just wanted to attach in case. https://github.com/tfennelly/workflow-plugin/tree/mask-log-entries (link to the branch - press "Compare" etc if you want) (totally incomplete and only kinda works)
          Kohsuke Kawaguchi made changes -
          Link New: This issue is blocking JENKINS-27486 [ JENKINS-27486 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26053 [ JENKINS-26053 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: