Skip to content

Commit

Permalink
feat(backend): keep current Chaotic versions; fix outstanding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dr460nf1r3 committed Nov 1, 2024
1 parent b6a06da commit 5cb5df1
Show file tree
Hide file tree
Showing 6 changed files with 584 additions and 430 deletions.
1 change: 1 addition & 0 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import appConfig from "./config/app.config";
import { dataSourceOptions } from "./data.source";
import { MetricsModule } from "./metrics/metrics.module";
import { MiscModule } from "./misc/misc.module";
import { RepoManagerModule } from "./repo-manager/repo-manager.module";
import { RouterModule } from "./router/router.module";
import { UsersModule } from "./users/users.module";
import { ThrottlerModule } from "@nestjs/throttler";
Expand Down
6 changes: 6 additions & 0 deletions backend/src/builder/builder.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export class Package {

@Column({ type: "jsonb", nullable: true })
metadata: string;

@Column({ type: "int", nullable: true })
pkgrel: number;
}

@Entity()
Expand All @@ -81,6 +84,9 @@ export class Repo {

@Column({ type: "varchar", default: "main" })
gitRef: string;

@Column({ type: "varchar", nullable: true })
dbPath: string;
}

@Entity()
Expand Down
2 changes: 1 addition & 1 deletion backend/src/data.source.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DataSource, type DataSourceOptions } from "typeorm";
import { Build, Builder, Repo } from "./builder/builder.entity";
import { IS_PROD } from "./constants";
import { ArchlinuxPackage, RepoManagerSettings } from "./repo-manager/repo-manager.entity";
import { Mirror, RouterHit } from "./router/router.entity";
import { User } from "./users/users.entity";
import { ArchlinuxPackage, RepoManagerSettings } from "./repo-manager/repo-manager.entity";

export const dataSourceOptions: DataSourceOptions = {
type: "postgres",
Expand Down
12 changes: 11 additions & 1 deletion backend/src/interfaces/repo-manager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Package } from "../builder/builder.entity";

export interface Repo {
name: string;
url: string;
Expand All @@ -10,7 +12,7 @@ export enum RepoStatus {
RUNNING = 2,
}

export interface ArchRepoToCheck {
export interface RepoWorkDir {
name: string;
path: string;
workDir: string;
Expand All @@ -35,3 +37,11 @@ export interface PkgnameVersion {
pkgname: string;
archVersion: string;
}

export interface RepoUpdateRunParams {
archPkg: ParsedPackage;
configs: CiConfigs;
pkg: Package;
}

export type CiConfigs = { [key: string]: string };
5 changes: 5 additions & 0 deletions backend/src/repo-manager/repo-manager.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export class RepoManagerController {
run(): void {
void this.repoManager.run();
}

@Get("update-db")
updateChaoticVersions(): void {
void this.repoManager.updateChaoticVersions();
}
}
Loading

0 comments on commit 5cb5df1

Please sign in to comment.