This repository was archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 449
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Octorun JS replace IsCustom and use specific values #618
Copy link
Copy link
Closed
Labels
Description
Breakout of #617
- Replace
IsCustomwith specific values for each "status code" that can be returned- Only output status codes or raw error messages
Octorun Js #599 (comment) - Add status code for 2FA code failure
Removing Octokit #611 (comment)
- Only output status codes or raw error messages
In the OctorunResult object we allow for a user to parse the status when it is not a known "Success/Error" status. We can do better by being deterministic about the values returned by the javascript and parsed for in c#.
Unity/src/GitHub.Api/Tasks/OctorunTask.cs
Lines 107 to 127 in 7860c08
| class OctorunResult | |
| { | |
| public string Status { get; } | |
| public string[] Output { get; } | |
| public OctorunResult() | |
| { | |
| Status = "error"; | |
| Output = new string[0]; | |
| } | |
| public OctorunResult(string status, string[] output) | |
| { | |
| Status = status; | |
| Output = output; | |
| } | |
| public bool IsSuccess => Status.Equals("success", StringComparison.InvariantCultureIgnoreCase); | |
| public bool IsError => Status.Equals("error", StringComparison.InvariantCultureIgnoreCase); | |
| public bool IsCustom => !IsSuccess && !IsError; | |
| } |
That means we should only output status when the octokit return values are parseable by Octorun. If not Octorun should return the raw error to the C# code.