Open Bug 1585961 Opened 8 months ago Updated 5 months ago

Get rid of regex for parsing Firefox version number

Categories

(Testing :: geckodriver, enhancement, P3)

Version 3
enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: ato, Assigned: ato)

Details

Attachments

(1 file)

We pare the output of --version as part of the capabilities negotiation
in testing/geckodriver/src/capabilities.rs:83.

This is because the output may contain more data we don’t care about.

We could easily replace this with a small lexer.

Priority: -- → P3

I’m going to have a look at this quickly.

Assignee: nobody → ato
Status: NEW → ASSIGNED
Priority: P3 → P1

I have a patch for this locally that needs tests, but this is on my back-burner.

Edit: Lost the patch.

Priority: P1 → P3

version_from_binary() should in fact be using mozversion::Version::from_str() so we only parse the version number in one place.

However, mozversion still relies on a regexp:
https://searchfox.org/mozilla-central/rev/9b99e1d9c6cf83539674cb016c7373f549ba59ca/testing/mozbase/rust/mozversion/src/lib.rs#119

Attached file firefoxversions.txt

Attaching list of historical Firefox versions. This was extracted from https://product-details.mozilla.org/1.0/firefox.json.

This is useful input for version parsing tests.

You need to log in before you can comment on or make changes to this bug.