Use deployer LRN instead of ID in rollback deployment

This commit is contained in:
Shreerang Kale
2025-02-07 10:31:51 +05:30
parent 285d0e86bf
commit d93afb564b
6 changed files with 10 additions and 16 deletions
+3 -3
View File
@@ -345,11 +345,11 @@ export const createResolvers = async (service: Service): Promise<any> => {
{
projectId,
deploymentId,
deployerId,
}: { deploymentId: string; projectId: string, deployerId: string },
deployerLrn,
}: { deploymentId: string; projectId: string, deployerLrn: string },
) => {
try {
return await service.rollbackDeployment(projectId, deploymentId, deployerId);
return await service.rollbackDeployment(projectId, deploymentId, deployerLrn);
} catch (err) {
log(err);
return false;
+2 -2
View File
@@ -1193,7 +1193,7 @@ export class Service {
async rollbackDeployment(
projectId: string,
deploymentId: string,
deployerId: string,
deployerLrn: string,
): Promise<boolean> {
// TODO: Implement transactions
const oldCurrentDeployment = await this.db.getDeployment({
@@ -1206,7 +1206,7 @@ export class Service {
id: projectId,
},
deployer: {
deployerId
deployerLrn
},
isCurrent: true,
isCanonical: false,
@@ -99,7 +99,7 @@ export const DeploymentMenu = ({
const isRollbacked = await client.rollbackDeployment(
project.id,
deployment.id,
deployment.deployer.deployerId
deployment.deployer.deployerLrn
);
if (isRollbacked.rollbackDeployment) {
await onUpdate();
@@ -97,17 +97,12 @@ const Config = () => {
}
setDnsRecordsWithLRN(tempDNSRecords);
// console.log('DNS RECORD', dnsRecordResponse)
// setDnsRecord({} as DNSRecordAttributes);
};
fetchDNSData();
}, [id, client]);
// TODO: Figure out DNS Provider if possible and update appropriatly
// TODO: Handle case where dnsRecords only have one entry and IP address for that record is not availble
return (
<ProjectSettingContainer headingText="Setup domain name">
{dnsRecordsWithLRN.length ? (
@@ -170,7 +165,6 @@ const Config = () => {
>
FINISH
</Button>
;
</ProjectSettingContainer>
);
};
+2 -2
View File
@@ -338,14 +338,14 @@ export class GQLClient {
async rollbackDeployment(
projectId: string,
deploymentId: string,
deployerId: string,
deployerLrn: string,
): Promise<types.RollbackDeploymentResponse> {
const { data } = await this.client.mutate({
mutation: mutations.rollbackDeployment,
variables: {
projectId,
deploymentId,
deployerId,
deployerLrn,
},
});
+2 -2
View File
@@ -95,8 +95,8 @@ export const deleteDomain = gql`
`;
export const rollbackDeployment = gql`
mutation ($projectId: String!, $deploymentId: String!) {
rollbackDeployment(projectId: $projectId, deploymentId: $deploymentId)
mutation ($projectId: String!, $deployerLrn: String!) {
rollbackDeployment(projectId: $projectId, deployerLrn: $deployerLrn)
}
`;