-
Notifications
You must be signed in to change notification settings - Fork 803
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
Extracting existing JMESPath runtime to a separate class #5155
Extracting existing JMESPath runtime to a separate class #5155
Conversation
…used by waiters and other components
Quality Gate failedFailed conditions |
@@ -104,7 +104,8 @@ private static void configurePackageName(Metadata metadata, | |||
.withPaginatorsPackageName(namingStrategy.getPaginatorsPackageName(service)) | |||
.withWaitersPackageName(namingStrategy.getWaitersPackageName(service)) | |||
.withEndpointRulesPackageName(namingStrategy.getEndpointRulesPackageName(service)) | |||
.withAuthSchemePackageName(namingStrategy.getAuthSchemePackageName(service)); | |||
.withAuthSchemePackageName(namingStrategy.getAuthSchemePackageName(service)) | |||
.withJPathPackageName(namingStrategy.getJPathPackageName(service)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the full name JmesPath
to be more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explicitly avoided JmesPath since there has been a lot of discussion around minified versions, not calling that subset JmesPath etc. However, after working with the implementation in Java SDK that distinction has faded - I think the subset will be handled at a model level instead. So if consensus is JmesPath I'm fine with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
import software.amazon.awssdk.utils.IoUtils; | ||
|
||
public final class JPathRuntimeGeneratorTask extends BaseGeneratorTasks { | ||
public static final String RUNTIME_CLASS_NAME = "JPathRuntime"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, JmesPathRuntime?
import software.amazon.awssdk.utils.ToString; | ||
|
||
@SdkInternalApi | ||
public final class JPathRuntime { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any changes between JmesPathRuntime and WaitersRuntime? If so, could you show me the diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there are no changes in this PR
@@ -57,6 +59,9 @@ protected List<GeneratorTask> createTasks() throws Exception { | |||
tasks.add(generateDefaultProvider()); | |||
tasks.add(new RulesEngineRuntimeGeneratorTask(generatorTaskParams)); | |||
} | |||
if (shouldGenerateJPathRuntime()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the demerits of always loading the JMESPathRuntime class? Additionally, for waiters, what if we create a class that extends JMESPathRuntime and adds methods only specific to waiters?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The demerits of always loading JMESPathRuntime is that there are almost 400 services but only 80 of them use waiters.
I don't think the approach of adding methods that are only used in waiters is worth it, because it's just a few hundred lines. It's better to keep the language intact and it will be hard to keep track of different subsets used for different purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
0323b8f
into
feature/StringArrayEndpointParams
* feat(StringArrayEndpointParams) Codegen String Array Enpoint params and Auth schemes params based on end-point-rule-set.json. (#5122) * Support Customization string array endpoint params for S3 access grants, until all SDKs add support for string array. (#5137) * new(StringArrayEndpointParams) Codegeneration of OperationContextParams defined for a Operation. (#5146) * Extracting existing JMESPath runtime to a separate class (#5155) * new(StringArrayEndpointParams) Customization of Operation Context params and adding customizations for S3 (#5159) * Converts endpoint param list of string to list of value (#5169) * Generates JmesPath expressions for operation context parameters (#5172) * Supporting wildcard and keys fn in JmesPathRuntime (#5198) * Adds functional tests for list of string auth params (#5216) * Changelog --------- Co-authored-by: John Viegas <70235430+joviegas@users.noreply.github.com> Co-authored-by: John Viegas <joviegas@amazon.com>
* feat(StringArrayEndpointParams) Codegen String Array Enpoint params and Auth schemes params based on end-point-rule-set.json. (aws#5122) * Support Customization string array endpoint params for S3 access grants, until all SDKs add support for string array. (aws#5137) * new(StringArrayEndpointParams) Codegeneration of OperationContextParams defined for a Operation. (aws#5146) * Extracting existing JMESPath runtime to a separate class (aws#5155) * new(StringArrayEndpointParams) Customization of Operation Context params and adding customizations for S3 (aws#5159) * Converts endpoint param list of string to list of value (aws#5169) * Generates JmesPath expressions for operation context parameters (aws#5172) * Supporting wildcard and keys fn in JmesPathRuntime (aws#5198) * Adds functional tests for list of string auth params (aws#5216) * Changelog --------- Co-authored-by: John Viegas <70235430+joviegas@users.noreply.github.com> Co-authored-by: John Viegas <joviegas@amazon.com>
that can be used by waiters and other components
Motivation and Context
The new operation context params for auth and endpoint params require the usage of a subset of JMESPath in order to specify a value or set of values in the request.
We already have a JMESPath parser at the codegen level, and a Java class that represents a JMESPath expression in the
WaitersRuntime.java
class that's copied to services during codegen. This PR extracts that into a separate runtime.Modifications
WaitersRuntime.java
customization.config
contains an eligible endpoint parameter (part of this feature in previous PR)Considerations