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(pacmak): generated dependencies are not consistent with source npm module #1141

Merged
merged 8 commits into from
Dec 27, 2019

Conversation

RomainMuller
Copy link
Contributor

The dependency statements generated in the Java, .NET and Python
packages generated by jsii-pacmak were not reflecting the dependency
statement modeled on the source package. In certain pathological cases,
such as Python, the dependency declaration was often more permissive
than what the source package allowed, resulting in surprising behavior
as well as difficult to troubleshoot problems.

This updates several elements involved in this problem:

  1. The jsii compiler no longer carries version information for
    transitive dependencies of the assembly in the dependencyClosure
    property, and instead only carries the targets configuration for
    those.
  2. The version statements in the dependencies section of the .jsii
    file no longer contains the "compile-time resolved" version number,
    but the actual SemVer expression declared in the package's source.
    Also, the targets object was dropped (only the SemVer range
    statement remains), as this incurred needless duplication of the
    target configuration (in dependencies and dependencyClosure).
  3. jsii-pacmak renders the declared SemVer range in the relevant form
    for the target being generated.

Fixes #676
Related to #1137


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

The dependency statements generated in the Java, .NET and Python
packages generated by `jsii-pacmak` were not reflecting the dependency
statement modeled on the source package. In certain pathological cases,
such as Python, the dependency declaration was often more permissive
than what the source package allowed, resulting in surprising behavior
as well as difficult to troubleshoot problems.

This updates several elements involved in this problem:
1. The `jsii` compiler no longer carries version information for
  transitive dependencies of the assembly in the `dependencyClosure`
  property, and instead only carries the `targets` configuration for
  those.
2. The version statements in the `dependencies` section of the `.jsii`
  file no longer contains the "compile-time resolved" version number,
  but the actual SemVer expression declared in the package's source.
  Also, the `targets` object was dropped (only the SemVer range
  statement remains), as this incurred needless duplication of the
  target configuration (in `dependencies` and `dependencyClosure`).
3. `jsii-pacmak` renders the declared SemVer range in the relevant form
  for the target being generated.

Fixes #676
Related to #1137
@RomainMuller RomainMuller requested review from MrArnoldPalmer and a team as code owners December 19, 2019 08:20
@RomainMuller RomainMuller changed the title fix(pacmak): generated dependencies are arbitrary fix(pacmak): generated dependencies are not consistent with source npm module Dec 19, 2019
@RomainMuller RomainMuller removed the request for review from MrArnoldPalmer December 19, 2019 08:20
@RomainMuller RomainMuller self-assigned this Dec 19, 2019
@RomainMuller RomainMuller added module/pacmak Issues affecting the `jsii-pacmak` module effort/medium Medium work item – a couple days of effort labels Dec 19, 2019
@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

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

All the ?. and !.s make my eyes bleed.

packages/@jsii/spec/lib/assembly.ts Show resolved Hide resolved
packages/jsii-pacmak/lib/targets/java.ts Outdated Show resolved Hide resolved
packages/jsii/lib/assembler.ts Show resolved Hide resolved
packages/jsii/lib/assembler.ts Show resolved Hide resolved
packages/jsii-pacmak/lib/targets/python.ts Outdated Show resolved Hide resolved
packages/jsii-pacmak/lib/targets/python.ts Outdated Show resolved Hide resolved
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • 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

  • 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

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

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

@RomainMuller RomainMuller requested a review from rix0rrr December 27, 2019 10:19
@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

@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

@mergify
Copy link
Contributor

mergify bot commented Dec 27, 2019

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Dec 27, 2019
@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

@mergify mergify bot merged commit 03221fe into master Dec 27, 2019
@mergify mergify bot deleted the rmuller/version-handling branch December 27, 2019 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – a couple days of effort module/pacmak Issues affecting the `jsii-pacmak` module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python dependency versions not handled correctly
3 participants