mozilla/iris

Control Center uses wrong name for target when it differs between file system and main.py

mwobensmith opened this issue · 1 comments

Iris allows targets/tests to be detected automatically when placed in the root folder. If Iris scans the targets folder and finds a folder called foo - with a valid main.py file - this will be a valid target named foo either by command line or via Control Center.

e.g.
iris foo <args>

In order to allow the Control Center to display a friendlier name - with case-sensitivity, and/or spaces, etc. we allow a property to be declared in the target's main.py constructor called name. This does not have to be the same as what's on disk (above) as it's for display purposes. For instance, it could be "Foo" or "Foo Tests" etc.

Until now, our targets and their "friendly names" have always been the same, aside from case. However, I just tried adding spaces, words, etc. to a custom friendly name, and the Control Center uses that. This results in an error that the target is not found.

The problem is two-fold:

  1. We never provided both pieces of data to the CC in the targets.json file, only friendly name (name). So, the Control Center has no way of knowing the target's real name on disk.
  2. Once we provide this data in the targets.json file, we'll need to fix the CC to use it.

I will add a new property to the targets.json file: target. This should be equal to the name on disk, leaving name to be the friendly name.