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

actions from TransientActionFactories are saved in Builds.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Actions created from a TransientActionFactory are persisted in a Run when they should never be persisted.

       

      If you have a TAF that creates an action for any ModelItem then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

       

      One is created for the hudson.model.Queue$WaitingItem one for the hudson.model.Queue$BuildableItem and the last one for the actual build (which is the one that is not persisted).

       

      build.xml
      <?xml version='1.1' encoding='UTF-8'?>
      <build>
          <actions>
              <hudson.model.CauseAction>
                  <causeBag class="linked-hash-map">
                      <entry>
                          <hudson.model.Cause_-UserIdCause>
                              <userId>james</userId>
                          </hudson.model.Cause_-UserIdCause>
                          <int>1</int>
                      </entry>
                  </causeBag>
              </hudson.model.CauseAction>
              <com.myco.myplugin.MyAction>
                  <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
              </com.myco.myplugin.MyAction>
              <com.myco.myplugin.MyAction>
                  <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
              </com.myco.myplugin.MyAction>
              <jenkins.metrics.impl.TimeInQueueAction>
                  <queuingDurationMillis>9</queuingDurationMillis>
              </jenkins.metrics.impl.TimeInQueueAction>
          </actions>
          <queueId>5</queueId>
          <timestamp>1527599156095</timestamp>
          <startTime>1527599156104</startTime>
          <result>SUCCESS</result>
          <duration>3225</duration>
          <charset>windows-1252</charset>
          <keepLog>false</keepLog>
          <builtOn></builtOn>
          <workspace>C:\workarea\yplugin\work\workspace\free</workspace>
          <hudsonVersion>2.107.3</hudsonVersion>
          <scm class="hudson.scm.NullChangeLogParser"/>
          <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
      </build>
      

       

        Attachments

          Issue Links

            Activity

            teilo James Nord created issue -
            teilo James Nord made changes -
            Field Original Value New Value
            Description {{Actions}} created from a {{TransientActionFactory}} are persisted in a {{Run}} when they should never be persisted.

             

            If you have a {{TAF}} that creates an action for any {{ModelItem}} then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

             

            One is created for the {{hudson.model.Queue$WaitingItem}} one for the {{hudson.model.Queue$BuildableItem}} and the last one for the actual build (which is the one that is not persisted).

             
            {code:java}
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
            <actions>
            <hudson.model.CauseAction>
            <causeBag class="linked-hash-map">
            <entry>
            <hudson.model.Cause_-UserIdCause>
            <userId>james</userId>
            </hudson.model.Cause_-UserIdCause>
            <int>1</int>
            </entry>
            </causeBag>
            </hudson.model.CauseAction>
            <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
            <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
            </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
            <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
            <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
            </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
            <jenkins.metrics.impl.TimeInQueueAction plugin="metrics@3.1.2.12">
            <queuingDurationMillis>9</queuingDurationMillis>
            </jenkins.metrics.impl.TimeInQueueAction>
            </actions>
            <queueId>5</queueId>
            <timestamp>1527599156095</timestamp>
            <startTime>1527599156104</startTime>
            <result>SUCCESS</result>
            <duration>3225</duration>
            <charset>windows-1252</charset>
            <keepLog>false</keepLog>
            <builtOn></builtOn>
            <workspace>C:\workarea\source\github\cloudbees\bluesteel\bluesteel-cjoc\work\workspace\free</workspace>
            <hudsonVersion>2.107.3-cb-1</hudsonVersion>
            <scm class="hudson.scm.NullChangeLogParser"/>
            <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            {code}
             
            {{Actions}} created from a {{TransientActionFactory}} are persisted in a {{Run}} when they should never be persisted.

             

            If you have a {{TAF}} that creates an action for any {{ModelItem}} then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

             

            One is created for the {{hudson.model.Queue$WaitingItem}} one for the {{hudson.model.Queue$BuildableItem}} and the last one for the actual build (which is the one that is not persisted).

             
            {code:title=build.xml|xml}
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
            <actions>
            <hudson.model.CauseAction>
            <causeBag class="linked-hash-map">
            <entry>
            <hudson.model.Cause_-UserIdCause>
            <userId>james</userId>
            </hudson.model.Cause_-UserIdCause>
            <int>1</int>
            </entry>
            </causeBag>
            </hudson.model.CauseAction>
            <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
            <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
            </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
            <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
            <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
            </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
            <jenkins.metrics.impl.TimeInQueueAction plugin="metrics@3.1.2.12">
            <queuingDurationMillis>9</queuingDurationMillis>
            </jenkins.metrics.impl.TimeInQueueAction>
            </actions>
            <queueId>5</queueId>
            <timestamp>1527599156095</timestamp>
            <startTime>1527599156104</startTime>
            <result>SUCCESS</result>
            <duration>3225</duration>
            <charset>windows-1252</charset>
            <keepLog>false</keepLog>
            <builtOn></builtOn>
            <workspace>C:\workarea\source\github\cloudbees\bluesteel\bluesteel-cjoc\work\workspace\free</workspace>
            <hudsonVersion>2.107.3-cb-1</hudsonVersion>
            <scm class="hudson.scm.NullChangeLogParser"/>
            <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            {code}
             
            teilo James Nord made changes -
            Description {{Actions}} created from a {{TransientActionFactory}} are persisted in a {{Run}} when they should never be persisted.

             

            If you have a {{TAF}} that creates an action for any {{ModelItem}} then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

             

            One is created for the {{hudson.model.Queue$WaitingItem}} one for the {{hudson.model.Queue$BuildableItem}} and the last one for the actual build (which is the one that is not persisted).

             
            {code:title=build.xml|xml}
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
            <actions>
            <hudson.model.CauseAction>
            <causeBag class="linked-hash-map">
            <entry>
            <hudson.model.Cause_-UserIdCause>
            <userId>james</userId>
            </hudson.model.Cause_-UserIdCause>
            <int>1</int>
            </entry>
            </causeBag>
            </hudson.model.CauseAction>
            <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
            <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
            </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
            <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
            <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
            </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
            <jenkins.metrics.impl.TimeInQueueAction plugin="metrics@3.1.2.12">
            <queuingDurationMillis>9</queuingDurationMillis>
            </jenkins.metrics.impl.TimeInQueueAction>
            </actions>
            <queueId>5</queueId>
            <timestamp>1527599156095</timestamp>
            <startTime>1527599156104</startTime>
            <result>SUCCESS</result>
            <duration>3225</duration>
            <charset>windows-1252</charset>
            <keepLog>false</keepLog>
            <builtOn></builtOn>
            <workspace>C:\workarea\source\github\cloudbees\bluesteel\bluesteel-cjoc\work\workspace\free</workspace>
            <hudsonVersion>2.107.3-cb-1</hudsonVersion>
            <scm class="hudson.scm.NullChangeLogParser"/>
            <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            {code}
             
            {{Actions}} created from a {{TransientActionFactory}} are persisted in a {{Run}} when they should never be persisted.

             

            If you have a {{TAF}} that creates an action for any {{ModelItem}} then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

             

            One is created for the {{hudson.model.Queue$WaitingItem}} one for the {{hudson.model.Queue$BuildableItem}} and the last one for the actual build (which is the one that is not persisted).

             
            {code:title=build.xml|xml}
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
                <actions>
                    <hudson.model.CauseAction>
                        <causeBag class="linked-hash-map">
                            <entry>
                                <hudson.model.Cause_-UserIdCause>
                                    <userId>james</userId>
                                </hudson.model.Cause_-UserIdCause>
                                <int>1</int>
                            </entry>
                        </causeBag>
                    </hudson.model.CauseAction>
                    <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
                        <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
                    </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
                    <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
                        <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
                    </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
                    <jenkins.metrics.impl.TimeInQueueAction plugin="metrics@3.1.2.12">
                        <queuingDurationMillis>9</queuingDurationMillis>
                    </jenkins.metrics.impl.TimeInQueueAction>
                </actions>
                <queueId>5</queueId>
                <timestamp>1527599156095</timestamp>
                <startTime>1527599156104</startTime>
                <result>SUCCESS</result>
                <duration>3225</duration>
                <charset>windows-1252</charset>
                <keepLog>false</keepLog>
                <builtOn></builtOn>
                <workspace>C:\workarea\source\github\cloudbees\bluesteel\bluesteel-cjoc\work\workspace\free</workspace>
                <hudsonVersion>2.107.3-cb-1</hudsonVersion>
                <scm class="hudson.scm.NullChangeLogParser"/>
                <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            {code}
             
            teilo James Nord made changes -
            Description {{Actions}} created from a {{TransientActionFactory}} are persisted in a {{Run}} when they should never be persisted.

             

            If you have a {{TAF}} that creates an action for any {{ModelItem}} then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

             

            One is created for the {{hudson.model.Queue$WaitingItem}} one for the {{hudson.model.Queue$BuildableItem}} and the last one for the actual build (which is the one that is not persisted).

             
            {code:title=build.xml|xml}
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
                <actions>
                    <hudson.model.CauseAction>
                        <causeBag class="linked-hash-map">
                            <entry>
                                <hudson.model.Cause_-UserIdCause>
                                    <userId>james</userId>
                                </hudson.model.Cause_-UserIdCause>
                                <int>1</int>
                            </entry>
                        </causeBag>
                    </hudson.model.CauseAction>
                    <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
                        <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
                    </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
                    <com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction plugin="bluesteel-cjoc@1.2.7-SNAPSHOT">
                        <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
                    </com.cloudbees.opscenter.server.bluesteel.action.BlueSteelUrlAction>
                    <jenkins.metrics.impl.TimeInQueueAction plugin="metrics@3.1.2.12">
                        <queuingDurationMillis>9</queuingDurationMillis>
                    </jenkins.metrics.impl.TimeInQueueAction>
                </actions>
                <queueId>5</queueId>
                <timestamp>1527599156095</timestamp>
                <startTime>1527599156104</startTime>
                <result>SUCCESS</result>
                <duration>3225</duration>
                <charset>windows-1252</charset>
                <keepLog>false</keepLog>
                <builtOn></builtOn>
                <workspace>C:\workarea\source\github\cloudbees\bluesteel\bluesteel-cjoc\work\workspace\free</workspace>
                <hudsonVersion>2.107.3-cb-1</hudsonVersion>
                <scm class="hudson.scm.NullChangeLogParser"/>
                <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            {code}
             
            {{Actions}} created from a {{TransientActionFactory}} are persisted in a {{Run}} when they should never be persisted.

             

            If you have a {{TAF}} that creates an action for any {{ModelItem}} then on {{FreeStyleBuild}}s you will end up with 3 duplicate Actions displayed (and 2 will be persisted in the build.xml)

             

            One is created for the {{hudson.model.Queue$WaitingItem}} one for the {{hudson.model.Queue$BuildableItem}} and the last one for the actual build (which is the one that is not persisted).

             
            {code:title=build.xml|xml}
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
                <actions>
                    <hudson.model.CauseAction>
                        <causeBag class="linked-hash-map">
                            <entry>
                                <hudson.model.Cause_-UserIdCause>
                                    <userId>james</userId>
                                </hudson.model.Cause_-UserIdCause>
                                <int>1</int>
                            </entry>
                        </causeBag>
                    </hudson.model.CauseAction>
                    <com.myco.myplugin.MyAction>
                        <target>hudson.model.Queue$WaitingItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
                    </com.myco.myplugin.MyAction>
                    <com.myco.myplugin.MyAction>
                        <target>hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@11e31cdf[free]:5</target>
                    </com.myco.myplugin.MyAction>
                    <jenkins.metrics.impl.TimeInQueueAction>
                        <queuingDurationMillis>9</queuingDurationMillis>
                    </jenkins.metrics.impl.TimeInQueueAction>
                </actions>
                <queueId>5</queueId>
                <timestamp>1527599156095</timestamp>
                <startTime>1527599156104</startTime>
                <result>SUCCESS</result>
                <duration>3225</duration>
                <charset>windows-1252</charset>
                <keepLog>false</keepLog>
                <builtOn></builtOn>
                <workspace>C:\workarea\yplugin\work\workspace\free</workspace>
                <hudsonVersion>2.107.3</hudsonVersion>
                <scm class="hudson.scm.NullChangeLogParser"/>
                <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            {code}
             
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CJP-8826 (Web Link)" [ 20759 ]
            teilo James Nord made changes -
            Remote Link This issue links to "PR#3462 (Web Link)" [ 20766 ]
            teilo James Nord made changes -
            Link This issue relates to JENKINS-44624 [ JENKINS-44624 ]
            teilo James Nord made changes -
            Link This issue relates to JENKINS-44964 [ JENKINS-44964 ]
            teilo James Nord made changes -
            Link This issue relates to JENKINS-45476 [ JENKINS-45476 ]
            teilo James Nord made changes -
            Assignee James Nord [ teilo ]
            teilo James Nord made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            teilo James Nord made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            teilo James Nord made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            teilo James Nord made changes -
            Link This issue relates to JENKINS-51627 [ JENKINS-51627 ]
            teilo James Nord made changes -
            Labels lts-candidate
            olivergondza Oliver Gondža made changes -
            Labels lts-candidate 2.121.2-fixed

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: