Warn for soon to be deprecated OS versions (#3413)

This commit is contained in:
eric sciple
2024-08-02 14:37:46 -05:00
committed by GitHub
parent 12506842c0
commit ae04147f96
13 changed files with 457 additions and 22 deletions

View File

@@ -44,6 +44,7 @@ namespace GitHub.DistributedTask.Pipelines
IList<TemplateToken> defaults,
ActionsEnvironmentReference actionsEnvironment,
TemplateToken snapshot,
IList<OSWarning> osWarnings,
String messageType = JobRequestMessageTypes.PipelineAgentJobRequest)
{
this.MessageType = messageType;
@@ -73,6 +74,11 @@ namespace GitHub.DistributedTask.Pipelines
m_defaults = new List<TemplateToken>(defaults);
}
if (osWarnings?.Count > 0)
{
m_osWarnings = new List<OSWarning>(osWarnings);
}
this.ContextData = new Dictionary<String, PipelineContextData>(StringComparer.OrdinalIgnoreCase);
if (contextData?.Count > 0)
{
@@ -288,6 +294,18 @@ namespace GitHub.DistributedTask.Pipelines
}
}
public IList<OSWarning> OSWarnings
{
get
{
if (m_osWarnings == null)
{
m_osWarnings = new List<OSWarning>();
}
return m_osWarnings;
}
}
// todo: remove after feature-flag DistributedTask.EvaluateContainerOnRunner is enabled everywhere
public void SetJobSidecarContainers(IDictionary<String, String> value)
{
@@ -425,6 +443,11 @@ namespace GitHub.DistributedTask.Pipelines
{
JobContainer = new StringToken(null, null, null, m_jobContainerResourceAlias);
}
if (m_osWarnings?.Count == 0)
{
m_osWarnings = null;
}
}
[DataMember(Name = "EnvironmentVariables", EmitDefaultValue = false)]
@@ -449,6 +472,9 @@ namespace GitHub.DistributedTask.Pipelines
[DataMember(Name = "JobSidecarContainers", EmitDefaultValue = false)]
private IDictionary<String, String> m_jobSidecarContainers;
[DataMember(Name = "OSWarnings", EmitDefaultValue = false)]
private List<OSWarning> m_osWarnings;
// todo: remove after feature-flag DistributedTask.EvaluateContainerOnRunner is enabled everywhere
[IgnoreDataMember]
private string m_jobContainerResourceAlias;