arcade: Helix JobSender SDK doesn't provide a way to set IsExternal=true

E.g. using this Hello World sample:

var api = ApiFactory.GetAuthenticated("<API Token>");

var jobDefinition = api.Job.Define()
        .WithSource("pr/test/helloworld")
        .WithType("test/helloworld")
        .WithBuild(DateTime.UtcNow.Ticks.ToString())
        .WithTargetQueue("Ubuntu.1804.Amd64.Open")
        .DefineWorkItem("Hello World")
        .WithCommand("echo 'Hello!'")
        .WithEmptyPayload()
        .AttachToJob();

var job = await jobDefinition.SendAsync();

The resulting build isn’t accessible to users outside of the Microsoft GitHub org on Mission Control, @MattGal says this is because the Helix job has IsExternal=false but there seems to be no way to set this to true with the SDK.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

I found a workaround that seems to work for my use case:

var authenticatedApi = ApiFactory.GetAuthenticated("<API TOKEN>");
var storage = new Storage((HelixApi)authenticatedApi);

var anonymousApi = ApiFactory.GetAnonymous();
typeof(HelixApi).GetProperty("Storage").SetValue(anonymousApi, storage, null);

var jobDefinition = anonymousApi.Job.Define()
...