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

feat:流水线变量语法支持两种风格 #10576

Closed
fayewong-v5 opened this issue Jun 27, 2024 · 2 comments
Closed

feat:流水线变量语法支持两种风格 #10576

fayewong-v5 opened this issue Jun 27, 2024 · 2 comments
Assignees
Labels
done Production environment in tencent has been deploy kind/enhancement 功能改进特性 service/process 流水线 todo todo

Comments

@fayewong-v5
Copy link
Contributor

fayewong-v5 commented Jun 27, 2024

【背景】
蓝盾早期的变量使用比较自由,但在一些场景下业务希望有严格的检查控制。
考虑到存量流水线太多,开启严格检查需要修改的内容太多,一刀切不适合,增加配置由业务选择。

【需求】

  1. 支持项目级别的“语法风格”配置,可选值有 宽松/制约

    • 蓝盾和stream存量项目默认都为 “宽松”
    • 新建项目时,新建页面默认选中“传统”,业务可根据需要切换
    • 编辑项目时,支持修改此项配置,修改时提示影响范围,以便用户修改流水线满足新风格后再切换
      image
      image
  2. 支持流水线级别的 “语法风格”配置,默认继承项目配置,可修改为和项目配置不同的方式,修改后在当前流水线生效

    • 新增流水线时,提供入口让用户配置
      image
      • 默认勾选“继承项目设置”,并展示出项目配置供用户参考
      • 用户可以去掉勾选,设置为当前流水线指定的风格
    • 编辑流水线时,可以修改配置
      image
  3. 两种风格的区别:

    • 制约模式仅支持通过双花括号引用流水线过程变量,避免出现 bash 脚本变量在执行前被系统赋值的问题
    • 表达式函数 如contains、join、fromJSON等,传统模式仅支持在流程控制选项 自定义表达式满足时运行 设置中可以使用;制约模式流程控制选项、插件入参、Job设置等流水线配置中均可使用函数
    • 制约模式下,流水线变量值超长时,将报错,运行失败(传统风格仅警告,未报错)
    • 制约模式下,流水线变量 ID 规范化,不支持中文 ID,减少不同构建环境下的兼容问题
image
  1. code 模式下关键字配置为:
    syntax-dialect: CONSTRAINT/CLASSIC/INHERIT
    
  • CONSTRAINT: 制约模式
  • CLASSIC:宽松模式
  • INHERIT:继承项目配置
@fayewong-v5 fayewong-v5 added the kind/enhancement 功能改进特性 label Jun 27, 2024
@fayewong-v5 fayewong-v5 changed the title feat:流水线转 YAML 时,对表达式引用方式做检测,不满足要求时给出提示 feat:流水线YAML需对表达式引用方式做检测,不满足要求时给出提示 Jun 27, 2024
@fayewong-v5 fayewong-v5 changed the title feat:流水线YAML需对表达式引用方式做检测,不满足要求时给出提示 feat:流水线开启 PAC 时,需对表达式/变量引用方式做检测,不满足要求时给出引导协助用户修改 Jul 25, 2024
@fayewong-v5 fayewong-v5 changed the title feat:流水线开启 PAC 时,需对表达式/变量引用方式做检测,不满足要求时给出引导协助用户修改 feat:PAC 流水线对表达式/变量引用方式做检测,不满足要求时给出引导协助用户修改 Jul 25, 2024
@fayewong-v5 fayewong-v5 changed the title feat:PAC 流水线对表达式/变量引用方式做检测,不满足要求时给出引导协助用户修改 feat:流水线变量语法支持两种风格 Aug 2, 2024
@fayewong-v5
Copy link
Contributor Author

#10665 其中第三点,在制约模式下报错

@bkci-bot bkci-bot added the todo todo label Aug 9, 2024
useryuyu added a commit to useryuyu/bk-ci that referenced this issue Aug 15, 2024
useryuyu added a commit to useryuyu/bk-ci that referenced this issue Aug 20, 2024
useryuyu added a commit to useryuyu/bk-ci that referenced this issue Aug 23, 2024
useryuyu added a commit to useryuyu/bk-ci that referenced this issue Aug 23, 2024
useryuyu added a commit to useryuyu/bk-ci that referenced this issue Aug 26, 2024
useryuyu added a commit to useryuyu/bk-ci that referenced this issue Aug 27, 2024
mingshewhe added a commit to mingshewhe/bk-ci that referenced this issue Nov 14, 2024
回退变量超长报错,因为插件可能输出超长变量,导致流水线报错,但是用户配置的流水线又不能修改
@bkci-bot bkci-bot added the todo todo label Nov 15, 2024
mingshewhe added a commit to mingshewhe/bk-ci that referenced this issue Nov 15, 2024
回退变量超长报错,因为插件可能输出超长变量,导致流水线报错,但是用户配置的流水线又不能修改
@bkci-bot bkci-bot added done Production environment in tencent has been deploy and removed for gray UAT environment in tencent has been deploy labels Nov 15, 2024
@bkci-bot bkci-bot added for test Test environment in tencent has been deploy and removed todo todo labels Nov 15, 2024
@mingshewhe mingshewhe added the tested 测试环境通过/test patest passed for test stage label Nov 15, 2024
bkci-bot added a commit that referenced this issue Nov 15, 2024
feat:流水线变量语法支持两种风格 #10576 回退变量超长报错
@bkci-bot bkci-bot added todo todo for gray UAT environment in tencent has been deploy for test Test environment in tencent has been deploy and removed for test Test environment in tencent has been deploy tested 测试环境通过/test patest passed for test stage todo todo labels Nov 15, 2024
@mingshewhe mingshewhe added the service/process 流水线 label Nov 21, 2024
@bkci-bot bkci-bot added the todo todo label Nov 21, 2024
@bkci-bot bkci-bot removed for test Test environment in tencent has been deploy for gray UAT environment in tencent has been deploy labels Nov 21, 2024
mingshewhe added a commit that referenced this issue Nov 21, 2024
feat:流水线变量语法支持两种风格 #10576
@bkci-bot bkci-bot added for test Test environment in tencent has been deploy todo todo for gray UAT environment in tencent has been deploy and removed todo todo for test Test environment in tencent has been deploy labels Nov 22, 2024
@bkci-bot bkci-bot removed the for gray UAT environment in tencent has been deploy label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Production environment in tencent has been deploy kind/enhancement 功能改进特性 service/process 流水线 todo todo
Projects
None yet
Development

No branches or pull requests

6 participants