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(pacmak): fail on untranslated snippets #3127

Merged
merged 8 commits into from
Nov 8, 2021

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Nov 5, 2021

Because of backwards compatibility reasons, pacmak will try to live-translate
example code it encounters. However, this can add unpredictably to the compile
times, especially while we're making sure that rosetta and pacmak agree on API
locations for all snippets that are being translated (which are now part of the
snippet keys).

Add an option to pacmak to fail if any snippets are encountered that are not
pre-translated in any of the tablets. This most likely signifies an error.

This will be enabled in cdklabs/cdk-ops#1777.


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

Because of backwards compatibility reasons, pacmak will try to live-translate
example code it encounters. However, this can add unpredictably to the compile
times, especially while we're making sure that rosetta and pacmak agree on API
locations for all snippets that are being translated (which are now part of the
snippet keys).

Add an option to pacmak to fail if any snippets are encountered that are not
pre-translated in any of the tablets. This most likely signifies an error.

This will be enabled in cdklabs/cdk-ops#1777.
@rix0rrr rix0rrr requested a review from a team November 5, 2021 15:21
@rix0rrr rix0rrr self-assigned this Nov 5, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 5, 2021
@kaizencc kaizencc added the pr/do-not-merge This PR should not be merged at this time. label Nov 5, 2021
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Minor edits, and maybe an additional test necessary? There seems to be a failing test as well.

rosetta.translateSnippet(SAMPLE_CODE, TargetLanguage.PYTHON);
}).toThrow(/snippet was not found/);
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we test UnknownSnippetMode.VERBATIM as well?

packages/jsii-rosetta/lib/rosetta.ts Outdated Show resolved Hide resolved
packages/jsii-rosetta/lib/rosetta.ts Outdated Show resolved Hide resolved
rix0rrr and others added 4 commits November 5, 2021 20:32
Co-authored-by: kaizen3031593 <36202692+kaizen3031593@users.noreply.github.com>
Co-authored-by: kaizen3031593 <36202692+kaizen3031593@users.noreply.github.com>
@rix0rrr rix0rrr removed the pr/do-not-merge This PR should not be merged at this time. label Nov 5, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 5, 2021

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 Nov 5, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 5, 2021

Merging (with squash)...

@mergify
Copy link
Contributor

mergify bot commented Nov 8, 2021

Merging (with squash)...

@mergify
Copy link
Contributor

mergify bot commented Nov 8, 2021

Merging (with squash)...

@mergify mergify bot merged commit 874e8e2 into main Nov 8, 2021
@mergify mergify bot deleted the huijbers/pacmak-fail-untranslated branch November 8, 2021 11:02
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Nov 8, 2021
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.

2 participants