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

Added requestId member on all CloudFrontEvent types #43696

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

nhodin
Copy link
Contributor

@nhodin nhodin commented Apr 7, 2020

The requestId member is defined on all origin/viewer requests/responses, it is described here : https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
There is one example for each request/response and they all have a cf.config.requestId.
Added new requests examples in tests in order to have all 4 types availabl

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

The requestId member is defined on all origin/viewer requests/responses, it is described here : https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
There is one example for each request/response and they all have a cf.config.requestId.
Added new requests examples in tests in order to have all 4 types available
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 7, 2020

@nhodin Thank you for submitting this PR!

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

🔔 @darbio @skarum @StefH @tobyhede @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 - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by a DT maintainer

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "pr_number": 43696,
  "author": "nhodin",
  "owners": [
    "darbio",
    "skarum",
    "StefH",
    "tobyhede",
    "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"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "6564ad3",
  "headCommitOid": "6564ad32b7a2e1a1eed06cb419b3cf26582bc970",
  "mergeIsRequested": true,
  "stalenessInDays": 1,
  "lastCommitDate": "2020-04-07T13:57:39.000Z",
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/43696/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Popular",
  "anyPackageIsNew": false,
  "packages": [
    "aws-lambda"
  ],
  "files": [
    {
      "filePath": "types/aws-lambda/common/cloudfront.d.ts",
      "kind": "definition",
      "package": "aws-lambda"
    },
    {
      "filePath": "types/aws-lambda/test/cloudfront-tests.ts",
      "kind": "test",
      "package": "aws-lambda"
    }
  ],
  "otherApprovalCount": 0,
  "ownerApprovalCount": 2,
  "maintainerApprovalCount": 0,
  "hasDismissedReview": false,
  "travisResult": "pass",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 2,
  "isChangesRequested": false
}

@typescript-bot typescript-bot added Where is Travis? Popular package This PR affects a popular package (as counted by NPM download counts). labels Apr 7, 2020
@typescript-bot typescript-bot added this to Waiting for Reviewers in Pull Request Status Board Apr 7, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 7, 2020

@nhodin Thank you for submitting this PR!

🔔 @darbio @skarum @StefH @tobyhede @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 - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot moved this from Other to Waiting for Code Reviews in New Pull Request Status Board Apr 7, 2020
@typescript-bot typescript-bot moved this from Other to Waiting for Code Reviews in New Pull Request Status Board Apr 7, 2020
Copy link
Contributor

@simonbuchan simonbuchan 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. I checked with the original PR that added them (#40355) to see the justification, and it specifically calls out the same documentation with "requestId is only available for viewer events", so it looks like either the docs were wrong or cloudfront has been updated since.

} & (
| { readonly eventType: 'origin-request' | 'origin-response' }
| { readonly eventType: 'viewer-request' | 'viewer-response'; readonly requestId: string });
readonly eventType: 'origin-request' | 'origin-response'|'viewer-request' | 'viewer-response';
Copy link
Contributor

Choose a reason for hiding this comment

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

completely trivial nit: spacing around the middle |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, sorry... I am able to fix this before the merge ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It may require me to re-approve, but that's no problem.

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Check and Merge in Pull Request Status Board Apr 7, 2020
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Merge:Express and removed Awaiting reviewer feedback labels Apr 7, 2020
@typescript-bot
Copy link
Contributor

@nhodin Everything looks good here. Great job! I am ready to merge this PR on your behalf.
If you'd like that to happen, please post a comment with the exact text

Ready to merge

and I'll merge it the next time I look at this PR.

@typescript-bot
Copy link
Contributor

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@typescript-bot
Copy link
Contributor

@nhodin Everything looks good here. Great job! I am ready to merge this PR on your behalf.
If you'd like that to happen, please post a comment with the exact text

Ready to merge

and I'll merge it the next time I look at this PR.

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board Apr 7, 2020
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board Apr 7, 2020
@typescript-bot typescript-bot added Where is Travis? and removed Owner Approved A listed owner of this package signed off on the pull request. labels Apr 7, 2020
@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Other in New Pull Request Status Board Apr 7, 2020
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. and removed Where is Travis? labels Apr 7, 2020
@typescript-bot
Copy link
Contributor

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

1 similar comment
@typescript-bot
Copy link
Contributor

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

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. and removed Owner Approved A listed owner of this package signed off on the pull request. labels Apr 7, 2020
Copy link
Contributor

@simonbuchan simonbuchan left a comment

Choose a reason for hiding this comment

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

Looks like the bot has changed a little, and you can merge it yourself now! It also looks like it's detected there's isn't another review necessary, but just in case.

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Apr 8, 2020
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board Apr 8, 2020
@nhodin
Copy link
Contributor Author

nhodin commented Apr 8, 2020

Looks like the bot has changed a little, and you can merge it yourself now! It also looks like it's detected there's isn't another review necessary, but just in case.

Thanks @simonbuchan ! But i don't find any Merge button in this page :( Is there another way to do it ?

@orta
Copy link
Collaborator

orta commented Apr 8, 2020

The bot is very new - and we're working out the copy and issues ATM. Can try following the directions in #43696 (comment) please @nhodin

@nhodin
Copy link
Contributor Author

nhodin commented Apr 8, 2020

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Apr 8, 2020
@typescript-bot typescript-bot merged commit c72d502 into DefinitelyTyped:master Apr 8, 2020
Pull Request Status Board automation moved this from Check and Merge to Done Apr 8, 2020
@nhodin
Copy link
Contributor Author

nhodin commented Apr 8, 2020

@orta thanks for your help, sorry that I didn't see that comment earlier..

@orta
Copy link
Collaborator

orta commented Apr 8, 2020

You're welcome - there's a lot of noise, but I think this is the first from "0 -> Self Merge" we've seen.

@RyanCavanaugh
Copy link
Member

🎉

@typescript-bot
Copy link
Contributor

I just published @types/aws-lambda@8.10.48 to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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).
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants