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

RebuildCause should not inherit from UpstreamCause

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently, RebuildCause inherits from Cause.UpstreamCause. This causes several problems:

      • currentBuild.upstreamBuilds includes the build that the current build was rebuilt from, even though that's not actually an upstream build.
      • In downstream jobs of a rebuilt job, the RebuildCause gets transformed into a plain UpstreamCause due to UpstreamCause.trim, which makes it impossible to distinguish a child of a rebuild job from a grandchild of the original job.

      It would be nice if this was fixed in some way, either by making RebuildCause not inherit from UpstreamCause or maybe, if compatibility constraints make that impossible, by introducing a new rebuild cause class.

        Attachments

          Activity

          rdonchen_intel Roman Donchenko created issue -
          rdonchen_intel Roman Donchenko made changes -
          Field Original Value New Value
          Description Currently, [{{RebuildCause}}|https://github.com/jenkinsci/rebuild-plugin/blob/rebuild-1.31/src/main/java/com/sonyericsson/rebuild/RebuildCause.java] inherits from {{Cause.UpstreamCause}}. This causes several problems:

          * {{currentBuild.upstreamBuilds}} includes the build that the current build was rebuilt from, even though that's not actually an upstream build.
          * In downstream jobs of a rebuilt job, the {{RebuildCause}} gets transformed into a plain {{UpstreamCause}} due to [Cause.trim|https://github.com/jenkinsci/jenkins/blob/jenkins-2.226/core/src/main/java/hudson/model/Cause.java#L232], which makes it impossible to distinguish a child of a rebuild job from a grandchild of the original job.

          It would be nice if this was fixed in some way, either by making {{RebuildCause}} not inherit from {{UpstreamCause}} or maybe, if compatibility constraints make that impossible, by introducing a new rebuild cause class.
          Currently, [{{RebuildCause}}|https://github.com/jenkinsci/rebuild-plugin/blob/rebuild-1.31/src/main/java/com/sonyericsson/rebuild/RebuildCause.java] inherits from {{Cause.UpstreamCause}}. This causes several problems:

          * {{currentBuild.upstreamBuilds}} includes the build that the current build was rebuilt from, even though that's not actually an upstream build.
          * In downstream jobs of a rebuilt job, the {{RebuildCause}} gets transformed into a plain {{UpstreamCause}} due to [UpstreamCause.trim|https://github.com/jenkinsci/jenkins/blob/jenkins-2.226/core/src/main/java/hudson/model/Cause.java#L232], which makes it impossible to distinguish a child of a rebuild job from a grandchild of the original job.

          It would be nice if this was fixed in some way, either by making {{RebuildCause}} not inherit from {{UpstreamCause}} or maybe, if compatibility constraints make that impossible, by introducing a new rebuild cause class.

            People

            Assignee:
            ragesh_nair ragesh_nair
            Reporter:
            rdonchen_intel Roman Donchenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: