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

fix(jsii-diff): detect interfaces inherited via interfaces #1492

Merged
merged 3 commits into from
Apr 7, 2020

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Apr 7, 2020

jsii-diff is currently throwing on CDK because it thinks interfaces
are being removed from the inheritance chain, even if they've actually
been moved to base classes.

This is because the ClassType.getInterfaces() method of jsii-reflect
was only returning its direct interfaces, even when run with
inherited=true (as opposed to recursively returning the interfaces
all the way up the tree).

Q: Why did you not add a unit test in jsii-reflect?

A: The set suite of jsii-reflect is quite anemic, and basically only
tests that we can mostly deduce the types that are present in an
assembly. It doesn't have good testing infrastructure for actually
asserting things about arbitrary small pieces of typescript, instead it
mostly works on the generated assemblies from the jsii-calc etc.
examples. jsii-diff does have that testing infrastructure, and so
jsii-diff serves as the test suite for jsii-reflect at the moment...


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

@rix0rrr rix0rrr requested review from RomainMuller, MrArnoldPalmer and a team April 7, 2020 09:04
@rix0rrr rix0rrr self-assigned this Apr 7, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 7, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 9d3bec3
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 80b7236
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

rix0rrr added 2 commits April 7, 2020 12:09
`jsii-diff` is currently throwing on CDK because it thinks interfaces
are being removed from the inheritance chain, even if they've actually
been moved to base classes.

This is because the `ClassType.getInterfaces()` method of `jsii-reflect`
was only returning its direct interfaces, even when run with
`inherited=true` (as opposed to recursively returning the interfaces
all the way up the tree).

Q: Why did you not add a unit test in `jsii-reflect`?

A: The set suite of `jsii-reflect` is quite anemic, and basically only
tests that we can mostly deduce the types that are present in an
assembly. It doesn't have good testing infrastructure for actually
asserting things about arbitrary small pieces of typescript, instead it
mostly works on the generated assemblies from the `jsii-calc` etc.
examples. `jsii-diff` *does* have that testing infrastructure, and so
`jsii-diff` serves as the test suite for `jsii-reflect` at the moment...
@MrArnoldPalmer MrArnoldPalmer force-pushed the huijbers/fix-inherited-interface-lookup branch from 80b7236 to ac6ddc7 Compare April 7, 2020 19:09
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: ac6ddc7
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 201ab41
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@MrArnoldPalmer MrArnoldPalmer merged commit e03a638 into master Apr 7, 2020
@MrArnoldPalmer MrArnoldPalmer deleted the huijbers/fix-inherited-interface-lookup branch April 7, 2020 21:39
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.

4 participants