omniglot crashes if it encounters a generated file

NEW
Unassigned

Status

4 years ago
3 years ago

People

(Reporter: erik, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
In mozilla-central, "configure" is generated at build time, not checked into the tree, so this happens when generating the Diff link:

A worker failed while indexing /targetdata/dxr-build-env/src/mozilla-central/configure:
Traceback (most recent call last):
  File "/targetdata/dxr-build-env/dxr-venv/lib/python2.7/site-packages/dxr-0.1-py2.7.egg/dxr/build.py", line 590, in index_chunk
    index_file(tree, tree_indexers, path, es, index, jinja_env)
  File "/targetdata/dxr-build-env/dxr-venv/lib/python2.7/site-packages/dxr-0.1-py2.7.egg/dxr/build.py", line 563, in index_file
    'sections': build_sections(chain.from_iterable(linkses))}))
  File "/targetdata/dxr-build-env/dxr-venv/lib/python2.7/site-packages/dxr-0.1-py2.7.egg/dxr/build.py", line 704, in build_sections
    return [(section, list(items)) for importance, section, items in links]
  File "/targetdata/dxr-build-env/dxr-venv/lib/python2.7/site-packages/dxr-0.1-py2.7.egg/dxr/plugins/omniglot.py", line 323, in items
    yield 'diff',  "Diff", vcs.generate_diff(vcs_relative_path)
  File "/targetdata/dxr-build-env/dxr-venv/lib/python2.7/site-packages/dxr-0.1-py2.7.egg/dxr/plugins/omniglot.py", line 149, in generate_diff
    return self.upstream + 'diff/' + self.previous_revisions[path] + '/' + path
KeyError: 'configure'

We should probably just decline to draw log, blame, diff, and raw links for untracked files.
In a full index of moz-central with the new vcs work, I did not encounter this crash. Maybe we fixed it there?

I considered changing the query to .get(path, self.revision), but it should not be necessary because we only call this method after a vcs has affirmed it tracks a path through is_tracked.
You need to log in before you can comment on or make changes to this bug.