get_first_pushdate is failing with `IndexError: tuple index out of range`

Open
#5,239 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start in bugbug/repository.py at get_first_pushdate, then follow its caller in scripts/commit_retriever.py. Reproduce the bugbug-data-commits failure and determine why hg_log returns no entry; done means the command no longer raises IndexError for this repository state.

Written by the indexing model from the issue text.

Description

Traceback (most recent call last):
  File "/usr/local/bin/bugbug-data-commits", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/scripts/commit_retriever.py", line 67, in main
    retriever.retrieve_commits(args.limit)
  File "/usr/local/lib/python3.12/site-packages/scripts/commit_retriever.py", line 40, in retrieve_commits
    repository.download_commits(self.repo_dir, revs=revs[i : (i + chunk_size)])
  File "/usr/local/lib/python3.12/site-packages/bugbug/repository.py", line 1370, in download_commits
    first_pushdate = get_first_pushdate(repo_dir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bugbug/repository.py", line 1338, in get_first_pushdate
    return hg_log(hg, [b"0"])[0].pushdate
           ~~~~~~~~~~~~~~~~~~^^^
IndexError: tuple index out of range
Dominant language
Python
Stars
570
Forks
351
Avg merge
2d 13h
Merged PRs (30d)
65

Contributor guide

Open the contributing guide

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.

More from mozilla/bugbug

All issues in mozilla/bugbug

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.