discord-bot/Clients/AppveyorClient
2020-03-09 22:16:19 +05:00
..
POCOs checked for missed and failed/cancelled builds to post in announcements 2020-03-01 00:09:43 +05:00
AppveyorClient.csproj update deps 2020-03-02 16:07:55 +05:00
Client.cs support for OneDrive log links 2020-03-09 22:16:19 +05:00
readme.md some docs 2019-04-01 22:52:27 +05:00

AppVeyor Client

AppVeyor API documentation for reference. There are some inaccuracies and legacy quirks though. As we use the API for read-only queries, on a publicly available data, we don't need any form of authentication. User-Agent header is provided as a courtesy.

What AppVeyor client is used for, is to get the direct download links for PR builds. For that we need to get the job artifacts. And for that we need job id, which can only be associated with the corresponding GitHub PR through the build info, which we can find in the build history. Phew, easy.

FindBuildAsync is a general history search function that can be used to search through the history until some criteria is met. We use it at startup with the bogus predicate to get and cache the whole history to map job IDs to their build info, which is used for quick lookup when we want to show PR download for direct links.

GetMasterBuildAsync is mainly used to get the build time, as CompatApi client provides merge time instead of the build time currently.

GetPrDownloadAsync that accepts githubStatusTargetUrl uses string.Replace() instead of constructing the url manually because of the legacy quirks. AppVeyor has changed the link format at some point, and there's not backwards compatibility there, so old direct links work only with the old link format.