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-lambda: Add SQS BatchItemFailures support #57488

Merged

Conversation

bboure
Copy link
Contributor

@bboure bboure commented Dec 1, 2021

Please fill in this template.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>

@typescript-bot typescript-bot added this to Needs Author Action in New Pull Request Status Board Dec 1, 2021
@bboure
Copy link
Contributor Author

bboure commented Dec 1, 2021

Experienced some issues with tests failing.

Found the reason

https://github.com/microsoft/DefinitelyTyped-tools/pull/361/files

cc: @sandersn

@sandersn
Copy link
Contributor

sandersn commented Dec 2, 2021

I broke CI tests this morning when I updated the @definitelytyped packages. It is fixed now, but you'll have to merge from master to get the tslint changes to make tests pass.

@bboure
Copy link
Contributor Author

bboure commented Dec 2, 2021

Still failing with

Could not find config file at: /home/runner/work/DefinitelyTyped/DefinitelyTyped/node_modules/@definitelytyped/dtslint/bin/dtslint.json

Any idea?

@sandersn
Copy link
Contributor

sandersn commented Dec 2, 2021

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.

@sandersn sandersn closed this Dec 2, 2021
@sandersn sandersn reopened this Dec 2, 2021
@@ -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 {

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.

Suggested change
export interface SQSEventResponse {
export interface SQSBatchResponse {

batchItemFailures: SQSBatchItemFailures[];
}

export interface SQSBatchItemFailures {

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

Suggested change
export interface SQSBatchItemFailures {
export interface SQSBatchItemFailure {

@bboure bboure marked this pull request as ready for review December 4, 2021 15:41
@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 4, 2021

@bboure Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because 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

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

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"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Author is Owner The author of this PR is a listed owner of the package. Check Config Changes a module config files labels Dec 4, 2021
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Dec 4, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Dec 4, 2021
@typescript-bot
Copy link
Contributor

@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?

Copy link

@maplesteve maplesteve left a comment

Choose a reason for hiding this comment

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

👍

@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Dec 4, 2021
@@ -1,6 +1,7 @@
{
"extends": "@definitelytyped/dtslint/dt.json",
"rules": {
"npm-naming": false
"npm-naming": false,
"void-return": false
Copy link
Contributor

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>;

Copy link
Contributor Author

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.

@typescript-bot typescript-bot removed Other Approved This PR was reviewed and signed-off by a community member. Check Config Changes a module config files labels Dec 6, 2021
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Code Reviews in New Pull Request Status Board Dec 6, 2021
@typescript-bot
Copy link
Contributor

@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?

Copy link
Contributor

@jamesorlakin jamesorlakin left a 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!

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Dec 6, 2021
@typescript-bot typescript-bot added the Self Merge This PR can now be self-merged by the PR author or an owner label Dec 6, 2021
@typescript-bot
Copy link
Contributor

@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:

Ready to merge

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.)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board Dec 6, 2021
@typescript-bot
Copy link
Contributor

@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?

@bboure
Copy link
Contributor Author

bboure commented Dec 6, 2021

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Dec 6, 2021
@typescript-bot typescript-bot merged commit c183617 into DefinitelyTyped:master Dec 6, 2021
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author is Owner The author of this PR is a listed owner of the package. Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants