jenkinsci / jenkinsci/workflow-cps-plugin

[JENKINS-45901] Allow common groovy annotation in Pipeline Shared Library Classes

Open
#1,341 19 comments 0 reactions 0 assignees View on GitHub
component:workflow-cps-global-lib-plugin component:workflow-cps-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
186
Forks
213
Avg merge
12h 12m
Merged PRs (30d)
8

Description

Currently the following code fails with a cryptic error message:

 

package org.test.;

import groovy.transform.ToString
@​ToString(includeNames=true)
class X implements Serializable {
def script
def A, B
Promotemodul(script, m) {
this.script = script
this.A = m.A
this.B = m.B
}
}

It would be great if some common annotations (ToString, EqualsAndHashCode...) would be supported in Pipeline Shared Libraries. 

 

 

---
Originally reported by pmr, imported from: Allow common groovy annotation in Pipeline Shared Library Classes


  • status: Open
  • priority: Major
  • component(s): workflow-cps-global-lib-plugin, workflow-cps-plugin
  • resolution: Unresolved
  • votes: 15
  • watchers: 20
  • imported: 2025-12-07

Raw content of original issue

Currently the following code fails with a cryptic error message:

 



package org.test.;

import groovy.transform.ToString
@ToString(includeNames=true)
class X implements Serializable {
def script
def A, B
Promotemodul(script, m) {
this.script = script
this.A = m.A
this.B = m.B
}
}


It would be great if some common annotations (ToString, EqualsAndHashCode...) would be supported in Pipeline Shared Libraries. 

 

 

Contributor guide

Open the contributing guide

Research direction

Reproduce the example in a Pipeline Shared Library and capture the current cryptic error. Then inspect the workflow-cps-plugin and workflow-cps-global-lib-plugin areas involved in annotation handling; done means common annotations such as ToString and EqualsAndHashCode work in shared-library classes for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.