Address catalog review cleanup

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta
2026-06-04 21:10:29 +00:00
parent bee2b25f5d
commit 0cca059705
2 changed files with 7 additions and 3 deletions
@@ -462,7 +462,7 @@ function buildCatalogSkillSource(
}
const hostname = descriptor.hostname ?? "github.com";
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 {
type: "github",
hostname,
+6 -2
View File
@@ -3048,6 +3048,7 @@ export function companySkillService(db: Db) {
let materializedDir: string | null = null;
let originSnapshotLocator: string | null = null;
let candidateMaterializedDir: string | null = null;
try {
originSnapshotLocator = await materializeCatalogOriginSnapshot(companyId, catalogSkill, slug);
const candidateAudit = await auditCatalogSkillSnapshot(companyId, catalogSkill, slug, originSnapshotLocator);
@@ -3057,9 +3058,12 @@ export function companySkillService(db: Db) {
audit: candidateAudit,
});
}
materializedDir = await materializeCatalogManifestSkillFiles(companyId, catalogSkill, slug);
candidateMaterializedDir = await materializeCatalogManifestSkillFiles(companyId, catalogSkill, slug);
materializedDir = candidateMaterializedDir;
} 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);
throw error;
}