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

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

merged 2 commits into from
Apr 26, 2018

Conversation

zosiu
Copy link
Contributor

@zosiu zosiu commented Apr 26, 2018

We don't need to match the file extension to determine the status.
This should fix #1654 .

we don't need to match the file extension to determine the status
@shields-ci
Copy link

shields-ci commented Apr 26, 2018

Warnings
⚠️

This PR modified the server but none of the service tests. That's okay so long as it's refactoring existing code.

Messages
📖

✨ Thanks for your contribution to Shields, @MikkaBouzu!

Generated by 🚫 dangerJS

@RedSparr0w
Copy link
Member

Also note that it seems the status codes in our code may be slightly outdated:

        case 'success':
          badgeData.text[1] = 'passing';
          badgeData.colorscheme = 'brightgreen';
          break;
        case 'projectnotfound':
          badgeData.text[1] = 'not found';
          break;
        case 'branchnotfound':
          badgeData.text[1] = 'branch not found';
          break;
        case 'testing':
        case 'waiting':
          badgeData.text[1] = 'pending';
          break;
        case 'error':
          badgeData.text[1] = 'failing';
          badgeData.colorscheme = 'red';
          break;
        case 'stopped':
          badgeData.text[1] = 'not built';
          break;

from the link provided by @dennisnewel

initiated: newly started build
error: failed builds
success: passed builds
stopped: stopped builds
waiting: waiting builds
ignored: builds ignored because the account is over the monthly build limit
blocked: builds blocked because of excessive resource consumption
infrastructure_failure: builds which failed because of an internal error on the build VM

So i think it might need to be updated to something like:

        case 'success':
          badgeData.text[1] = 'passing';
          badgeData.colorscheme = 'brightgreen';
          break;
        case 'projectnotfound':
          badgeData.text[1] = 'not found';
          break;
        case 'branchnotfound':
          badgeData.text[1] = 'branch not found';
          break;
        case 'testing':
        case 'waiting':
        case 'initiated':
          badgeData.text[1] = 'pending';
          break;
        case 'error':
        case 'infrastructure_failure':
          badgeData.text[1] = 'failing';
          badgeData.colorscheme = 'red';
          break;
        case 'stopped':
        case 'ignored':
        case 'blocked':
          badgeData.text[1] = 'not built';
          break;

@zosiu zosiu changed the title [Codeship] fix status checking regexp [Codeship] fix status checking regexp & add new statuses Apr 26, 2018
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.

@RedSparr0w
Copy link
Member

Thanks for the PR,
Changes look good to me.

Merged!
😄

@RedSparr0w RedSparr0w merged commit 14bdaf3 into badges:master Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codeship badge returns "Build: Unknown"
3 participants