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

Optionally show action in CHANGES token

    XMLWordPrintable

Details

    Description

      Is it possible to use the action attribute, from the changelog.xml file to allow me to use something like this in Email-Ext:
      ${CHANGES, pathFormat="\t%a%p\n"

      where %a is a new variable that can be either Added, Modified or Deleted (or maybe use + and -)

      Attachments

        Activity

          stussy Simon Stassen added a comment - - edited

          I see this is more complex than what I originally thought - the action attribute is not made available in hudson.scm.ChangeLogSet

          http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.Entry.html

          Could we use getAffectedFiles instead of getAffectedPaths, and optionally use getEditType?

          http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.AffectedFile.html#getEditType()

          stussy Simon Stassen added a comment - - edited I see this is more complex than what I originally thought - the action attribute is not made available in hudson.scm.ChangeLogSet http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.Entry.html Could we use getAffectedFiles instead of getAffectedPaths, and optionally use getEditType? http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.AffectedFile.html#getEditType( )
          slide_o_mix Alex Earl added a comment -

          According to the comment on getAffectedFiles, it's possible that an SCM might not implement getAffectedFiles

          "Noted: since this is a new interface, some of the SCMs may not have implemented this interface. The default implementation for this interface is throw UnsupportedOperationException"

          Would probably need a fallback to getAffectedPaths in the case of an UnsupportedOperationException.

          slide_o_mix Alex Earl added a comment - According to the comment on getAffectedFiles, it's possible that an SCM might not implement getAffectedFiles "Noted: since this is a new interface, some of the SCMs may not have implemented this interface. The default implementation for this interface is throw UnsupportedOperationException" Would probably need a fallback to getAffectedPaths in the case of an UnsupportedOperationException.

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContent.java
          src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContentTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/6d57206bb4b541a6504d77b08ad7fcabcfe59790
          Log:
          Fix JENKINS-20692

          Added %a and %d to the pathFormat formatting options.

          • %a will display the getName of the EditType
          • %d will display the getDescription of the EditType

          If getAffectedFiles is not implemented by the SCM, then "Unknown" will be put displayed for each %a anf %d

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContent.java src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContentTest.java http://jenkins-ci.org/commit/email-ext-plugin/6d57206bb4b541a6504d77b08ad7fcabcfe59790 Log: Fix JENKINS-20692 Added %a and %d to the pathFormat formatting options. %a will display the getName of the EditType %d will display the getDescription of the EditType If getAffectedFiles is not implemented by the SCM, then "Unknown" will be put displayed for each %a anf %d
          slide_o_mix Alex Earl added a comment -

          Added %a and %d for pathFormat option.

          slide_o_mix Alex Earl added a comment - Added %a and %d for pathFormat option.
          stussy Simon Stassen added a comment -

          Hi Alex, not sure about the process... I just wanted to check if this fix should be in the latest 2.37.2.2 build? And if not, could this be included in the next build?

          stussy Simon Stassen added a comment - Hi Alex, not sure about the process... I just wanted to check if this fix should be in the latest 2.37.2.2 build? And if not, could this be included in the next build?
          slide_o_mix Alex Earl added a comment -

          No, this fix won't be in until 2.38, which I am still doing some testing on and trying to get some more bug fixes into. 2.37.2.2 was a bug fix release for a specific purpose.

          slide_o_mix Alex Earl added a comment - No, this fix won't be in until 2.38, which I am still doing some testing on and trying to get some more bug fixes into. 2.37.2.2 was a bug fix release for a specific purpose.

          People

            slide_o_mix Alex Earl
            stussy Simon Stassen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: