-
Notifications
You must be signed in to change notification settings - Fork 1.1k
make smoke tests Java 8 compatible #3187
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
Conversation
| ); | ||
|
|
||
| write(""" | ||
| file(GLOB AWS_$L_GENERATED_SMOKE_TEST_SRC |
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.
Multi line strings not supported on Java 8. Hence needed refactoring
| if (services.size != 1) { | ||
| throw Exception("There must be exactly one service in each aws model file, but found " + | ||
| "${services.size} in ${file.name}: ${services.map { it.id }}"); | ||
| println("Unexpected number of service shapes detected: ${services.size} while processing file: ${file.name}. ") |
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.
deliberately not throwing exception to allow other services to move on
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.
we should catch and throw issues when we find them, and leave them up to the caller, i.e. the CI script to ignore. for instance here, why are there more than 1 service shape? what is wrong with the smithy files that allows this to be the case?
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.
yes, but it affects all the other services that don't have issue. I can still throw it but it is going to show incomplete builds in pipeline if even one service has an issue
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 doesn't have anything to do with the pipeline, or CI at all, at pure level, if the code generator fails, it should bubble up the error to the caller, and the caller is responsible for handling it. in this case the CI pipeline.
for instance here, why are there more than 1 service shape? what is wrong with the smithy files that allows this to be the case?
you didnt answer this question -- why do we need this and is this a data problem. what services cause this problem and why.
.../main/java/com/amazonaws/util/awsclientsmithygenerator/generators/SmithyC2JNamespaceMap.java
Show resolved
Hide resolved
| "aws/testing/AwsCppSdkGTestSuite.h", | ||
| "aws/testing/AwsTestHelpers.h" | ||
| ); | ||
| this.unitTestHeaders = new HashSet<>(); |
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 use guavas ImmubtableSet.of and add the guava dep if needed, would be nice but not required
|
|
||
| dynamicHeaders.add(String.format("aws/%s/%sClient.h", c2jNamespace, clientNamespace)); | ||
| //this will be added to based upon datastructures found | ||
| containerHeaderMap = new HashMap<>(); |
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.
Similar as above should use guavas 'ImmutableMap.of' and add the dep
|
|
||
| package com.amazonaws.util.awsclientsmithygenerator.generators; | ||
|
|
||
| import lombok.val; |
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.
Dont use Lombok val, spell out the complete type
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.
ok, that was IDE suggestion. will change
.../main/java/com/amazonaws/util/awsclientsmithygenerator/generators/SmithyC2JNamespaceMap.java
Show resolved
Hide resolved
| if (services.size != 1) { | ||
| throw Exception("There must be exactly one service in each aws model file, but found " + | ||
| "${services.size} in ${file.name}: ${services.map { it.id }}"); | ||
| println("Unexpected number of service shapes detected: ${services.size} while processing file: ${file.name}. ") |
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.
we should catch and throw issues when we find them, and leave them up to the caller, i.e. the CI script to ignore. for instance here, why are there more than 1 service shape? what is wrong with the smithy files that allows this to be the case?
Issue #, if available:
*Description of changes:
Previous iteration of changes are based on Java 16 which is not compatible with cdk. Hence, this change is necessary.
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.