Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
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

@StanleyGoldman

Description

@StanleyGoldman

Breakout of #617

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#.

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions