Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Codeship] fix status checking regexp & add new statuses #1662

Merged
merged 2 commits into from
Apr 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4934,7 +4934,7 @@ cache(function(data, match, sendBadge, request) {
}
try {
var statusMatch = res.headers['content-disposition']
.match(/filename="status_(.+)\.png"/);
.match(/filename="status_(.+)\./);
if (!statusMatch) {
badgeData.text[1] = 'unknown';
sendBadge(format, badgeData);
Expand All @@ -4954,13 +4954,17 @@ cache(function(data, match, sendBadge, request) {
break;
case 'testing':
case 'waiting':
case 'initiated':
badgeData.text[1] = 'pending';
break;
case 'error':
case 'infrastructure_failure':
Copy link
Member

@RedSparr0w RedSparr0w Apr 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should set this as error or failing, what do you think is the best text to describe this?

Codeship returns error for this status maybe we should follow suit?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel the need to add a new status, if there is an error with the build itself, that's a failing build all the same imo.

badgeData.text[1] = 'failing';
badgeData.colorscheme = 'red';
break;
case 'stopped':
case 'ignored':
case 'blocked':
badgeData.text[1] = 'not built';
break;
}
Expand Down