Skip to content

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

Open
TheSaiEaranti wants to merge 1 commit into
awslabs:mainfrom
TheSaiEaranti:fix-duplicate-iot-key
Open

fix(deploy-on-aws): merge duplicate iot key in aws4-shapes.json#244
TheSaiEaranti wants to merge 1 commit into
awslabs:mainfrom
TheSaiEaranti:fix-duplicate-iot-key

Conversation

@TheSaiEaranti

@TheSaiEaranti TheSaiEaranti commented Jul 25, 2026

Copy link
Copy Markdown

Fixes #216

Problem

plugins/deploy-on-aws/scripts/lib/aws4-shapes.json defined the iot category twice:

fillColor shapes
first definition #1A9C37 59
second definition #3F8624 17

The two lists overlap by only 14 entries. check-json rejects the file outright, and lenient parsers keep the last definition — so the 45 shapes unique to the first definition were silently dropped.

This is not only a lint failure. validate_drawio.py flattens every category's shapes into valid_shapes (lines 25-30) and rejects any shape not in that set (line 225), so valid diagrams were being failed:

$ validate_drawio.py iot.drawio
VALIDATION FAILED for iot.drawio:
  ERROR: Invalid AWS4 shape references: iot_bicycle, iot_shadow.
         Check the aws4-shapes.json registry for valid shape names.

Fix

Merge both definitions into a single iot entry holding the sorted union — 62 shapes.

  • valid_shapes goes from 1057 to 1100: 43 shape names become valid again, and none are removed. (45 were unique to the first definition; 2 of those, iot_device_gateway and iot_over_the_air_update, were already reachable through another category.)
  • The same diagram now passes:
$ validate_drawio.py iot.drawio
  INFO: AWS4 shapes used: 2 unique shapes across 1 diagram(s).
VALIDATION PASSED for iot.drawio.

On fillColor

I kept #3F8624, for three reasons: it is the value that was already in effect, it is shared with five other categories (storage, customer_enablement, cloud_financial_management, migration_modernization), and #1A9C37 appears nowhere else in this registry nor anywhere in the upstream Sidebar-AWS4.js. fillColor is not consulted by validate_drawio.py, so this affects documentation only — happy to switch if #1A9C37 was the intended IoT colour.

On the generator

The file header describes it as auto-generated from draw.io's Sidebar-AWS4.js and aws4.xml, and the issue asks that the generator be fixed if one exists. No generator for this file is committed to the repository — validate_drawio.py is the only thing that references it — so the fix is applied to the artifact. If the generator lives elsewhere it will need the same de-duplication, or it will reintroduce this on the next regeneration.

Verification

  • json.load with a duplicate-detecting object_pairs_hook — no duplicate keys remain (this is what check-json enforces).
  • dprint check on the file — exit 0.
  • Shape lists stay sorted, matching 30 of the 31 categories.
  • Diff is confined to the iot region: 22 insertions, 41 deletions, one file.

Scoped to #216 only; the ruff failures from the same tracking issue (#213) are #218 and are untouched here.


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 registry defined the "iot" category twice. Strict JSON parsers reject the
file (check-json) and lenient ones keep only the second definition, so the 45
shapes unique to the first definition were silently discarded and
validate_drawio.py rejected diagrams that referenced them.

Merge both definitions into one sorted "iot" entry of 62 shapes. This makes 43
shape names valid again (two of the 45 were already reachable through another
category) and removes none.

Keep fillColor #3F8624: it was already the effective value, is shared with five
other categories, and unlike #1A9C37 it appears in the upstream draw.io sidebar.
No generator for this file is committed to the repo, so the fix is applied to
the artifact.

Fixes awslabs#216
@TheSaiEaranti
TheSaiEaranti requested review from a team as code owners July 25, 2026 09:23
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