(taskInfo: TaskInfo, fetchedTask: FetchedTask)
| 145 | // If the task is not on the main tree, the version is the version of the task plus the hash of the task source. |
| 146 | // If it is on the main tree, then the version is just what is in the manifest |
| 147 | export function getTaskVersion(taskInfo: TaskInfo, fetchedTask: FetchedTask): string | null { |
| 148 | // Prefer task-level versions, fall back on family-level version |
| 149 | let version = fetchedTask.manifest?.tasks[taskInfo.taskName]?.version ?? fetchedTask.manifest?.version ?? null |
| 150 | if (version !== null && (taskInfo.source.type === 'upload' || taskInfo.source.isMainAncestor !== true)) { |
| 151 | const taskHash = hashTaskOrAgentSource(taskInfo.source) |
| 152 | version = `${version}-${taskHash.slice(-7)}` |
| 153 | } |
| 154 | return version |
| 155 | } |
| 156 | |
| 157 | export function getSandboxContainerName(config: Config, runId: RunId) { |
| 158 | const machineName = config.getMachineName() |
no test coverage detected