mozilla-releng / mozilla-releng/mozilla-version

GeckoVersion raises too many different errors when it can't parse a version

Open
#76 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Python
Stars
5
Forks
20
Avg merge
17h 24m
Merged PRs (30d)
2

Description

This is what GeckoVersion raises:

https://github.com/mozilla-releng/mozilla-version/blob/ea853e08a8b033a74b628480017e19d5d9266b87/mozilla_version/gecko.py#L103-L109

I initially thought it would be a good idea to have distinct error types, but after years of use, mozilla-version users just would like to know if a version was correctly parsed or not. It would be great to change GeckoVersion (and likely BaseVersion too) to just return a single error type.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked section of mozilla_version/gecko.py at lines 103-109, then trace how BaseVersion handles parsing errors. Check the existing version-parsing tests and identify the expected single error type for invalid input; done means GeckoVersion and BaseVersion expose consistent failure behavior without breaking valid-version parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.