Warn or avoid overriding CLI methods

14 views
Skip to first unread message

Manuel Ramón León Jiménez

unread,
Apr 14, 2020, 8:54:37 AM4/14/20
to jenkin...@googlegroups.com
Hello everyone.

I've been working on an issue recently. While trying to call the disable-job CLI method, we receive:

ERROR: object is not an instance of declaring class

The root cause is because a plugin has overridden the method: https://github.com/jenkinsci/multi-branch-project-plugin/blob/master/src/main/java/com/github/mjdetullio/jenkins/plugins/multibranch/TemplateDrivenMultiBranchProject.java#L480

So now, if you try to disable a Freestyle job, it fails because it's expecting a TemplateDrivenMultiBranchProject one.

I open this to have feedback about what is best to do here:

  • Avoid overriding CLI methods
  • Warn about that fact on Jenkins console
  • Warn about that fact on Jenkins CLI commands list page
  • Warn about that fact on the CLI command output directly (may break some automations)
  • Others

I filed a ticket, not sure what works better:

Thank you, best regards.
Reply all
Reply to author
Forward
0 new messages