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

Switch url rewriter from js to typescipt #4

Merged
merged 2 commits into from
Feb 10, 2022

Conversation

peternied
Copy link

@peternied peternied commented Feb 7, 2022

I pulled in a new library @aws-cdk/aws-lambda-nodejs that handles the
transformation of javascript to typescript. Had to patch up a couple of
things which made this change a little more complex that intended.

  • All of the CDK components were not version locked, that meant
    depending on the order of npm installs they could drift and get into a
    dependancy mismatch spiral. The version itself isn't important, its
    uniformity is all that matters.

  • Added permissions to the lambda role for interacting with cloudfronts
    distribution system, these were handled by the lambda function during
    deployment, but it seems this new library while handling the js -> ts
    brought some limitations and I had to manually implement the permssions see
    for details https://tinyurl.com/5xy3n8zt

  • Needed to fix some typescript compliation issues, please feel free to re-work all of this and just keep the method signature

Signed-off-by: Peter Nied [email protected]

I pulled in a new library @aws-cdk/aws-lambda-nodejs that handles the
transformation of javascript to typescript.  Had to patch up a couple of
things which made this change a little more complex that intended.

- All of the CDK components were not version locked, that meant
  depending on the order of npm installs they could drift and get into a
dependancy mismatch spiral.  The version itself isn't important, its
uniformity is all that matters.

- Added permissions to the lambda role for interacting with cloudfronts
  distribution system, these were handled by the lambda function during
deployment, but it seems this new library while handling the js -> ts
brought some limitations and I had to manually implement the permssions see
for details https://tinyurl.com/5xy3n8zt

- Need to fix some typescript compliation issues, please feel free to
  re-work all of this and just keep the method signature

Signed-off-by: Peter Nied <[email protected]>
@peternied
Copy link
Author

This resolves opensearch-project#1569 (comment)


console.log('maxBuildNumber', maxBuildNumber);
} catch (ex) {
console.error(ex);
Copy link

Choose a reason for hiding this comment

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

We should fail hard on exception here which will cause s 500. Otherwise we will never know we had an error.

Copy link
Author

Choose a reason for hiding this comment

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

Needed to fix some typescript compliation issues, please feel free to re-work all of this and just keep the method signature

I agree with you recommendation.

For this PR I did the minimal amount of changes I could. The flow of this method still seems under development in the core PR and I'd rather continue the discussion on that review

@peternied
Copy link
Author

@tianleh I would recommend merging these PRs or implementing the changes you prefer in support-latest before doing additional work as you might run into merge conflicts.

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.

3 participants