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

View File

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

View File

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

View File

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

View File

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

View File

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