expand job container on runner side#101
Conversation
|
Please update description with link to workitem on the team board. |
| ContainerInfo Container { get; } | ||
| List<ContainerInfo> SidecarContainers { get; } | ||
| ContainerInfo Container { get; set; } | ||
| List<ContainerInfo> ServiceContainers { get; } |
There was a problem hiding this comment.
converged on "Services" everywhere, previously mix of "Sidecar" and "Services" (due to history, rename)
| public Dictionary<string, VariableValue> TaskVariables { get; set; } | ||
| public Dictionary<string, string> Inputs { get; set; } | ||
| public Dictionary<String, PipelineContextData> Context { get; set; } | ||
| public DictionaryContextData Context { get; set; } = new DictionaryContextData(); |
There was a problem hiding this comment.
simplified the type, multiple places
| } | ||
|
|
||
| public ContainerInfo(IHostContext hostContext, Pipelines.ContainerResource container, Boolean isJobContainer = true) | ||
| public ContainerInfo(IHostContext hostContext, Pipelines.JobContainer container, bool isJobContainer = true, string networkAlias = null) |
There was a problem hiding this comment.
this is one of the last few things that used "Resources". i switched to a simple data object "JobContainer" defined in the web api
| ExpressionValues["runner"] = new RunnerContext(); | ||
| ExpressionValues["job"] = new JobContext(); | ||
|
|
||
| if (!ExpressionValues.ContainsKey("github")) |
There was a problem hiding this comment.
bye bye back compat code
| // Prepend Path | ||
| PrependPath = new List<string>(); | ||
|
|
||
| // Docker (JobContainer) |
There was a problem hiding this comment.
this has to be evaluated now during job initialize
| } | ||
| } | ||
|
|
||
| // Evaluate the job container |
There was a problem hiding this comment.
here is where the container evaluation happens now
| context.SetRunnerContext("workspace", Path.Combine(_workDirectory, trackingConfig.PipelineDirectory)); | ||
| context.SetGitHubContext("workspace", Path.Combine(_workDirectory, trackingConfig.WorkspaceDirectory)); | ||
|
|
||
| // Build up 3 lists of steps, pre-job, job, post-job |
There was a problem hiding this comment.
these two lines just moved down a little to be grouped with the code that is relevant to this
| } | ||
| } | ||
|
|
||
| public IDictionary<String, String> JobSidecarContainers |
There was a problem hiding this comment.
i wanted to remove this property to make sure i fixed everywhere
| var serviceContainer = pair.Value; | ||
| jobContext.ServiceContainers.Add(new Container.ContainerInfo(HostContext, serviceContainer, false, networkAlias)); | ||
| } | ||
| } |
There was a problem hiding this comment.
| ExpressionValues["github"] = githubContext; | ||
| githubContext[pair.Key] = pair.Value; | ||
| } | ||
| ExpressionValues["github"] = githubContext; |
There was a problem hiding this comment.
this is much cleaner, nice
| githubAccessToken = repoEndpoint.Authorization.Parameters["accessToken"]; | ||
| githubContext["token"] = new StringContextData(githubAccessToken); | ||
| var base64EncodingToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"x-access-token:{githubAccessToken}")); | ||
| HostContext.SecretMasker.AddValue(base64EncodingToken); |
There was a problem hiding this comment.
Did you mean to pull out the Secret Masking of the token? (Above as well)
There was a problem hiding this comment.
The rest of this looks good to me! I'd like to just clarify this part
There was a problem hiding this comment.
@TingluoHuang we dont need this anymore now that you added the base64 encoders, right?
There was a problem hiding this comment.
yes, we don't really need this.
331211d to
ceee866
Compare
| m_maskHints = null; | ||
| } | ||
| else | ||
| else if (m_maskHints != null) |
related to https://github.com/github/pe-actions-runtime/issues/23