mozilla / mozilla/probe-scraper
Gracefully handle commits where files are missing from git
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26
- Forks
- 73
- Avg merge
- 10h
- Merged PRs (30d)
- 3
Description
this code fails when there are commits where a file was deleted:
https://github.com/mozilla/probe-scraper/blob/c71f5dd8b0f4a98a9c2de83b38f22ff4e0b40205/probe_scraper/scrapers/git_scraper.py#L128 https://github.com/mozilla/probe-scraper/blob/c71f5dd8b0f4a98a9c2de83b38f22ff4e0b40205/probe_scraper/scrapers/git_scraper.py#L84-L85
the current workaround requires listing every commit where the file was deleted:
https://github.com/mozilla/probe-scraper/blob/c71f5dd8b0f4a98a9c2de83b38f22ff4e0b40205/probe_scraper/scrapers/git_scraper.py#L35-L49 https://github.com/mozilla/probe-scraper/blob/c71f5dd8b0f4a98a9c2de83b38f22ff4e0b40205/probe_scraper/scrapers/git_scraper.py#L103 https://github.com/mozilla/probe-scraper/blob/c71f5dd8b0f4a98a9c2de83b38f22ff4e0b40205/probe_scraper/scrapers/git_scraper.py#L123-L124
That workaround is still needed for invalid files, but for missing files we should add code to handle the exception from git, probably with continue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in probe_scraper/scrapers/git_scraper.py at the references around lines 84-85 and 128, then review the existing workaround around lines 35-49, 103, and 123-124. Handle the git exception for missing files so commits containing deleted files do not fail, while retaining the workaround for invalid files. Done means the scraper continues past missing files without requiring each deleted commit to be listed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100