-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
const instance = | ||
getRawData<privateca_v1.Schema$CertificateAuthority>(caAuthorityEntity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
const instance = | |
getRawData<privateca_v1.Schema$CertificateAuthority>(caAuthorityEntity); | |
const caAuthority = | |
getRawData<privateca_v1.Schema$CertificateAuthority>(caAuthorityEntity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It typically makes sense to put this step inside fetchAuthorityCertificates.ts
, since the relationship is built off of that entity.
import { PrivatecaSteps } from '../constants'; | ||
|
||
describe(`privateca#${PrivatecaSteps.STEP_PRIVATE_CA_CERTIFICATES.id}`, () => { | ||
let recording: Recording; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tip: this suggestion will prevent you from ever forgetting the condition in front of if (recording) await recording.stop()
let recording: Recording; | |
let recording: Recording | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Just left some minor comments on possible logging.
); | ||
|
||
if (!caPoolEntity || !caAuthorityEntity) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we maybe log something here?
const bucketName = instance.gcsBucket; | ||
|
||
if (!bucketName) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem
getCloudStorageBucketKey(bucketName), | ||
); | ||
if (!storageBucketEntity) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem
logger.warn( | ||
`${PrivatecaSteps.STEP_PRIVATE_CA_POOLS.id} - Found undefined caPool entity in iterateCaPools.`, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something you've encountered? How is the API returning an array that contains undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was just for safe purposes but you are right it does not make much sense
if (!bucketName) { | ||
logger.warn( | ||
`${PrivatecaSteps.STEP_CREATE_PRIVATE_CA_CERTIFICATE_AUTHORITY_BUCKET_RELATIONSHIPS.id} - Missing bucketName.`, | ||
); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious - is gcsBucket
a required property here? Is it true that if we do not find it, something has gone wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!bucketName) { | |
logger.warn( | |
`${PrivatecaSteps.STEP_CREATE_PRIVATE_CA_CERTIFICATE_AUTHORITY_BUCKET_RELATIONSHIPS.id} - Missing bucketName.`, | |
); | |
return; | |
} | |
if (!bucketName) { | |
return; | |
} |
|
||
const result = await executeStepWithDependencies(stepTestConfig); | ||
expect(result).toMatchStepMetadata(stepTestConfig); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip: instead of separately setting jest.setTimeout(45_000)
, you can add the timeout as the third positional argument to test()
:
}); | |
}, 45_000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🚀 PR was released in |
The issue is that we’re using privateca API version v1beta1, which is deprecated. We need to instead use v1, which is supported.
as a result, we need to also add the caPool resource, which should be a parent of google_certificate_authority.
This also includes: