-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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-lambda: Add SQS BatchItemFailures support #57488
aws-lambda: Add SQS BatchItemFailures support #57488
Conversation
Experienced some issues with tests failing. Found the reason https://github.com/microsoft/DefinitelyTyped-tools/pull/361/files cc: @sandersn |
I broke CI tests this morning when I updated the |
Still failing with
Any idea? |
There was another bug for packages with dependents: microsoft/DefinitelyTyped-tools#362. That's fixed now, so I'll re-run the tests by closing/re-opening the PR. |
types/aws-lambda/trigger/sqs.d.ts
Outdated
@@ -44,3 +44,12 @@ export interface SQSMessageAttribute { | |||
export interface SQSMessageAttributes { | |||
[name: string]: SQSMessageAttribute; | |||
} | |||
|
|||
// https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting | |||
export interface SQSEventResponse { |
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 is a response dedicated for batches. so I would suggest to make this clear in the naming. SQSBatchResponse
is used by the aws-sdk.
export interface SQSEventResponse { | |
export interface SQSBatchResponse { |
types/aws-lambda/trigger/sqs.d.ts
Outdated
batchItemFailures: SQSBatchItemFailures[]; | ||
} | ||
|
||
export interface SQSBatchItemFailures { |
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 interface describes only one failure
export interface SQSBatchItemFailures { | |
export interface SQSBatchItemFailure { |
Fix Fix tests Fix
6df638f
to
f41426a
Compare
@bboure Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 57488,
"author": "bboure",
"headCommitOid": "a6fb5538015d298e0c99ad35a4c4212d901bd614",
"lastPushDate": "2021-12-06T11:42:41.000Z",
"lastActivityDate": "2021-12-06T12:10:51.000Z",
"mergeOfferDate": "2021-12-06T12:03:03.000Z",
"mergeRequestDate": "2021-12-06T12:10:51.000Z",
"mergeRequestUser": "bboure",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "aws-lambda",
"kind": "edit",
"files": [
{
"path": "types/aws-lambda/test/sqs-tests.ts",
"kind": "test"
},
{
"path": "types/aws-lambda/trigger/sqs.d.ts",
"kind": "definition"
}
],
"owners": [
"darbio",
"skarum",
"StefH",
"buggy",
"y13i",
"wwwy3y3",
"OrthoDex",
"MichaelMarner",
"daniel-cottone",
"kostya-misura",
"coderbyheart",
"palmithor",
"daniloraisi",
"simonbuchan",
"Haydabase",
"repl-chris",
"aneilbaboo",
"jeznag",
"louislarry",
"dpapukchiev",
"ohookins",
"trevor-leach",
"jagregory",
"dalen",
"loikg",
"skyzenr",
"redlickigrzegorz",
"juancarbonel",
"pwmcintyre",
"alex-bolenok-centralreach",
"marianzange",
"apepper",
"apalumbo",
"SachinShekhar",
"ivanmartos",
"zach-anthony",
"savnik",
"svenmilewski",
"bboure",
"jamesorlakin"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "jamesorlakin",
"date": "2021-12-06T12:02:26.000Z",
"isMaintainer": false
},
{
"type": "stale",
"reviewer": "maplesteve",
"date": "2021-12-04T16:41:00.000Z",
"abbrOid": "f41426a"
}
],
"mainBotCommentID": 986047288,
"ciResult": "pass"
} |
🔔 @darbio @skarum @StefH @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag @louislarry @dpapukchiev @ohookins @trevor-leach @jagregory @dalen @loikg @skyzenr @redlickigrzegorz @juancarbonel @pwmcintyre @alex-bolenok-centralreach @marianzange @apepper @apalumbo @SachinShekhar @ivanmartos @zach-anthony @savnik @svenmilewski @jamesorlakin — please review this PR in the next few days. Be sure to explicitly select |
@maplesteve Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
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.
👍
types/aws-lambda/tslint.json
Outdated
@@ -1,6 +1,7 @@ | |||
{ | |||
"extends": "@definitelytyped/dtslint/dt.json", | |||
"rules": { | |||
"npm-naming": false | |||
"npm-naming": false, | |||
"void-return": false |
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.
DefinitelyTyped suggests not to add any special blanket rules for packages. I agree that the rule shouldn't be triggering for our usecase as the suggested undefined
replacement does not work when I tried locally.
With that in mind I think disabling it just as a one-off is probably the more sanctioned approach:
// tslint:disable-next-line:void-return
export type SQSHandler = Handler<SQSEvent, SQSBatchResponse | void>;
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.
Yeah, sounds good to me.
@jamesorlakin, @maplesteve Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
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.
Looks good to me, thanks for adding!
@bboure: Everything looks good here. I am ready to merge this PR (at a6fb553) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@darbio, @skarum, @StefH, @buggy, @y13i, @wwwy3y3, @OrthoDex, @MichaelMarner, @daniel-cottone, @kostya-misura, @coderbyheart, @palmithor, @daniloraisi, @simonbuchan, @Haydabase, @repl-chris, @aneilbaboo, @jeznag, @louislarry, @dpapukchiev, @ohookins, @trevor-leach, @jagregory, @dalen, @loikg, @skyzenr, @redlickigrzegorz, @juancarbonel, @pwmcintyre, @alex-bolenok-centralreach, @marianzange, @apepper, @apalumbo, @SachinShekhar, @ivanmartos, @zach-anthony, @savnik, @svenmilewski, @jamesorlakin: you can do this too.) |
@maplesteve Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
Ready to merge |
Please fill in this template.
npm test <package to test>
.If changing an existing definition: