Internal representation can lose files due to non-unique keys

Bug #1189992 reported by Aaron Bentley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charmworld
Triaged
Medium
Unassigned

Bug Description

The list of files in the charm uses the filename, not the file-id, as a dictionary key. This means that collisions in filenames can cause masking, since the dictionary can have only one instance of a key. This is not currently a big problem, because only files in the hooks directory and specific files in the root directory are stored. Thus, the problem is only exhibited if files matching the following pattern exist:
"hooks/config.yaml", "hooks/metadata.yaml", "hooks/readme.*", "hooks/revision", "hooks/icon.svg"

If new file patterns are added in the future, the chance of a collision will increase slightly. If new directories are added, the chance of collision will increase dramatically.

When addressing this issue, it may make sense to address bug #1194907 at the same time.

Tags: tech-debt
Curtis Hovey (sinzui)
Changed in charmworld:
importance: Undecided → Medium
status: New → Triaged
Aaron Bentley (abentley)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.