Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

suggestion (status): Use separate Github status context for each function #36

Closed
s8sg opened this issue Apr 30, 2018 · 0 comments
Closed

Comments

@s8sg
Copy link
Contributor

s8sg commented Apr 30, 2018

stack.yml can have multiple functions. If any one of the function has status failure, the overall status should be failure

This is ensured by github:

github status allow to specify user defined context

Status: 
          "state": "success",
          "target_url": "status page",
          "description": "The function has deployed as: user-function_name",
          "context": "function_name"

In Github status if one context status is failure the whole status is failure

Additionally, a combined state is returned. The state is one of:

failure if any of the contexts report as error or failure
pending if there are no statuses or a context is pending
success if the latest status for all contexts is success

Please check here for more details

Possible Implementation:
We can get function specific status in the github status by specifying the context as function-name.

Once the yaml is parsed in git-tar the function status need to be shown as pending
and once buildshiprun as successfully deployed the function it need to be shown as success
if any error occurs the status should be failure

i.e. for a stack which include function-1 and function-2
the status will be updated as:

// For pending
Status: pending 
function-1: pending
function-2: pending

// For one pending
Status: pending 
function-1: success
function-2: pending

// For success
Status: success
function-1: success
function-2: success

// For failure
Status: failure
function-1: failure
function-2: success

Deal with error before the yaml is parsed:

Error might happen before the stack.yml is even parsed, for example stack.yml is not present. We need another separate context before even stack.yml is parsed
We can have a context named Stack Deploy.
Stack Deploy status can be shown as pending as soon as a push event is accepted in gh-push
Stack Deploy status can be success once the yaml is parsed
Stack Deploy is failure in case of any error in between

i.e. for a stack which include function-1 and function-2
the status will be updated as:

Stack Deploy (Pending)

screen shot 2018-05-02 at 6 03 37 pm

Stack Deploy (Failed)

screen shot 2018-05-03 at 2 38 38 pm

Stack Deploy Passed, Function (Pending)

screen shot 2018-05-02 at 5 40 45 pm

Stack Deploy Passed, Function (Failed

screen shot 2018-05-02 at 6 04 24 pm

)
Stack Deploy Passed, One Function (Pending) One (success)

screen shot 2018-05-03 at 11 28 34 am

Stack Deploy Passed, One Function (Pending) One (failed)

screen shot 2018-05-03 at 10 26 30 am

Stack Deploy Passed, Both Function passed

screen shot 2018-05-03 at 10 39 18 am

@s8sg s8sg changed the title suggestion: Use separate Github status context for each function suggestion (status): Use separate Github status context for each function May 2, 2018
@s8sg s8sg closed this as completed Aug 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant