-
Notifications
You must be signed in to change notification settings - Fork 89
feat: add metrics metadata for auth mode and custom operations #2966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| const template = Template.fromStack(stack); | ||
| expect(JSON.parse(template.toJSON().Description).metadata).toMatchInlineSnapshot(` | ||
| Object { | ||
| "authorizationModes": "api_key,aws_iam,aws_lambda", |
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 asserts order as well as content -- is that intentional?
| apiKeyConfig: 'api_key', | ||
| lambdaConfig: 'aws_lambda', | ||
| }; | ||
| const authModes = Object.keys(authorizationModes) |
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.
One of the tests above asserts the order of the auth mode metric. Is that intentional? Should we sort the values here so we can provide a stable value irrespective of the order in which they are declared?
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.
Good idea, I will apply a sort.
|
|
||
| export const getMetadataCustomOperations = (definition: IAmplifyGraphqlDefinition): string => { | ||
| const customOperations: string[] = []; | ||
| if (definition.schema.includes('type Query')) { |
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.
Why not subscriptions?
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.
Wasn't in the product requirements, but we should probably just add it.
|
As far as I can tell this is a typo in the PR description, but calling it out in case: |
|
Yes, typo in the description. We can see |
Description of changes
Add additional metrics metadata for
authorizationModeandcustomOperations. The metric data is stored in the CFN stack description.CDK / CloudFormation Parameters Changed
The metrics are stored in the CFN description. No real functional change, but the descriptions will be updated.
Issue #, if available
N/A
Description of how you validated changes
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.