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: final stage #3138

Closed
4 of 5 tasks
zanyzhao opened this issue Dec 7, 2020 · 6 comments · Fixed by #4120 or #4125
Closed
4 of 5 tasks

feat: final stage #3138

zanyzhao opened this issue Dec 7, 2020 · 6 comments · Fixed by #4120 or #4125
Assignees
Labels
area/ci/backend CI 后端issue area/ci/frontend CI 前端特性issue done Production environment in tencent has been deploy for gray UAT environment in tencent has been deploy for test Test environment in tencent has been deploy grayed uat环境测试通过/test passed for uat stage kind/feat/product 产品特性 priority/backlog Higher priority than priority/awaiting-more-evidence. tested 测试环境通过/test patest passed for test stage
Milestone

Comments

@zanyzhao
Copy link
Member

zanyzhao commented Dec 7, 2020

As a developer
I wish The pipeline can run some tasks that I want to execute automatically at the end of the run (whether successful or failed)
To: clean up the pipeline process products

与普通Stage的差异

  • 一条流水线只有一个 Finally Stage

    • Finally Stage 之前可以添加 stage, 之后不可以添加 stage
    • Finally Stage可以配置多个 job
    • finally stage 属于必定会执行的阶段,所以和普通 stage 不同的是,不再需要执行条件以及fast-kill
  • Finally Stage 下可以获取到失败的 jobs / tasks 的信息,提供一个内置上下文 feat: 支持流水线上下文 #3997 ,包含如下信息:

    • 失败步骤的名称、id、插件标识、错误码、错误信息、输出参数,所属 job id、名称
    • 失败的 job id、名称、使用的镜像、启动失败的原因等
    • 取消执行时的job、以及未完成的task信息
  • Finally Stage 的 job 运行条件有以下四种(不支持自定义):

    • 当前 Stage 开始时 JobRunCondition.STAGE_RUNNING
    • 上游 Stage 成功时 JobRunCondition.PREVIOUS_STAGE_SUCCESS
    • 上游 Stage 失败时 JobRunCondition.PREVIOUS_STAGE_FAILED
    • 上游 Stage 取消时 JobRunCondition.PREVIOUS_STAGE_CANCEL
  • 无Stage审核

  • 对失败Stage下的重试所有失败Job功能做了适配FinallyStage

image

  • 当失败Job重试不属于FinallyStage, 则对于FinallyStage下的Job,所有Job(成功的)被重置成排队待执行状态
  • 当失败Job重试属于FinallyStage, 则只重置上一次执行失败的Job为排队待执行状态

Stage状态

上游Stage成功的两种情况:

  • 上游Stage处于跳过等同于成功 BuildStatus.isSuccess()
  • 上游Stage处于StageSucess(Stage审核取消执行)等同于成功 BuildStatus.STAGE_SUCCESS

流水线状态:

  • 如果上游Stage失败,不管 finally 成功还是失败,流水线最终状态为失败
  • 如果上游Stage成功,当finally失败时,整个流水线失败

交互补充

  • hover至+号时显示下拉框
  • 下拉框样式参考这里
@zanyzhao zanyzhao added kind/feat/product 产品特性 area/ci/frontend CI 前端特性issue area/ci/backend CI 后端issue priority/backlog Higher priority than priority/awaiting-more-evidence. labels Dec 7, 2020
@zanyzhao zanyzhao self-assigned this Dec 7, 2020
@iccengan iccengan added this to the v1.3 milestone Dec 8, 2020
@rhinel
Copy link

rhinel commented Jan 18, 2021

when?

@zanyzhao zanyzhao modified the milestones: v1.3, 2021.4 (version 1.15) Mar 8, 2021
@mario206
Copy link

when?

1 similar comment
@GarrickY
Copy link

when?

@zanyzhao
Copy link
Member Author

已加入4月份迭代,各位大佬稍等

@yun-percy
Copy link

@zanyzhao
4月快过去了,搞完了没?

@bkci-bot bkci-bot added the for test Test environment in tencent has been deploy label May 6, 2021
@irwinsun irwinsun removed the for test Test environment in tencent has been deploy label May 7, 2021
@bkci-bot bkci-bot added the for test Test environment in tencent has been deploy label May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
@irwinsun irwinsun added the tested 测试环境通过/test patest passed for test stage label May 7, 2021
This was linked to pull requests May 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue May 7, 2021
irwinsun added a commit that referenced this issue May 7, 2021
lockiechen added a commit that referenced this issue May 8, 2021
feature: finally stage issue #3138
@irwinsun irwinsun reopened this May 8, 2021
@bkci-bot bkci-bot added the for gray UAT environment in tencent has been deploy label May 10, 2021
irwinsun added a commit that referenced this issue May 11, 2021
@fayewong-v5 fayewong-v5 added the grayed uat环境测试通过/test passed for uat stage label May 13, 2021
@bkci-bot bkci-bot added the done Production environment in tencent has been deploy label May 13, 2021
irwinsun added a commit that referenced this issue May 13, 2021
@rhinel
Copy link

rhinel commented May 24, 2021

上线了!还愿!

@zanyzhao zanyzhao changed the title feat: finally stage feat: final stage Jul 5, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue Jul 7, 2021
lockiechen added a commit that referenced this issue Jul 7, 2021
terlinhe added a commit to terlinhe/bk-ci that referenced this issue Jul 7, 2021
lockiechen added a commit that referenced this issue Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci/backend CI 后端issue area/ci/frontend CI 前端特性issue done Production environment in tencent has been deploy for gray UAT environment in tencent has been deploy for test Test environment in tencent has been deploy grayed uat环境测试通过/test passed for uat stage kind/feat/product 产品特性 priority/backlog Higher priority than priority/awaiting-more-evidence. tested 测试环境通过/test patest passed for test stage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants