badges / badges/shields

[Bitbucket Pipelines] “invalid response data” if manual steps not taken

Open
#6,701 1 comment 1 reaction 0 assignees View on GitHub
question service-badge
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

### Are you experiencing an issue with...

shields.io

### 🐞 Description

When the default pipeline has manual steps, the shields.io badge breaks unless those manual steps have been attempted. This renders the badge unusable for repos that use manual steps for optional but rare tasks like releases. For example:

* ![“invalid response data”](https://img.shields.io/bitbucket/pipelines/delan/nonymous/default)
* badge:
* API call:
* config:
* ![“passing”](https://img.shields.io/bitbucket/pipelines/delan/iyypdgarimwgp/default)
* badge:
* API call:
* config:

Looking at [the code](https://github.com/badges/shields/blob/afbc487faa79b2072cd3e74c11556f1fbdce9535/services/bitbucket/bitbucket-pipelines.service.js), my best guess is that the joi schema check fails, because PAUSED is not an acceptable .values[]­.state­.result.

### 🔗 Link to the badge

https://img.shields.io/bitbucket/pipelines/delan/nonymous/default

### 💡 Possible Solution

Updating the schema won’t be enough, because we later filter for builds with .values[]­.state of COMPLETED, which would exclude these builds because they are considered IN_PROGRESS.

Ideally we would treat the manual steps as optional, taking them into account iff they have been attempted, but otherwise generating the badge based on the non-manual steps. I’m not really sure how to do this though, and I found [the provider’s API docs](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/) unhelpful (but tbf I also have zero experience with it).

Contributor guide

Open the contributing guide

Research direction

Start in services/bitbucket/bitbucket-pipelines.service.js and inspect the linked Bitbucket API response for pipelines with unattempted manual steps. Compare the two example repositories and determine how PAUSED and IN_PROGRESS states are handled. Done means the affected badge renders valid status data before manual steps are attempted while retaining correct behavior afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.