MCPcopy Index your code
hub / github.com/coder/mux / readTaskBaseCommitShaByProjectPath

Function readTaskBaseCommitShaByProjectPath

src/node/services/taskService.ts:1023–1052  ·  view source on GitHub ↗
(params: {
  workspaceId: string;
  workspaceName: string;
  workspacePath: string;
  runtimeConfig: RuntimeConfig;
  projectPath: string;
  projectName: string;
  projects?: WorkspaceMetadata["projects"];
  runtime: Runtime;
})

Source from the content-addressed store, hash-verified

1021}
1022
1023async function readTaskBaseCommitShaByProjectPath(params: {
1024 workspaceId: string;
1025 workspaceName: string;
1026 workspacePath: string;
1027 runtimeConfig: RuntimeConfig;
1028 projectPath: string;
1029 projectName: string;
1030 projects?: WorkspaceMetadata["projects"];
1031 runtime: Runtime;
1032}): Promise<Record<string, string>> {
1033 const projectRepos = getWorkspaceProjectRepos({
1034 workspaceId: params.workspaceId,
1035 workspaceName: params.workspaceName,
1036 workspacePath: params.workspacePath,
1037 runtimeConfig: params.runtimeConfig,
1038 projectPath: params.projectPath,
1039 projectName: params.projectName,
1040 projects: params.projects,
1041 });
1042
1043 const taskBaseCommitShaByProjectPath: Record<string, string> = {};
1044 for (const projectRepo of projectRepos) {
1045 const taskBaseCommitSha = await tryReadGitHeadCommitSha(params.runtime, projectRepo.repoCwd);
1046 if (taskBaseCommitSha) {
1047 taskBaseCommitShaByProjectPath[projectRepo.projectPath] = taskBaseCommitSha;
1048 }
1049 }
1050
1051 return taskBaseCommitShaByProjectPath;
1052}
1053
1054export class ForegroundWaitBackgroundedError extends Error {
1055 constructor() {

Callers 2

createMethod · 0.85

Calls 2

getWorkspaceProjectReposFunction · 0.90
tryReadGitHeadCommitShaFunction · 0.90

Tested by

no test coverage detected