Skip to content

Commit

Permalink
fix(backend): too many bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
dr460nf1r3 committed Nov 8, 2024
1 parent d610815 commit 2bf6086
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions backend/src/repo-manager/repo-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,11 @@ class RepoManager {
triggerFrom: TriggerType.ARCH,
});

Logger.debug(`Rebuilding ${pkgbaseDir} because of explicit trigger ${archRebuildPkg[0].pkgname}`, "RepoManager");
Logger.debug(
`Rebuilding ${pkgbaseDir} because of explicit trigger ${archRebuildPkg[0].pkgname}`,
"RepoManager",
);
foundTrigger = true;
continue;
}

Expand Down Expand Up @@ -646,6 +650,7 @@ class RepoManager {
`Rebuilding ${pkgbaseDir} because of changed shared library ${trigger.pkg.pkgname}`,
"RepoManager",
);
foundTrigger = true;
}
}

Expand All @@ -668,7 +673,6 @@ class RepoManager {
provides: string[];
} = soProvidingArchPackages.find((pkg) => pkg.provides?.includes(depPkg));


if (foundSoProvider) {
trigger = foundSoProvider.pkg;
break;
Expand All @@ -688,6 +692,7 @@ class RepoManager {
`Rebuilding ${pkgbaseDir} because of namcap detected library dep ${trigger.pkgname}`,
"RepoManager",
);
foundTrigger = true;
break;
}
}
Expand Down Expand Up @@ -742,7 +747,7 @@ class RepoManager {
const packageBumpsLastDay: PackageBump[] = await this.dbConnections.packageBump.find({
where: { timestamp: MoreThanOrEqual(date) },
order: { timestamp: "DESC" },
relations: ["pkg"]
relations: ["pkg"],
});

Logger.log(`Found ${packageBumpsLastDay.length} bumps in the last day`, "RepoManager");
Expand All @@ -757,22 +762,24 @@ class RepoManager {
if (
param.pkg.pkgname.includes("-bin") ||
param.pkg.pkgname.includes("-appimage") ||
param.pkg.pkgname.includes("-snap")
param.pkg.pkgname.includes("-snap") ||
param.pkg.pkgname.includes("-support") ||
param.pkg.pkgname.includes("-meta")
)
continue;

// We also don't want to rebuild packages that have already been bumped within a day
const needsSkip = relevantBumps.find((bump) => bump.pkg.id === param.pkg.id) !== undefined;
if (needsSkip) {
Logger.warn(`Already bumped ${param.pkg.pkgname}, skipping`, "RepoManager");
Logger.warn(`Already bumped ${param.pkg.pkgname} during the last day, skipping`, "RepoManager");
continue;
}

// We don't want to bump twice, either
const existingEntry: PackageBumpEntry = alreadyBumped.find(
(entry) => entry.pkg.pkgname === param.pkg.pkgname,
);
if (existingEntry && typeof existingEntry.trigger !== "number" && "pkgname" in existingEntry.trigger) {
if (existingEntry) {
Logger.warn(
`Already bumped via ${existingEntry.triggerName}, skipping ${param.pkg.pkgname}`,
"RepoManager",
Expand Down

0 comments on commit 2bf6086

Please sign in to comment.