Use deployer LRN instead of ID in rollback deployment
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 2m6s
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 2m6s
This commit is contained in:
parent
285d0e86bf
commit
d93afb564b
@ -345,11 +345,11 @@ export const createResolvers = async (service: Service): Promise<any> => {
|
|||||||
{
|
{
|
||||||
projectId,
|
projectId,
|
||||||
deploymentId,
|
deploymentId,
|
||||||
deployerId,
|
deployerLrn,
|
||||||
}: { deploymentId: string; projectId: string, deployerId: string },
|
}: { deploymentId: string; projectId: string, deployerLrn: string },
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
return await service.rollbackDeployment(projectId, deploymentId, deployerId);
|
return await service.rollbackDeployment(projectId, deploymentId, deployerLrn);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log(err);
|
log(err);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1193,7 +1193,7 @@ export class Service {
|
|||||||
async rollbackDeployment(
|
async rollbackDeployment(
|
||||||
projectId: string,
|
projectId: string,
|
||||||
deploymentId: string,
|
deploymentId: string,
|
||||||
deployerId: string,
|
deployerLrn: string,
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
// TODO: Implement transactions
|
// TODO: Implement transactions
|
||||||
const oldCurrentDeployment = await this.db.getDeployment({
|
const oldCurrentDeployment = await this.db.getDeployment({
|
||||||
@ -1206,7 +1206,7 @@ export class Service {
|
|||||||
id: projectId,
|
id: projectId,
|
||||||
},
|
},
|
||||||
deployer: {
|
deployer: {
|
||||||
deployerId
|
deployerLrn
|
||||||
},
|
},
|
||||||
isCurrent: true,
|
isCurrent: true,
|
||||||
isCanonical: false,
|
isCanonical: false,
|
||||||
|
@ -99,7 +99,7 @@ export const DeploymentMenu = ({
|
|||||||
const isRollbacked = await client.rollbackDeployment(
|
const isRollbacked = await client.rollbackDeployment(
|
||||||
project.id,
|
project.id,
|
||||||
deployment.id,
|
deployment.id,
|
||||||
deployment.deployer.deployerId
|
deployment.deployer.deployerLrn
|
||||||
);
|
);
|
||||||
if (isRollbacked.rollbackDeployment) {
|
if (isRollbacked.rollbackDeployment) {
|
||||||
await onUpdate();
|
await onUpdate();
|
||||||
|
@ -97,17 +97,12 @@ const Config = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setDnsRecordsWithLRN(tempDNSRecords);
|
setDnsRecordsWithLRN(tempDNSRecords);
|
||||||
|
|
||||||
// console.log('DNS RECORD', dnsRecordResponse)
|
|
||||||
|
|
||||||
// setDnsRecord({} as DNSRecordAttributes);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchDNSData();
|
fetchDNSData();
|
||||||
}, [id, client]);
|
}, [id, client]);
|
||||||
|
|
||||||
// TODO: Figure out DNS Provider if possible and update appropriatly
|
// 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 (
|
return (
|
||||||
<ProjectSettingContainer headingText="Setup domain name">
|
<ProjectSettingContainer headingText="Setup domain name">
|
||||||
{dnsRecordsWithLRN.length ? (
|
{dnsRecordsWithLRN.length ? (
|
||||||
@ -170,7 +165,6 @@ const Config = () => {
|
|||||||
>
|
>
|
||||||
FINISH
|
FINISH
|
||||||
</Button>
|
</Button>
|
||||||
;
|
|
||||||
</ProjectSettingContainer>
|
</ProjectSettingContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -338,14 +338,14 @@ export class GQLClient {
|
|||||||
async rollbackDeployment(
|
async rollbackDeployment(
|
||||||
projectId: string,
|
projectId: string,
|
||||||
deploymentId: string,
|
deploymentId: string,
|
||||||
deployerId: string,
|
deployerLrn: string,
|
||||||
): Promise<types.RollbackDeploymentResponse> {
|
): Promise<types.RollbackDeploymentResponse> {
|
||||||
const { data } = await this.client.mutate({
|
const { data } = await this.client.mutate({
|
||||||
mutation: mutations.rollbackDeployment,
|
mutation: mutations.rollbackDeployment,
|
||||||
variables: {
|
variables: {
|
||||||
projectId,
|
projectId,
|
||||||
deploymentId,
|
deploymentId,
|
||||||
deployerId,
|
deployerLrn,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -95,8 +95,8 @@ export const deleteDomain = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const rollbackDeployment = gql`
|
export const rollbackDeployment = gql`
|
||||||
mutation ($projectId: String!, $deploymentId: String!) {
|
mutation ($projectId: String!, $deployerLrn: String!) {
|
||||||
rollbackDeployment(projectId: $projectId, deploymentId: $deploymentId)
|
rollbackDeployment(projectId: $projectId, deployerLrn: $deployerLrn)
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user