github API 提交状态“失败”和“错误”有什么区别?
最佳答案
GitHub API Statuses包括将提交标记为成功、失败、错误或挂起状态。
通常,在 continuous integration context 中,提交是:
(作业作为由 job scheduler 运行的任务)
自 2014 年以来,GitHub 与 CI 的集成确实在发展。
2018 年 5 月,您拥有“Introducing the Checks API, a better way to connect integrations and code”。
它引入了 的概念checks
Rather than binary pass/fail build statuses, integrations can report rich statuses, annotate lines of code with detailed information, and kick off reruns.
您在(检查的)新上下文中发现失败
When someone pushes code to a repository, GitHub creates a check suite for the last commit. GitHub Apps with the
checks:write
permission receive a check_suite webhook with the requested action. When your GitHub App receives the check_suite event, it can create new check runs for the latest commit.
这适用于:
在那个新环境中( New Checks API public beta ):
见 Questions :
How are check runs different than commit statuses?
Commit statuses allow for a simple pass or fail state.
Check runs allow for much more granular information: they can conclude as either success, failure, neutral, cancelled, timed_out, or action_required. Check runs are more flexible than commit statuses.
来自 the comments
Juraj Martinka :
In unit testing terminology:
- "failure" usually represents a failed test, that is the code under the test returned an answer but this is different from the expected one;
- "error" represents an unexpected error in the code like an exception being thrown.
This is also what I've seen to be used in CI such as Travis:
- "build failed" means that your change breaks some tests, has linter errors, etc.
- "build error" means unexpected build job error (early termination).
Bob Bell同意:
I use:
- "failure" to say "the test failed against the criteria", and
- "error" to be "the test was not able to be executed properly".
I consider "failure" and "success" to be opposite, the two results of a completed test, while "error" is the outlier, the result of an aborted test.
关于git - github API 提交状态 "failure"和 "error"之间的差异?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26294590/