Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between github API commit statuses "failure" and "error"?

What is the difference between github API commit statuses "failure" and "error"?

like image 647
noamoss Avatar asked Oct 10 '14 08:10

noamoss


People also ask

What is commit status in GitHub?

The Commit status API allows external services to mark commits with an error , failure , pending , or success state, which is then reflected in pull requests involving those commits.

Is GitHub actions down?

Current GitHub status is up.


2 Answers

The GitHub API Statuses do include marking commits with a success, failure, error, or pending state.

Typically, in a continuous integration context, a commit is:

  • marked as failed because the job failed to complete
  • marked as error because the job did complete, but exited with a non-zero status
  • marked as success because the job did complete, and exited with a zero status

(job as tasks run by job scheduler)


Since 2014, the integration of GitHub with CI did evolve.
In May 2018, you had "Introducing the Checks API, a better way to connect integrations and code".
It introduced the notion of checks

Rather than binary pass/fail build statuses, integrations can report rich statuses, annotate lines of code with detailed information, and kick off reruns.

You find failure in that new context (of checks)

https://developer.github.com/assets/images/check_runs.png

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.

This works with:

  • Travis-CI (which has since then deprecated the GitHub commit status API updates for GitHub Apps-managed repositories)
  • Circle-CI

In that new context (New Checks API public beta):

  • failure is associated with a check which runs, but exit with a non-zero status,
  • error is associate with a check which cannot even run

See 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.


From 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 agrees:

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.

like image 90
VonC Avatar answered Oct 04 '22 02:10

VonC


I asked this question from official GitHub and received next response:

Hi Alexander,

Thanks for contacting GitHub Support!t

  • A failed CI check is when the check has not passed the required conditions.
  • A CI check that is in error is when the check itself has an error that prevents it from running correctly.

Let me know if you need any further information.

like image 39
fobos Avatar answered Oct 04 '22 04:10

fobos