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

chore(aft): Use public models #3727

Merged
merged 3 commits into from
Sep 13, 2023
Merged

chore(aft): Use public models #3727

merged 3 commits into from
Sep 13, 2023

Conversation

dnys1
Copy link
Contributor

@dnys1 dnys1 commented Sep 11, 2023

Migrates the generate sdk command to use the public aws-sdk-js-v3 repo for service models instead of the private repo.

Fixes some minor codegen issues and regenerates SDK (thus the large PR)

@dnys1 dnys1 force-pushed the chore/aft/use-public-models branch 4 times, most recently from d4b7942 to e9513c9 Compare September 12, 2023 15:28
Dillon Nys added 2 commits September 12, 2023 13:38
Migrates the `generate sdk` command to use the public `aws-sdk-js-v3` repo for service models instead of the private repo.
Clean up for nullability checks and deserialization logic
@dnys1 dnys1 force-pushed the chore/aft/use-public-models branch from e9513c9 to 258667e Compare September 12, 2023 21:24
@dnys1 dnys1 force-pushed the chore/aft/use-public-models branch from 258667e to 34d1b40 Compare September 12, 2023 21:24
@dnys1 dnys1 marked this pull request as ready for review September 13, 2023 14:19
@dnys1 dnys1 requested a review from a team as a code owner September 13, 2023 14:19
Copy link
Contributor

@Equartey Equartey left a comment

Choose a reason for hiding this comment

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

Looks good, just one non-blocking observation.

.singleWhere(
(service) =>
service.expectTrait<ServiceTrait>().endpointPrefix == apiName,
.singleWhere((service) => service.shapeId.namespace == namespace);
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool function, didn't know this existed.

Comment on lines +194 to +201
for (final operation in includeOperations) {
if (!allOperations.contains(operation)) {
throw Exception(
'Invalid operation specified for $namespace: $operation',
);
includeShapes.addAll(serviceShape.operations.map((op) => op.target));
}
}
includeShapes.addAll(includeOperations);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could flatten this logic a little bit.

final isMissingOp = includeOperations.every((e) => !allOperations.contains(operation));
if (isMissingOp) {
   throw  Exception(
     'Invalid operation specified for $namespace: $operation',
    );
}
includeShapes.addAll(includeOperations);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, started with something like that. This turned out to be cleaner - the problem is getting the element which didn't pass the condition, i.e. operation in your snippet.

@dnys1 dnys1 merged commit 46ca8db into main Sep 13, 2023
115 of 120 checks passed
@dnys1 dnys1 deleted the chore/aft/use-public-models branch September 13, 2023 15:03
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