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

Updating waiters to use jmespath from io.burt #87

Merged
merged 1 commit into from
Jul 28, 2017
Merged

Conversation

spfink
Copy link
Contributor

@spfink spfink commented Jul 26, 2017

While we still want to refactor waiters, this changes allows us to continue to use waiters in our tests and libraries while allowing us to no longer require python or the jmespath-java module that we maintained.

<groupId>software.amazon.awssdk</groupId>
<groupId>io.burt</groupId>
<artifactId>jmespath-jackson</artifactId>
<version>0.2.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

needed?

@@ -81,51 +78,20 @@
return javaWaiterModels;
}

private JmesPathExpression getAstFromArgument(String argument, Map<String, JmesPathExpression> argumentToAstMap)
private Expression<JsonNode> getAstFromArgument(String argument, Map<String, Expression<JsonNode>> argumentToAstMap)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even need this at all in the code gen anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, actually we do not. Updated this first but then didn't end up needing it.

return ast.accept(new JmesPathCodeGenVisitor(), null);
}
return null;
public Expression<JsonNode> getAst() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is used anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, will remove

StringJoiner formatted = new StringJoiner(".");

for (String format : unformatted) {
formatted.add(StringUtils.uncapitalize(format));
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this handle the case we talked about where DBInstance should be capitalized to dbinstance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We fixed this in v2 with better and more consistent model naming. dbInstance in v2 vs dBInstance in v1

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok I was trying to wrap my head around how the heck this was even working then saw this, https://github.com/aws/aws-sdk-java-v2/blob/master/jmespath-java/src/main/java/software/amazon/awssdk/jmespath/ObjectMapperSingleton.java#L28

@@ -83,9 +83,6 @@ public void setup() {
@After
public void tearDown() {
cf.deleteStack(DeleteStackRequest.builder().stackName(stackName).build());
cf.waiters()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is on the teardown method so don't think that we really need to wait for it to get deleted as long as the original request is received.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay gotcha, I know for Dynamo there is a concurrent modification limit so it certain cases we do want to wait. But if the tests are consistently passing without this then I'd say leave if off.

@spfink spfink merged commit a5b0464 into master Jul 28, 2017
@spfink spfink deleted the finks/remove-waiters branch August 23, 2017 21:52
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.

None yet

3 participants