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

feat(jsii-diff): make assembly validation optional #926

Merged
merged 3 commits into from
Nov 5, 2019

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Oct 31, 2019

Assembly validation is taking the majority of the time of doing the
API compatibility check, and the assemblies are almost guaranteed to
be correct.

Make it possible to skip the check for performance purposes.

Fixes #


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

Assembly validation is taking the majority of the time of doing the
API compatibility check, and the assemblies are almost guaranteed to
be correct.

Make it possible to skip the check for performance purposes.
@rix0rrr rix0rrr requested review from RomainMuller and eladb October 31, 2019 16:33
@rix0rrr rix0rrr requested a review from a team as a code owner October 31, 2019 16:33
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@@ -87,24 +88,24 @@ const NPM_REGEX = /^npm:(\/\/)?/;
*
* Supports downloading from NPM as well as from file or directory.
*/
async function loadAssembly(requested: string): Promise<LoadAssemblyResult> {
async function loadAssembly(requested: string, validate: boolean): Promise<LoadAssemblyResult> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we accept the boolean as part of an options hash? Then you can just pass args as any in...

@rix0rrr rix0rrr requested a review from RomainMuller November 4, 2019 12:22
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

eladb
eladb previously requested changes Nov 4, 2019
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Sounds like the default should be no validation. What’s the use case for the validation? What are we protecting against?

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Nov 4, 2019

Sounds like the default should be no validation.

That is fine by me too. I just didn't want to change the default behavior too much.

What’s the use case for the validation? What are we protecting against?

At the edges of our system we should always validate user input before trying to operate on it. An arbitrary assembly file is user input, and I'd rather see Not a valid assembly file because ... than Cannot read property 'fqn' of 'undefined'.

In practice, I think we're most likely to screw this up by mismatching jsii tool version against jsii assembly version.

@rix0rrr rix0rrr requested a review from eladb November 4, 2019 12:50
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@rix0rrr rix0rrr dismissed stale reviews from eladb and RomainMuller November 4, 2019 16:40

Stale

@rix0rrr rix0rrr merged commit e2c80f0 into master Nov 5, 2019
@rix0rrr rix0rrr deleted the huijbers/optional-validate branch November 5, 2019 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants