Skip to content

feat(synthetics): add Python runtime and latest Nodejs runtime#16069

Merged
mergify[bot] merged 13 commits intoaws:masterfrom
kaizencc:syn-runtime-2
Aug 27, 2021
Merged

feat(synthetics): add Python runtime and latest Nodejs runtime#16069
mergify[bot] merged 13 commits intoaws:masterfrom
kaizencc:syn-runtime-2

Conversation

@kaizencc
Copy link
Copy Markdown
Contributor

@kaizencc kaizencc commented Aug 16, 2021

This PR addresses the fact that the current synthetics module was built to support nodejs runtimes only by opening support for python runtimes. Closes #15138 and #16177.

Breaking Changes

  • Runtime('customRuntimeHere') becomes Runtime('customRuntime', 'runtimeFamily')
  • Code.fromAnything('path').bind(this, 'handler') becomes Code.fromAnything('path').bind(this, 'handler', 'runtimeFamily')

Whats in this PR?

  • Adds latest Nodejs runtime (syn-nodejs-puppeteer-3.2) and updates integ test to it.
  • Adds generic python script to the folder test/canaries/python in order to run unit & integration tests on it.
  • Adds new RuntimeFamily enum that is required by the Runtime object to differentiate between Python and Node.
  • Verifies the correct folder structure for Python runtimes (python/<filename>.py).
  • Updates readme.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@kaizencc kaizencc requested a review from BenChaimberg August 16, 2021 17:08
@kaizencc kaizencc self-assigned this Aug 16, 2021
@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Aug 16, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 16, 2021
@kaizencc kaizencc marked this pull request as ready for review August 17, 2021 18:14
@kaizencc kaizencc changed the title feat(synthetics): add Python runtime feat(synthetics): add Python runtime and latest Nodejs runtime Aug 23, 2021
/**
* All known Lambda runtime families.
*/
export enum RuntimeFamily {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's also make this a class with static properties. as it stands, customers could not unblock themselves to add a new runtime if the runtime used a family we did not support

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

+1 for the end goal of customers unblocking themselves. I think that what makes the most sense is to keep this as an enum and add an OTHER property. Updated the code to reflect this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if I'm a huge fan of adding a property that currently doesn't have any meaning. It feels to me that the class with static properties is usually how we deal with this, but I also understand that the actual value that would be supplied to the constructor of that class wouldn't actually be used there. Your choice!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does it help that the lambda module does this similarly?

export enum RuntimeFamily {
NODEJS,
JAVA,
PYTHON,
DOTNET_CORE,
GO,
RUBY,
OTHER
}

I feel like it is odd to have to specify a new RuntimeFamily('java') when the Runtime Family doesn't really hold any meaning in cloudformation, it is just used to check for errors (at the moment). I feel like users will have a hard time knowing what to put for the new runtime family since they could literally write anything. There would be no difference in new RuntimeFamily('java') and new RuntimeFamily('ruby').

It seems cleaner to just have users specify a RuntimeFamily.OTHER in this case. It is basically a flag telling the user that they lose all CDK error checking functionality.

@kaizencc kaizencc requested a review from BenChaimberg August 26, 2021 19:58
Copy link
Copy Markdown
Contributor

@BenChaimberg BenChaimberg left a comment

Choose a reason for hiding this comment

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

See comments on previous review

@kaizencc
Copy link
Copy Markdown
Contributor Author

Should be gtg unless you feel strongly about the RuntimeFamily enum vs class decision.

@kaizencc kaizencc requested a review from BenChaimberg August 27, 2021 14:46
@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 48e176e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit de218ba into aws:master Aug 27, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 27, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Sep 6, 2021
…6069)

This PR addresses the fact that the current synthetics module was built to support nodejs runtimes only by opening support for python runtimes. Closes aws#15138 and aws#16177. 

**Breaking Changes**

-  `Runtime('customRuntimeHere')` becomes `Runtime('customRuntime', 'runtimeFamily')`
-  `Code.fromAnything('path').bind(this, 'handler')` becomes `Code.fromAnything('path').bind(this, 'handler', 'runtimeFamily')`

**Whats in this PR?**

- Adds latest Nodejs runtime (`syn-nodejs-puppeteer-3.2`) and updates integ test to it.
- Adds generic python script to the folder `test/canaries/python` in order to run unit & integration tests on it.
- Adds new `RuntimeFamily` enum that is required by the `Runtime` object to differentiate between Python and Node.
- Verifies the correct folder structure for Python runtimes (`python/<filename>.py`).
- Updates readme.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
david-doyle-as24 pushed a commit to david-doyle-as24/aws-cdk that referenced this pull request Sep 7, 2021
…6069)

This PR addresses the fact that the current synthetics module was built to support nodejs runtimes only by opening support for python runtimes. Closes aws#15138 and aws#16177. 

**Breaking Changes**

-  `Runtime('customRuntimeHere')` becomes `Runtime('customRuntime', 'runtimeFamily')`
-  `Code.fromAnything('path').bind(this, 'handler')` becomes `Code.fromAnything('path').bind(this, 'handler', 'runtimeFamily')`

**Whats in this PR?**

- Adds latest Nodejs runtime (`syn-nodejs-puppeteer-3.2`) and updates integ test to it.
- Adds generic python script to the folder `test/canaries/python` in order to run unit & integration tests on it.
- Adds new `RuntimeFamily` enum that is required by the `Runtime` object to differentiate between Python and Node.
- Verifies the correct folder structure for Python runtimes (`python/<filename>.py`).
- Updates readme.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@kaizencc kaizencc deleted the syn-runtime-2 branch September 9, 2021 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(synthetics): add Runtime property for syn-python-selenium-1.0 to create synthetics canary

3 participants