feat: add personal repositories organization override and update related configurations

This commit is contained in:
Arunavo Ray
2025-06-24 11:02:57 +05:30
parent d2bec1d56e
commit 68108b8383
12 changed files with 274 additions and 22 deletions

View File

@@ -6,7 +6,7 @@ import { repositoryVisibilityEnum, repoStatusEnum } from "@/types/Repository";
import {
mirrorGithubRepoToGitea,
mirrorGitHubOrgRepoToGiteaOrg,
getGiteaRepoOwner,
getGiteaRepoOwnerAsync,
} from "@/lib/gitea";
import { createGitHubClient } from "@/lib/github";
import { processWithResilience } from "@/lib/utils/concurrency";
@@ -97,8 +97,8 @@ export const POST: APIRoute = async ({ request }) => {
// Log the start of mirroring
console.log(`Starting mirror for repository: ${repo.name}`);
// Determine where the repository should be mirrored
const owner = getGiteaRepoOwner({
// Determine where the repository should be mirrored (with organization overrides)
const owner = await getGiteaRepoOwnerAsync({
config,
repository: repoData,
});

View File

@@ -1,7 +1,7 @@
import type { APIRoute } from "astro";
import { db, configs, repositories } from "@/lib/db";
import { eq, inArray } from "drizzle-orm";
import { getGiteaRepoOwner, isRepoPresentInGitea } from "@/lib/gitea";
import { getGiteaRepoOwnerAsync, isRepoPresentInGitea } from "@/lib/gitea";
import {
mirrorGithubRepoToGitea,
mirrorGitHubOrgRepoToGiteaOrg,
@@ -109,8 +109,8 @@ export const POST: APIRoute = async ({ request }) => {
status: "imported",
});
// Determine if the repository exists in Gitea
let owner = getGiteaRepoOwner({
// Determine if the repository exists in Gitea (with organization overrides)
let owner = await getGiteaRepoOwnerAsync({
config,
repository: repoData,
});