jenkinsci / jenkinsci/workflow-cps-plugin

[JENKINS-70018] @CompileStatic does not work well in Pipelines

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

Description

Various users have reported issues with {@​CompileStatic}} in Pipelines. See https://github.com/cloudbees/groovy-cps/issues/87 and https://github.com/cloudbees/groovy-cps/issues/88.

Specifically:



  • @​NonCPS and @​CompileStatic cannot be used together (perhaps related to the sandbox transformation?)

  • @​CompileStatic cannot be used on a class, only on individual methods.

---
Originally reported by dnusbaum, imported from: @CompileStatic does not work well in Pipelines


  • status: Open
  • priority: Minor
  • component(s): workflow-cps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

Various users have reported issues with {@CompileStatic}} in Pipelines. See https://github.com/cloudbees/groovy-cps/issues/87 and https://github.com/cloudbees/groovy-cps/issues/88.

Specifically:



  • @NonCPS and @CompileStatic cannot be used together (perhaps related to the sandbox transformation?)

  • @CompileStatic cannot be used on a class, only on individual methods.


Contributor guide

Open the contributing guide

Research direction

Start by reading the linked groovy-cps issues 87 and 88, then inspect the workflow-cps-plugin behavior around @NonCPS and @CompileStatic. Reproduce both reported cases; done means the annotations work together and @CompileStatic works on classes as well as individual methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.