Trigger "error" status (instead of "failed") from command line?

tony's Avatar

tony

14 Dec, 2014 10:56 AM

I'm thinking of adding some code to manually fail a build immediately if there are newer pending commits from the same pull request by the time the build actually starts (achieving the same effect as https://github.com/appveyor/ci/issues/38 I guess?). I'm wondering whether it would be possible to manually trigger the "error" status (https://github.com/blog/1227-commit-status-api) to reflect that it wasn't caused by a build/test failure. I could try sending the status API posts myself, but presumably appveyor already has code internally for setting statuses. Would be useful to have an "appveyor ErrorStatus" command-line option for this. I tried using "appveyor AddMessage -Category Error" but it didn't actually have an effect on the build status.

  1. Support Staff 1 Posted by Feodor Fitsner on 15 Dec, 2014 05:46 PM

    Feodor Fitsner's Avatar

    Yeah, there is no way right now to change commit status rather than "failure".

    Does your idea play well with build cancelled status? So, cancelling build would set "cancelled" status on build, won't send any notifications and set "error" commit status.

  2. 2 Posted by tony on 15 Dec, 2014 07:04 PM

    tony's Avatar

    Yep, cancelled would work fine if there's a command-line way of cancelling the build from inside the worker after it's started.

    Cross-referencing for anyone else who sees this, my idea is working (so far) at https://github.com/JuliaLang/julia/pull/9355, and some related information is at https://github.com/appveyor/ci/issues/87. It should be easy enough to port the same code into powershell or whatever other language people want to use.

  3. 3 Posted by tony on 15 Dec, 2014 07:29 PM

    tony's Avatar

    Oh yeah, I guess I could use AppVeyor's REST API to cancel the build, huh. I'll give that a try.

  4. 4 Posted by tony on 16 Dec, 2014 12:30 AM

    tony's Avatar

    I'm able to cancel a build through the web API remotely from my own machine, but not from within a build. The local build agent API at APPVEYOR_API_URL doesn't have the same build-related information as the outside-world API at https://ci.appveyor.com/api. I wasn't able to get authentication to the remote API to work from inside a build worker using a secure-variable encrypted version of my API token.

    Any way these local and remote build API's could be unified a little bit?

  5. Support Staff 5 Posted by Feodor Fitsner on 16 Dec, 2014 12:42 AM

    Feodor Fitsner's Avatar

    Yeah, these are completely different APIs. I don't know about unifying - maybe we could just provide PS wrapper for that bigger/outside API.

  6. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:50 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac