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

Add docs and validation for endpoint patterns #2069

Merged
merged 6 commits into from
Dec 22, 2023

Conversation

alextwoods
Copy link
Contributor

Description of changes:
Add docs and validation for endpoint patterns used by standardRegionalEndpoints and standardPartitionalEndpoints.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@alextwoods alextwoods requested a review from a team as a code owner December 11, 2023 22:11
@alextwoods alextwoods requested a review from syall December 11, 2023 22:11
Matcher m = PATTERN.matcher(endpoint);
while (m.find()) {
if (!SUPPORTED_PATTERNS.contains(m.group())) {
events.add(danger(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these be aggregated to a list so that one event is emitted for an invalid endpoint pattern with any amount of unsupported labels in it?

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 - will combine.

docs/source-2.0/aws/aws-endpoints-region.rst Outdated Show resolved Hide resolved
ServiceShape serviceShape, StandardRegionalEndpointsTrait regionalEndpoints) {
List<ValidationEvent> events = new ArrayList<>();

regionalEndpoints.getRegionSpecialCases().forEach((region, specialCases) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since region looks unused, you could iterate over the values() instead of the whole map.

for (RegionSpecialCase specialCase : regionalEndpoints.getRegionSpecialCases().values())

nit: also prefer for loops to forEach streaming iteration.

Copy link
Contributor

Choose a reason for hiding this comment

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

This feedback applies to the Partitional branch as well, with the naming replaced.


private List<ValidationEvent> validatePartitionalEndpointPatterns(
ServiceShape serviceShape, StandardPartitionalEndpointsTrait partitionalEndpoints) {

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: rm

@kstich kstich merged commit 8fa7d38 into smithy-lang:main Dec 22, 2023
10 checks passed
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.

2 participants