mozilla/dxr

"no such group" error in buglink plugin

klibby opened this issue · 6 comments

Rust, rustfmt, and servo have all thrown the following error (eg https://jenkins-dxr.mozilla.org/job/servo/9/console):

15:21:29 A worker failed while indexing /builds/dxr-build-env/src/servo/servo/tests/wpt/css-tests/css21_dev/html4/border-bottom-applies-to-009.htm:
15:21:29 Traceback (most recent call last):
15:21:29 File "/builds/dxr-build-env/dxr/dxr/build.py", line 572, in index_chunk
15:21:29 index_file(tree, tree_indexers, path, es, index)
15:21:29 File "/builds/dxr-build-env/dxr/dxr/build.py", line 542, in index_file
15:21:29 for chunk in bulk_chunks(docs(), docs_per_chunk=300, bytes_per_chunk=10000):
15:21:29 File "/builds/dxr-build-env/venv/local/lib/python2.7/site-packages/pyelasticsearch/utils.py", line 31, in bulk_chunks
15:21:29 for action in actions:
15:21:29 File "/builds/dxr-build-env/dxr/dxr/build.py", line 514, in docs
15:21:29 chain.from_iterable(regionses)))):
15:21:29 File "/builds/dxr-build-env/dxr/dxr/lines.py", line 472, in finished_tags
15:21:29 key=nesting_order)
15:21:29 File "/builds/dxr-build-env/dxr/dxr/lines.py", line 338, in tag_boundaries
15:21:29 for start, end, data in tags:
15:21:29 File "/builds/dxr-build-env/dxr/dxr/plugins/buglink/init.py", line 15, in refs
15:21:29 bug = m.group(1)
15:21:29 IndexError: no such group

Hmm, my initial guess is that configobj is reading #([0-9]+) as a comment, so the regex is empty, so it has no capturing groups.

d'oh, that behavior was really puzzling me...

Yep, confirmed.

Put double quotes around it, and the problem goes away.

Better still, use triple-double quotes to avoid DiffSK/configobj#97, which kicks in in some situations:

"""#([0-9]+)"""

Looks like I did document this way back when: https://dxr.readthedocs.io/en/latest/configuration.html#syntax. Too bad configobj development has stalled.