kubesphere / kubesphere/ks-devops

How to support custom functions in kubesphere pipeline? custom function disappears after saving on Devops graphical interface

Open
#381 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature
Dominant language
Go
Stars
164
Forks
140
PR merge metrics
No merged PRs in 30d

Description

How to support custom functions in kubesphere pipeline?

I have a custom function in the pipeline outer layer of pipeline jenkinsfile like this:

def createBuildInfo() {
return [currentBuild.fullProjectName, currentBuild.fullDisplayName, currentBuild.currentResult, currentBuild.durationString, currentBuild.getBuildCauses()[0].shortDescription, currentBuild.number]
}
pipeline {
xxxxxxxxxxxx
}

Edit the pipeline in the kubesphere Devops graphical interface. After saving, this custom function disappears. Do you not support custom functions? Or is the definition in the wrong position? The definition will report an error in pipeline {}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the pipeline edit and save flow in the KubeSphere DevOps graphical interface using the shown outer-layer custom function. Trace how the editor reads and writes the Jenkinsfile, then verify that saving preserves the function or clearly reports that custom functions are unsupported.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.