addons-linter icon indicating copy to clipboard operation
addons-linter copied to clipboard

Treat version validation failures as hard errors

Open Rob--W opened this issue 3 years ago • 1 comments

Moved from https://bugzilla.mozilla.org/show_bug.cgi?id=1593316

In https://bugzilla.mozilla.org/show_bug.cgi?id=1793925, we introduce validation of the version format to the schema, but only warn. We should enforce the format in the linter, by not warning but rejecting submissions.

At the least for MV3. The format is chosen such that MV2 extensions can migrate to it, but since this could result in the rejection of long-established formats such as 1.0pre1, it may be reasonable to communicate to extension developers before enforcing it in MV2 too.

Rob--W avatar Oct 12 '22 15:10 Rob--W

More details in https://bugzilla.mozilla.org/show_bug.cgi?id=1793925#c3

In short, the requirement for the version format is:

  • At least 1, at most 4 parts separated by dots (as before).
  • 9 digits per part.
  • Trim leading zeroes.

Rob--W avatar Oct 13 '22 13:10 Rob--W

@willdurand I added the next milestone.

ioanarusiczki avatar Oct 27 '22 07:10 ioanarusiczki

@willdurand @Rob--W

I tested for MV2 and MV3 on linter 5.20.0. -> I believe it should work as expected.

Some examples of valid versions: "0.0.0.0" "0.0.0.9" "1.0.0.0" "0.1.2.3" "123456789.214785236.355554444.444444444" "999999999.99999999.99999999.99999999"

Invalid versions, when the error is thrown: "1.2.3.04" "0.0.0.00" "0.0.0.w" "10.01.0.0" "1.2.3.4.5" "1.214.44.webext" "123456789.999999999.00004" " 123456789.999999999.4" or "123456789.99999 9999.4" or "123456789.99999 9999.4 " -> spaces left ".123456789.999999999.4" or "123456789.999999999.4." -> dots used at the beginning or at the end "000000000.000000000.000000000.000000000" "999999999.99999999.99999999.99999999.9"

This is the error :

the error for invalid version

ioanarusiczki avatar Oct 31 '22 14:10 ioanarusiczki