mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 15:28:25 +00:00
PIT: omit commit version check on rollbacks and reverts
This commit is contained in:
@@ -309,7 +309,8 @@ describe("folderCommitServiceFactory", () => {
|
|||||||
type: CommitType.ADD,
|
type: CommitType.ADD,
|
||||||
folderVersionId: "folder-version-1"
|
folderVersionId: "folder-version-1"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
omitIgnoreFilter: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ type TCreateCommitDTO = {
|
|||||||
isUpdate?: boolean;
|
isUpdate?: boolean;
|
||||||
folderId?: string;
|
folderId?: string;
|
||||||
}[];
|
}[];
|
||||||
|
omitIgnoreFilter?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type TCommitChangeDTO = {
|
type TCommitChangeDTO = {
|
||||||
@@ -872,15 +873,18 @@ export const folderCommitServiceFactory = ({
|
|||||||
throw new NotFoundError({ message: `Folder with ID ${data.folderId} not found` });
|
throw new NotFoundError({ message: `Folder with ID ${data.folderId} not found` });
|
||||||
}
|
}
|
||||||
|
|
||||||
const project = await projectDAL.findProjectByEnvId(folder.envId, tx);
|
let { changes } = data;
|
||||||
|
if (!data.omitIgnoreFilter) {
|
||||||
|
const project = await projectDAL.findProjectByEnvId(folder.envId, tx);
|
||||||
|
|
||||||
if (!project) {
|
if (!project) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const changes = await filterIgnoredChanges(data.changes, project.id, tx);
|
changes = await filterIgnoredChanges(data.changes, project.id, tx);
|
||||||
if (changes.length === 0) {
|
if (changes.length === 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const newCommit = await folderCommitDAL.create(
|
const newCommit = await folderCommitDAL.create(
|
||||||
@@ -1358,7 +1362,8 @@ export const folderCommitServiceFactory = ({
|
|||||||
},
|
},
|
||||||
message: actorInfo.message || "Rolled back folder state",
|
message: actorInfo.message || "Rolled back folder state",
|
||||||
folderId,
|
folderId,
|
||||||
changes: allCommitChanges
|
changes: allCommitChanges,
|
||||||
|
omitIgnoreFilter: true
|
||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
);
|
);
|
||||||
@@ -1573,7 +1578,8 @@ export const folderCommitServiceFactory = ({
|
|||||||
},
|
},
|
||||||
message: "Initialized folder",
|
message: "Initialized folder",
|
||||||
folderId,
|
folderId,
|
||||||
changes
|
changes,
|
||||||
|
omitIgnoreFilter: true
|
||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user