Skip to content

fix(deploy-on-aws): dedupe duplicate iot key in aws4-shapes.json - #280

Open
avneetbansal-aws wants to merge 1 commit into
awslabs:mainfrom
avneetbansal-aws:fix/aws4-shapes-duplicate-iot-key
Open

avneetbansal-aws wants to merge 1 commit into
awslabs:mainfrom
avneetbansal-aws:fix/aws4-shapes-duplicate-iot-key

Conversation

@avneetbansal-aws

@avneetbansal-aws avneetbansal-aws commented Oct 2, 2026 •

Copy link
Copy Markdown

Fixes #216.

plugins/deploy-on-aws/scripts/lib/aws4-shapes.json has two top-level iot entries. A lenient JSON parser keeps the last one, so the first block (fillColor #1A9C37) was being silently shadowed by a second block that used #3F8624, which is the Storage category color, and carried a shorter list of shape names. The strict check-json pre-commit hook rejects the duplicate key outright, which is how the issue surfaced.

The shadowing also had a quieter effect. validate_drawio.py builds its set of valid shapes by walking categories, so once the second block won, roughly 45 iot_* shape names from the first block (for example iot_camera, iot_lightbulb, iot_mqtt, iot_sensor, iot_greengrass) stopped counting as valid.

This merges the two entries into a single iot category. It keeps #1A9C37, which is the IoT color used in fix_icon_colors.py, and takes the union of both shape lists so no valid name is lost. The three names that were unique to the second block (greengrass, internet_of_things, iot_edukit) are preserved.

Verified with pre-commit run check-json --all-files, which now passes. I also loaded the registry the way validate_drawio.py does and confirmed the previously shadowed iot_* shapes are present again, 1100 shapes total.

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

The shape registry had two top-level `iot` entries. Lenient parsers keep
the last one, so the first block (fillColor #1A9C37) was silently shadowed
by a second block that used #3F8624 (the Storage color) and a shorter shape
list. This dropped ~45 valid iot_* shape names from the set built by
validate_drawio.py and broke the strict check-json pre-commit hook.

Merge the two entries into a single `iot` category: keep fillColor #1A9C37
(matching the authoritative IoT mapping in fix_icon_colors.py) and take the
union of both shape lists so no valid shape name is lost.

Fixes awslabs#216

Signed-off-by: avneetbansal-aws <avneetbansal-aws@users.noreply.github.com>
@avneetbansal-aws
avneetbansal-aws force-pushed the fix/aws4-shapes-duplicate-iot-key branch from aaac1f9 to 1138cc4 Compare October 8, 2026 15:25
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.

pre-commit: check-json fails — duplicate key iot in aws4-shapes.json

1 participant