Address catalog review cleanup
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -462,7 +462,7 @@ function buildCatalogSkillSource(
|
|||||||
}
|
}
|
||||||
const hostname = descriptor.hostname ?? "github.com";
|
const hostname = descriptor.hostname ?? "github.com";
|
||||||
const url = `https://${hostname}/${descriptor.owner}/${descriptor.repo}/tree/${descriptor.ref}/${sourcePath ?? ""}`.replace(/\/$/, "");
|
const url = `https://${hostname}/${descriptor.owner}/${descriptor.repo}/tree/${descriptor.ref}/${sourcePath ?? ""}`.replace(/\/$/, "");
|
||||||
if (errors.length > 0 && (!/^[0-9a-f]{40}$/i.test(descriptor.commit) || sourcePath === null)) return null;
|
if (!/^[0-9a-f]{40}$/i.test(descriptor.commit) || sourcePath === null) return null;
|
||||||
return {
|
return {
|
||||||
type: "github",
|
type: "github",
|
||||||
hostname,
|
hostname,
|
||||||
|
|||||||
@@ -3048,6 +3048,7 @@ export function companySkillService(db: Db) {
|
|||||||
|
|
||||||
let materializedDir: string | null = null;
|
let materializedDir: string | null = null;
|
||||||
let originSnapshotLocator: string | null = null;
|
let originSnapshotLocator: string | null = null;
|
||||||
|
let candidateMaterializedDir: string | null = null;
|
||||||
try {
|
try {
|
||||||
originSnapshotLocator = await materializeCatalogOriginSnapshot(companyId, catalogSkill, slug);
|
originSnapshotLocator = await materializeCatalogOriginSnapshot(companyId, catalogSkill, slug);
|
||||||
const candidateAudit = await auditCatalogSkillSnapshot(companyId, catalogSkill, slug, originSnapshotLocator);
|
const candidateAudit = await auditCatalogSkillSnapshot(companyId, catalogSkill, slug, originSnapshotLocator);
|
||||||
@@ -3057,9 +3058,12 @@ export function companySkillService(db: Db) {
|
|||||||
audit: candidateAudit,
|
audit: candidateAudit,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
materializedDir = await materializeCatalogManifestSkillFiles(companyId, catalogSkill, slug);
|
candidateMaterializedDir = await materializeCatalogManifestSkillFiles(companyId, catalogSkill, slug);
|
||||||
|
materializedDir = candidateMaterializedDir;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (materializedDir) await fs.rm(materializedDir, { recursive: true, force: true }).catch(() => undefined);
|
if (candidateMaterializedDir) {
|
||||||
|
await fs.rm(candidateMaterializedDir, { recursive: true, force: true }).catch(() => undefined);
|
||||||
|
}
|
||||||
if (originSnapshotLocator) await fs.rm(originSnapshotLocator, { recursive: true, force: true }).catch(() => undefined);
|
if (originSnapshotLocator) await fs.rm(originSnapshotLocator, { recursive: true, force: true }).catch(() => undefined);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user