Bitbucket not completely finished workflow returns invalid response data
ArcherEmiya05 opened this issue Β· comments
Are you experiencing an issue with...
shields.io
π Description
We have a workflow that has success step but not complete due to manual trigger, the build status badge for Bitbucket returns invalid response data
π Link to the badge
π‘ Possible Solution
No response
Badge tested using npm run badge https://img.shields.io/bitbucket/pipelines/devsbitwise/cryptonian/master?label=π¦%20CI%2FCD%20pipeline
Output is available here
OK, so what's happening here is:
That returns
{
"values": [
{
"state": {
"name": "IN_PROGRESS",
"type": "pipeline_state_in_progress",
"stage": {
"name": "PAUSED",
"type": "pipeline_state_in_progress_paused"
}
}
},
{
"state": {
"name": "COMPLETED",
"type": "pipeline_state_completed",
"result": {
"name": "SUCCESSFUL",
"type": "pipeline_state_completed_successful"
}
}
}
]
}
We fail validation with
"values[0].state.result" is required
so I guess we would need to make the result
key optional in the schema and then adjust the code to handle the fact that property may or may not exist.
shields/services/bitbucket/bitbucket-pipelines.service.js
Lines 84 to 86 in 96525e5