Skip to content

Handle leading zeros in APK package versions in the semver_dialects gem

Summary

We omitted the handling of leading zeros in the MR gitlab-org/ruby/gems/semver_dialects!97 (merged) for Update semver_dialects gem to support apk opera... (#428703 - closed).

This issue serves as a follow-up to address this scenario.

Please refer to this thread for the discussion.

Implementation Plan

  1. Handle leading zeros scenario
    1. For versions with leading zeros before the first ., eg 006 they will be compared as a digit ie leading zeros would be removed. See context.
    2. For versions with leading zeros after the first ., they will be compared using the apk_blob_sort function, see code suggestion.
  2. Remove leading zero test cases that were commented out by removing this code and this code from the convert_apk_test_cases.rb script. Re-run the script to generate the spec/apk_test_cases.rb file.
  3. Update documentation to remove note that leading zeros is not supported.
Edited by Shao Ming Tan
OSZAR »