Skip to content
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

Aws cloudwatchlog event schema #8228

Merged

Conversation

thewizarodofoz
Copy link
Contributor

Closes: #8027

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2020

Codecov Report

Merging #8228 into master will decrease coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8228      +/-   ##
==========================================
- Coverage   88.16%   88.02%   -0.14%     
==========================================
  Files         248      248              
  Lines        9430     9312     -118     
==========================================
- Hits         8314     8197     -117     
+ Misses       1116     1115       -1     
Impacted Files Coverage Δ
.../aws/package/compile/events/cloudWatchLog/index.js 100.00% <ø> (ø)
lib/plugins/aws/provider/awsProvider.js 93.11% <ø> (ø)
...plugins/aws/package/compile/events/stream/index.js 98.00% <0.00%> (-0.60%) ⬇️
.../package/compile/events/websockets/lib/validate.js 97.22% <0.00%> (-0.51%) ⬇️
lib/plugins/aws/package/compile/functions/index.js 97.03% <0.00%> (-0.22%) ⬇️
lib/configSchema.js 100.00% <0.00%> (ø)
lib/utils/getCommandSuggestion.js 100.00% <0.00%> (ø)
lib/plugins/aws/invokeLocal/index.js 69.66% <0.00%> (ø)
lib/utils/getServerlessConfigFile.js 94.11% <0.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4af57a5...8eb7169. Read the comment docs.

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thewizarodofoz great thanks for that. It looks very good. I have just few minor remarks, also let's remove inline validation from event implementation

@@ -233,6 +233,10 @@ class AwsProvider {
UpdateReplacePolicy: { type: 'string' },
Condition: { type: 'string' },
},
awsLogGroup: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name it awsLogGroupName

@@ -233,6 +233,10 @@ class AwsProvider {
UpdateReplacePolicy: { type: 'string' },
Condition: { type: 'string' },
},
awsLogGroup: {
type: 'string',
pattern: '^/aws/[a-zA-Z0-9-_.]+$',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thewizarodofoz thanks for update. Please see my comment, also it'll be great to cleanup inline validation

@@ -233,6 +233,10 @@ class AwsProvider {
UpdateReplacePolicy: { type: 'string' },
Condition: { type: 'string' },
},
awsLogGroupName: {
type: 'string',
pattern: '[.-_/#A-Za-z0-9]+',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should either escape - or put it as last character, as otherwise it'll expand to range between . and _ chars.

Also regex should be enclosed into ^ and $, as otherwise we confirm that any part in strings matches and not string as a whole

@medikoo
Copy link
Contributor

medikoo commented Sep 21, 2020

@thewizarodofoz let me know if it's ready for re-review. We'd love to have that in!

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thewizarodofoz great thanks for update!

Please see my comment, additionally we also need to cleanup all related inline validation

@@ -233,6 +233,10 @@ class AwsProvider {
UpdateReplacePolicy: { type: 'string' },
Condition: { type: 'string' },
},
awsLogGroupName: {
type: 'string',
pattern: '^[a-zA-Z0-9-_.]+$',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @thewizarodofoz !

@medikoo medikoo merged commit 42676d3 into serverless:master Sep 22, 2020
@thewizarodofoz thewizarodofoz deleted the aws-cloudwatchlog-event-schema branch September 22, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config schema: Define AWS "cloudwatchLog" function event properties
3 participants