Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The comments in the Jenkinsfile disappear when returning from graphical pipeline editing #933

Open
chilianyi opened this issue Mar 29, 2023 · 2 comments
Assignees
Labels
area/devops kind/bug Categorizes issue or PR as related to a bug.

Comments

@chilianyi
Copy link
Contributor

What is version of KubeSphere DevOps has the issue?

v3.3.1

How did you install the Kubernetes? Or what is the Kubernetes distribution?

kubekey

What happened?

The comments in the Jenkinsfile disappear when returning from graphical pipeline editing, which I believe is a bug that needs to be fixed.

After graphical editing, the content was overwritten directly, so it should be patched instead of overwritten.

Relevant log output

No response

Additional information

No response

@chilianyi chilianyi added the kind/bug Categorizes issue or PR as related to a bug. label Mar 29, 2023
@chilianyi
Copy link
Contributor Author

chilianyi commented May 16, 2023

截屏2023-05-16 14 43 47 截屏2023-05-16 14 44 47

@drzhangg
Copy link
Contributor

drzhangg commented Jun 7, 2023

该问题形成原因:

  1. 在流水线配置中编辑jenkinsfile时,pipeline cr那边是通过pipeline.spec.pipeline.jenkinsfile来保存数据,因为数据是直接通过string的格式保存的,所以可以保存注释的信息,在页面显示的时候,直接从spec里获取数据就行了;
    image

  2. 当通过流水线图形化形式进行修改时,这时候前端是从pipeline的annotation中获取jenkinsfile数据,
    image
    image
    image
    image
    在图形化显示中,对于每个步骤都会有相应的字段来进行保存,因为注释是没有在这里保存的,所以在通过流水线进行修改后,注释就会丢失。

大概的解决方案:
前端在通过流水线图形化形式进行修改时,针对注释的地方,专门添加一个字段来进行保存注释的值(但是如果注释放的地方很随意,比如放到一个stag的第一行或者最后一行,会比较难处理它的位置)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devops kind/bug Categorizes issue or PR as related to a bug.
Projects
No open projects
Status: No status
Development

No branches or pull requests

3 participants