Skip to content

Commit

Permalink
fix(backend): don't generate invalid commits for non-bumped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dr460nf1r3 committed Nov 18, 2024
1 parent 912ae93 commit d3f872e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend/src/interfaces/repo-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface RepoUpdateRunParams {
configs: CiConfigs;
pkg: Package;
triggerFrom: TriggerType;
gotBumped: boolean
}

export type CiConfigs = { [key: string]: string };
Expand Down
7 changes: 5 additions & 2 deletions backend/src/repo-manager/repo-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,10 @@ class RepoManager {
return { repo: repo.name, bumped: [], origin: TriggerType.ARCH };
}
const bumpedPackages: PackageBumpEntry[] = await this.bumpPackages(needsRebuild, repoDir);
const needsPush = needsRebuild.filter(entry => entry.gotBumped === true)

Logger.log(`Pushing changes to ${repo.name}`, "RepoManager");
await this.pushChanges(repoDir, needsRebuild, repo);
await this.pushChanges(repoDir, needsPush, repo);

Logger.debug("Done checking for rebuild triggers, cleaning up", "RepoManager");
this.cleanUp([repoDir, ...pkgbaseDirs]);
Expand Down Expand Up @@ -844,9 +845,11 @@ class RepoManager {
});
}
}

void this.dbConnections.packages.save(param.pkg);

// Indicate we bumped the package
param.gotBumped = true

// We need to update the package in the database to reflect the new bump
const bumpEntry: PackageBumpEntry = {
pkg: param.pkg,
Expand Down

0 comments on commit d3f872e

Please sign in to comment.