[JIRA] (JENKINS-61590) RebuildCause should not inherit from UpstreamCause

3 views
Skip to first unread message

roman.donchenko@intel.com (JIRA)

unread,
Mar 19, 2020, 12:29:03 PM3/19/20
to jenkinsc...@googlegroups.com
Roman Donchenko updated an issue
 
Jenkins / Improvement JENKINS-61590
RebuildCause should not inherit from UpstreamCause
Change By: Roman Donchenko
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 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.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

roman.donchenko@intel.com (JIRA)

unread,
Mar 19, 2020, 12:29:05 PM3/19/20
to jenkinsc...@googlegroups.com
Roman Donchenko created an issue
Issue Type: Improvement Improvement
Assignee: ragesh_nair
Components: rebuild-plugin
Created: 2020-03-19 16:28
Priority: Minor Minor
Reporter: Roman Donchenko

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 Cause.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.

    Reply all
    Reply to author
    Forward
    0 new messages