Skip to content

Conversation

@sbera87
Copy link
Contributor

@sbera87 sbera87 commented Nov 12, 2024

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:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

);

write("""
file(GLOB AWS_$L_GENERATED_SMOKE_TEST_SRC
Copy link
Contributor Author

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}. ")
Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

"aws/testing/AwsCppSdkGTestSuite.h",
"aws/testing/AwsTestHelpers.h"
);
this.unitTestHeaders = new HashSet<>();
Copy link
Contributor

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<>();
Copy link
Contributor

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;
Copy link
Contributor

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

Copy link
Contributor Author

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

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}. ")
Copy link
Contributor

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?

@sbera87 sbera87 requested a review from sbiscigl November 13, 2024 15:26
@sbera87 sbera87 merged commit 26e0555 into main Nov 13, 2024
5 checks passed
@sbera87 sbera87 deleted the smoke_fix branch January 24, 2025 17:07
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