jenkinsci / jenkinsci/run-condition-plugin
[JENKINS-73016] BuildCause doesn't work when actual cause is an instance of a child class
- Dominant language
- Java
- Stars
- 11
- Forks
- 29
- Avg merge
- 9h 15m
- Merged PRs (30d)
- 3
Description
I am using Gerrit Trigger plugin, which has GerritCause class which extends SCMTriggerCause. BUILD_CAUSE variable says "SCMTRIGGER" but the condition is not fulfilled.
I've checked the source code and the change is easy to fix. In CauseCondition class replace String causeClassName to Class causeClass and than change isCausedBy() method to something like this:
boolean isCausedBy(Cause cause) {
return this.causeClass.isInstance(cause);
}
It allows more plugins to be integrated with Run Conditon plugin without code interference.
---
Originally reported by kayjayb33, imported from: BuildCause doesn't work when actual cause is an instance of a child class
Raw content of original issue
I am using Gerrit Trigger plugin, which has GerritCause class which extends SCMTriggerCause. BUILD_CAUSE variable says "SCMTRIGGER" but the condition is not fulfilled.
I've checked the source code and the change is easy to fix. In CauseCondition class replace String causeClassName to Class<? extends Cause> causeClass and than change isCausedBy() method to something like this:
boolean isCausedBy(Cause cause) {
return this.causeClass.isInstance(cause);
}It allows more plugins to be integrated with Run Conditon plugin without code interference.
Contributor guide
Assessment
This issue has not been assessed yet.