Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

github - Cloudposse CodeFresh -- pull-request pipeline spec -- terminate without setting status to "Failed"

I have a CodeFresh, GitHub pull-request pipeline.

There are 2 scenarios where a PR marks as "Failed", when ideally it would show as "Pending" or no status.

Scenario 1:

When a new event is triggered, it terminates the previous build (as expected)

Build was terminated by pipeline policy - new build triggered by pull-request on branch <my-branch>

This is all great, but the build then shows as "Failed" on GitHub. Theoretically, the new build would undo the "failed" status, but this can take quite some time, and it is difficult to follow what the latest running build is. My terminationPolicy spec looks like this:

terminationPolicy:
  - type: branch
    event: onCreate

Termination Policy Docs: https://codefresh.io/docs/docs/integrations/codefresh-api/?#full-pipeline-specification

Scenario 2:

We want to bypass the build based on labels applied. Ex: "skip-test", or be able to run tests without the limitations of the branchRegex.

steps:
  harakiri:
    ...
    commands:
      - codefresh terminate ${{CF_BUILD_ID}}
    when:
      condition:
        any:
          isWorkInProgress: "match('${{CF_PULL_REQUEST_LABELS}}', 'WIP', false) == true"

Again, works great. But marks the PR as "failed".


If there were a way to inject a command into either of these, I could work with that. But how we have it laid out, it requires entire step to change the status to "Pending". (so I can't simply add an extra "command" to the harakiri step)

Any thoughts?

question from:https://stackoverflow.com/questions/65941051/cloudposse-codefresh-pull-request-pipeline-spec-terminate-without-setting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...