Point azure/databases.py at the directory its icons ship in - #211
Closed
vasanth064 wants to merge 1 commit into
Closed
Point azure/databases.py at the directory its icons ship in#211vasanth064 wants to merge 1 commit into
vasanth064 wants to merge 1 commit into
Conversation
_icon_dir read resource_images/azure/database while every icon the module names ships under resource_images/azure/databases. 41 of its 45 classes resolved to a file that does not exist. Nothing reported this. The alias resolved, so the renderer believed it had an icon and drew an empty node instead of warning. modules.drawing loads every module in the package into a single namespace, so the alphabetically last module wins. databases.py therefore overrode the working aliases in database.py, which is why azurerm_redis_cache and azurerm_postgresql_flexible_server rendered blank even though database.py mapped both to classes whose icons are present. Adds tests/test_azure_icon_dirs.py, which asserts every Azure class with an _icon points at a file that exists. It fails on exactly those 41 classes without this change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
resource_classes/azure/databases.pydeclares:but every icon the module names ships under
resource_images/azure/databases. 41 of its 45 icon classes resolve to a file that does not exist. The 4 that work do so only because a same-named file happens to exist in the singular directory.Nothing reports this. The alias resolves, so the renderer believes it has an icon and draws an empty node — no
no icon for ...warning is emitted. That makes it invisible unless you look at the rendered diagram.Why it affects modules other than this one
modules/drawing.pyloads every module in the package into one namespace:Last module wins, and
databasessorts afterdatabase. Sodatabases.pyoverrides the aliases indatabase.py— includingazurerm_redis_cacheandazurerm_postgresql_flexible_server, whichdatabase.pymaps toCacheForRedisandDatabaseForPostgresqlServers, both of whose icons are present and correct.Net effect: Redis and PostgreSQL Flexible Server render as blank boxes in every Azure diagram, despite having working aliases and icons.
Change
One character:
databasetodatabaseson line 6.Tests
Adds
tests/test_azure_icon_dirs.py, which walks every class inresource_classes.azuredeclaring an_iconand asserts the file exists. This catches the whole class of bug, not just this instance._icon_dirline: 41 failed, 990 passed — exactly the classes in this modulepoetry run pytest tests -q -m "not slow"— 1698 passed, 5 deselectedpoetry run black --check modules— 35 files unchangedRelationship to #210
Independent. #210 adds missing Terraform aliases for Static Web Apps and Front Door; this fixes a wrong icon directory. Both branches are cut from
mainand neither depends on the other.AI assistance disclosed
Per CONTRIBUTING: this change was written with AI assistance (Claude). I reviewed the diff, and the counts above come from running the commands locally rather than being estimated.