Skip to content

Commit 5107c5e

Browse files
authored
Cleanup enabled feature flags. (actions#3248)
1 parent 1b61d78 commit 5107c5e

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

src/Runner.Listener/JobDispatcher.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,18 +1155,13 @@ private async Task LogWorkerProcessUnhandledException(IJobServer jobServer, Pipe
11551155
TimelineRecord jobRecord = timeline.Records.FirstOrDefault(x => x.Id == message.JobId && x.RecordType == "Job");
11561156
ArgUtil.NotNull(jobRecord, nameof(jobRecord));
11571157

1158-
11591158
jobRecord.ErrorCount++;
11601159
jobRecord.Issues.Add(issue);
11611160

1162-
if (message.Variables.TryGetValue("DistributedTask.MarkJobAsFailedOnWorkerCrash", out var markJobAsFailedOnWorkerCrash) &&
1163-
StringUtil.ConvertToBoolean(markJobAsFailedOnWorkerCrash?.Value))
1164-
{
1165-
Trace.Info("Mark the job as failed since the worker crashed");
1166-
jobRecord.Result = TaskResult.Failed;
1167-
// mark the job as completed so service will pickup the result
1168-
jobRecord.State = TimelineRecordState.Completed;
1169-
}
1161+
Trace.Info("Mark the job as failed since the worker crashed");
1162+
jobRecord.Result = TaskResult.Failed;
1163+
// mark the job as completed so service will pickup the result
1164+
jobRecord.State = TimelineRecordState.Completed;
11701165

11711166
await jobServer.UpdateTimelineRecordsAsync(message.Plan.ScopeIdentifier, message.Plan.PlanType, message.Plan.PlanId, message.Timeline.Id, new TimelineRecord[] { jobRecord }, CancellationToken.None);
11721167
}

src/Runner.Worker/ActionManager.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,6 @@ public Definition LoadAction(IExecutionContext executionContext, Pipelines.Actio
483483
{
484484
// Load stored Ids for later load actions
485485
compositeAction.Steps[i].Id = _cachedEmbeddedStepIds[action.Id][i];
486-
if (string.IsNullOrEmpty(executionContext.Global.Variables.Get("DistributedTask.EnableCompositeActions")) && compositeAction.Steps[i].Reference.Type != Pipelines.ActionSourceType.Script)
487-
{
488-
throw new Exception("`uses:` keyword is not currently supported.");
489-
}
490486
}
491487
}
492488
else
@@ -1022,13 +1018,6 @@ private ActionSetupInfo PrepareRepositoryActionAsync(IExecutionContext execution
10221018
}
10231019
}
10241020

1025-
foreach (var step in compositeAction.Steps)
1026-
{
1027-
if (string.IsNullOrEmpty(executionContext.Global.Variables.Get("DistributedTask.EnableCompositeActions")) && step.Reference.Type != Pipelines.ActionSourceType.Script)
1028-
{
1029-
throw new Exception("`uses:` keyword is not currently supported.");
1030-
}
1031-
}
10321021
return setupInfo;
10331022
}
10341023
else

src/Test/L0/Worker/ActionManagerL0.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,10 +2373,6 @@ private void Setup([CallerMemberName] string name = "", bool enableComposite = t
23732373
_ec.Setup(x => x.CancellationToken).Returns(_ecTokenSource.Token);
23742374
_ec.Setup(x => x.Root).Returns(new GitHub.Runner.Worker.ExecutionContext());
23752375
var variables = new Dictionary<string, VariableValue>();
2376-
if (enableComposite)
2377-
{
2378-
variables["DistributedTask.EnableCompositeActions"] = "true";
2379-
}
23802376
_ec.Object.Global.Variables = new Variables(_hc, variables);
23812377
_ec.Setup(x => x.ExpressionValues).Returns(new DictionaryContextData());
23822378
_ec.Setup(x => x.ExpressionFunctions).Returns(new List<IFunctionInfo>());

0 commit comments

Comments
 (0)