Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code_review] StopIteration error in len_common_path() #4446

Closed
suhaibmujahid opened this issue Aug 28, 2024 · 1 comment · Fixed by #4447
Closed

[code_review] StopIteration error in len_common_path() #4446

suhaibmujahid opened this issue Aug 28, 2024 · 1 comment · Fixed by #4447
Labels
bug Something isn't working code-review

Comments

@suhaibmujahid
Copy link
Member

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "/Users/smujahid/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
    cli.main()
  File "/Users/smujahid/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
    run()
  File "/Users/smujahid/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 317, in run_module
    run_module_as_main(options.target, alter_argv=True)
  File "/Users/smujahid/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 238, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "/Users/smujahid/repos/mozilla/bugbug/scripts/code_review_tool_evaluator.py", line 253, in <module>
    main(args.variants, args.review_request_ids)
  File "/Users/smujahid/repos/mozilla/bugbug/scripts/code_review_tool_evaluator.py", line 194, in main
    comments = tool.run(patch)
               ^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/venv/lib/python3.11/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/venv/lib/python3.11/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/venv/lib/python3.11/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/venv/lib/python3.11/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/smujahid/repos/mozilla/bugbug/venv/lib/python3.11/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/code_review.py", line 1050, in run
    requested_functions = request_for_function_declarations(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/code_review.py", line 810, in request_for_function_declarations
    definitions = solve_conflict_definitions(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/code_review.py", line 767, in solve_conflict_definitions
    functions_common_path = [
                            ^
  File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/code_review.py", line 768, in <listcomp>
    (len_common_path(target_path, fun.file), fun) for fun in functions
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/smujahid/repos/mozilla/bugbug/bugbug/tools/code_review.py", line 758, in len_common_path
    max_common_path_length = next(
                             ^^^^^
StopIteration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code-review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@suhaibmujahid and others