Closed Bug 1580620 Opened 5 years ago Closed 5 years ago

[manifestparser] Always error on duplicate keys

Categories

(Testing :: Mozbase, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox71 fixed)

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: ahal, Assigned: ahal)

Details

Attachments

(1 file)

If you pass strict=True manifestparser will error if you specify the same key twice:
https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/testing/mozbase/manifestparser/manifestparser/ini.py#130

However in the event of duplicate keys, manifestparser will simply overwrite one of the values. So anytime this case happens it's basically an error and we should be loud about it.

More generally, we should probably just use strict mode all the time. But it's a lot easier to update manifestparser than all its consumers, and in this case the change should be very uncontroversial.

This might be tricky to land as any dupes in the wild will error and trying to find them all on try will be tricky. I have a sample-suites try run going. If that looks good I'll go ahead and land, though expect this will have a relatively high risk of backout.

Assignee: nobody → ahal
Status: NEW → ASSIGNED

Try run looked green:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7a531fcb0cc074ac3584261528cc4bedb88356f5

So I guess I'll just get review, land and see what happens.

Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8eb11e5adfe1
[mozbase] Make manifestparser fail on duplicate keys even without strict mode r=gbrown
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: