-
Notifications
You must be signed in to change notification settings - Fork 245
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
Conversation
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.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
packages/jsii-diff/bin/jsii-diff.ts
Outdated
@@ -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> { |
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.
Would we accept the boolean as part of an options hash? Then you can just pass args as any
in...
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Sounds like the default should be no validation. What’s the use case for the validation? What are we protecting against?
That is fine by me too. I just didn't want to change the default behavior too much.
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 In practice, I think we're most likely to screw this up by mismatching jsii tool version against jsii assembly version. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.