fix: remove giteaPathNamespace

This commit is contained in:
Jason Parks 2025-03-24 01:53:00 -06:00
parent 5d5913f39d
commit 39f4a35cc8
7 changed files with 1 additions and 24 deletions

View File

@ -67,7 +67,6 @@ const GiteaProviderSchema = z.object({
.object({
repo: z.string().min(1, "Repo is required"),
owner: z.string().min(1, "Owner is required"),
giteaPathNamespace: z.string().min(1),
id: z.number().nullable().optional(),
})
.required(),
@ -95,7 +94,6 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
repository: {
owner: "",
repo: "",
giteaPathNamespace: "",
id: null,
},
giteaId: "",
@ -144,7 +142,6 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
repository: {
repo: data.giteaRepository || "",
owner: data.giteaOwner || "",
giteaPathNamespace: data.giteaPathNamespace || "",
id: data.giteaProjectId || null, // Handle null case explicitly
},
buildPath: data.giteaBuildPath || "/",
@ -163,7 +160,6 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
giteaId: data.giteaId,
applicationId,
giteaProjectId: data.repository.id || null, // Handle null case explicitly
giteaPathNamespace: data.repository.giteaPathNamespace,
watchPaths: data.watchPaths,
})
.then(async () => {
@ -197,7 +193,6 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
owner: "",
repo: "",
id: null,
giteaPathNamespace: "",
});
form.setValue("branch", "");
}}
@ -283,7 +278,6 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
owner: repo.owner.username as string,
repo: repo.name,
id: repo.id,
giteaPathNamespace: repo.name,
});
form.setValue("branch", "");
}}

View File

@ -55,7 +55,6 @@ const GiteaProviderSchema = z.object({
repo: z.string().min(1, "Repo is required"),
owner: z.string().min(1, "Owner is required"),
id: z.number().nullable(),
giteaPathNamespace: z.string(),
})
.required(),
branch: z.string().min(1, "Branch is required"),
@ -82,7 +81,6 @@ export const SaveGiteaProviderCompose = ({ composeId }: Props) => {
repository: {
owner: "",
repo: "",
giteaPathNamespace: "",
id: null,
},
giteaId: "",
@ -146,7 +144,6 @@ export const SaveGiteaProviderCompose = ({ composeId }: Props) => {
repo: data.giteaRepository || "",
owner: data.giteaOwner || "",
id: currentRepo?.id || null,
giteaPathNamespace: currentRepo?.url || "",
},
composePath: data.composePath,
giteaId: data.giteaId || "",
@ -198,7 +195,6 @@ export const SaveGiteaProviderCompose = ({ composeId }: Props) => {
form.setValue("repository", {
owner: "",
repo: "",
giteaPathNamespace: "",
id: null,
});
form.setValue("branch", "");
@ -289,7 +285,6 @@ export const SaveGiteaProviderCompose = ({ composeId }: Props) => {
owner: repo.owner.username,
repo: repo.name,
id: repo.id,
giteaPathNamespace: repo.url,
});
form.setValue("branch", "");
}}

View File

@ -21,7 +21,6 @@ ALTER TABLE "application" ADD COLUMN "giteaRepository" text;--> statement-breakp
ALTER TABLE "application" ADD COLUMN "giteaOwner" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "giteaBranch" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "giteaBuildPath" text DEFAULT '/';--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "giteaPathNamespace" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "giteaId" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "giteaRepository" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "giteaOwner" text;--> statement-breakpoint

View File

@ -285,12 +285,6 @@
"notNull": false,
"default": "'/'"
},
"giteaPathNamespace": {
"name": "giteaPathNamespace",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketRepository": {
"name": "bitbucketRepository",
"type": "text",

View File

@ -423,7 +423,6 @@ export const applicationRouter = createTRPCRouter({
applicationStatus: "idle",
giteaId: input.giteaId,
giteaProjectId: input.giteaProjectId,
giteaPathNamespace: input.giteaPathNamespace,
watchPaths: input.watchPaths,
});

View File

@ -163,7 +163,6 @@ export const applications = pgTable("application", {
giteaOwner: text("giteaOwner"),
giteaBranch: text("giteaBranch"),
giteaBuildPath: text("giteaBuildPath").default("/"),
giteaPathNamespace: text("giteaPathNamespace"),
// Bitbucket
bitbucketRepository: text("bitbucketRepository"),
bitbucketOwner: text("bitbucketOwner"),
@ -510,7 +509,6 @@ export const apiSaveGiteaProvider = createSchema
giteaRepository: true,
giteaId: true,
giteaProjectId: true,
giteaPathNamespace: true,
watchPaths: true,
})
.required();

View File

@ -17,16 +17,14 @@ export const getErrorCloneRequirements = (entity: {
giteaRepository?: string | null;
giteaOwner?: string | null;
giteaBranch?: string | null;
giteaPathNamespace?: string | null;
}) => {
const reasons: string[] = [];
const { giteaBranch, giteaOwner, giteaRepository, giteaPathNamespace } =
const { giteaBranch, giteaOwner, giteaRepository } =
entity;
if (!giteaRepository) reasons.push("1. Repository not assigned.");
if (!giteaOwner) reasons.push("2. Owner not specified.");
if (!giteaBranch) reasons.push("3. Branch not defined.");
if (!giteaPathNamespace) reasons.push("4. Path namespace not defined.");
return reasons;
};