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

AttributeError exception issued Code Review attempt in PyCharm Plugin #440

Closed
3 tasks done
yaelmi3 opened this issue Oct 22, 2024 · 2 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@yaelmi3
Copy link

yaelmi3 commented Oct 22, 2024

Checklist

Description

Code review in PyCharm results in exception: AttributeError: 'NoneType' object has no attribute 'comment_responses'
The issue has started recently (could be as a result of an plugin upgrade, but I'm not entirely sure). The issue reproduces all the time in all local projects

Code snippet that reproduces issue

full stacktrace from sourcery.log

2024-10-22 09:20:03,170 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/validation/invalidCommentsSkipped'
2024-10-22 09:20:03,179 | 10687 | PY-242.23339.19 | INFO | ai_review.chains.comment_suggestion | comment_suggestion:92 | Skipping suggestion for review comment at rcm-app/src/App.tsx:88
2024-10-22 09:20:03,184 | 10687 | PY-242.23339.19 | INFO | ai_review.chains.comment_suggestion | comment_suggestion:92 | Skipping suggestion for review comment at rcm-app/src/App.tsx:120
2024-10-22 09:20:03,186 | 10687 | PY-242.23339.19 | INFO | ai_review.chains.comment_suggestion | comment_suggestion:99 | Creating suggestion for review comment at None
2024-10-22 09:20:03,196 | 10687 | PY-242.23339.19 | INFO | ai_review.chains.comment_suggestion | comment_suggestion:92 | Skipping suggestion for review comment at realm_config_manager/app/authentication.py:56
2024-10-22 09:20:03,197 | 10687 | PY-242.23339.19 | INFO | ai_review.chains.comment_suggestion | comment_suggestion:92 | Skipping suggestion for review comment at realm_config_manager/realm_config_dal.py:40
2024-10-22 09:20:03,274 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/duplicateCommentsSkipped'
2024-10-22 09:20:03,276 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/praiseCommentsSkipped'
2024-10-22 09:20:03,278 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/lintSuppressionSkipped'
2024-10-22 09:20:03,280 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/importCommentsSkipped'
2024-10-22 09:20:03,281 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/broaderImpactCommentsSkipped'
2024-10-22 09:20:03,283 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/formattingCommentsSkipped'
2024-10-22 09:20:03,284 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/diffCommentsSkipped'
2024-10-22 09:20:03,286 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/verificationCommentsSkipped'
2024-10-22 09:20:03,288 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 0 comments in event 'review/lowImportanceCommentsSkipped'
2024-10-22 09:20:03,306 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.reposition_comments_within_diff | reposition_comments_within_diff:32 | Comment outside the diff: location='rcm-app/src/App.tsx' file='rcm-app/src/App.tsx' comment_type=<ReviewCommentType.SUGGESTION: 'suggestion'> importance=<ReviewCommentImportance.MEDIUM: 'medium'> area=<CommentRequestReviewCommentArea.PERFORMANCE: 'performance'> diff_line_for_comment='+    const beforeChangeCallback = (changes: (Handsontable.CellChange | null)[], source: Handsontable.ChangeSource) => {' diff_context='+    const beforeChangeCallback = (changes: (Handsontable.CellChange | null)[], source: Handsontable.ChangeSource) => {' start_line_in_file=None end_line_in_file=None start_line_in_diff=None end_line_in_diff=None summary='Consider performance implications of frequent DOM updates.' follow_up_comment='Frequent updates to cell metadata and rendering can impact performance. Consider debouncing or batching updates to improve efficiency.' fix=None review_instructions=None
2024-10-22 09:20:03,308 | 10687 | PY-242.23339.19 | INFO | ai_review.lib.telemetry | send_telemetry_comments_skipped_count:35 | Skipping 1 comments in event 'review/repositionCommentsSkipped'
2024-10-22 09:20:08,392 | 10687 | PY-242.23339.19 | INFO | httpx | _send_single_request:1038 | HTTP Request: POST https://api.sourcery.ai/coding-assistant/openai/v1/chat/completions "HTTP/1.1 200 OK"
2024-10-22 09:20:09,048 | 10687 | PY-242.23339.19 | ERROR | sourcery.util.exception | handle_exception:78 | handled exception during review assistance
Traceback (most recent call last):
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/binary/lsp/review.py", line 292, in execute_chat_request
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/binary/lsp/review.py", line 440, in _execute_ai_review
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/concurrent/futures/_base.py", line 456, in result
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/concurrent/futures/_base.py", line 401, in __get_result
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/concurrent/futures/thread.py", line 58, in run
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/pull_request_reviewer/ai_review.py", line 61, in execute_ai_review
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 4700, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 1926, in _call_with_config
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 4556, in _invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/ai_review/ai_review.py", line 86, in ai_review
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 3022, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/passthrough.py", line 494, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 1926, in _call_with_config
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/passthrough.py", line 481, in _invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 3723, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/concurrent/futures/_base.py", line 456, in result
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/concurrent/futures/_base.py", line 401, in __get_result
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/concurrent/futures/thread.py", line 58, in run
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 3707, in _invoke_step
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 3022, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 4700, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 1926, in _call_with_config
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 4556, in _invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/ai_review/chains/review_summary.py", line 43, in review_summary
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 4700, in invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 1926, in _call_with_config
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/base.py", line 4556, in _invoke
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/langchain_core/runnables/config.py", line 394, in call_func_with_variable_args
  File "/Users/kernel-panic/Library/Application Support/JetBrains/PyCharm2024.2/plugins/sourcery/sourcery_binaries/1.23.1b28/c30b65a0-26a1-41ff-b58a-6369d3bd6754/ai_review/chains/overall_comments.py", line 64, in get_overall_comments
AttributeError: 'NoneType' object has no attribute 'comment_responses'

Debug Information

PyCharm 2024.2.3 (Professional Edition)
Build #PY-242.23339.19, built on September 26, 2024
Licensed to ****
Subscription is active until May 20, 2025.
Runtime version: 21.0.4+13-b509.17 x86_64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.7
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 5048M
Cores: 12
Metal Rendering is ON
Registry:
debugger.watches.in.variables=false
debugger.new.tool.window.layout=true
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
eu.ydp.idea.tsSpecGenerator (0.2)
squirrelsong-light (2.0.5)
com.jetbrains.space (242.22855.32)
org.jetbrains.plugins.go-template (242.20224.155)
com.chesterccw.excelreader (2024.9.1-242)
name.kropp.intellij.makefile (242.20224.155)
Eclipse theme (1.0)
com.intellij.kubernetes (242.23339.16)
com.koxudaxi.pydantic (0.4.15)
sourcery.pycharm-plugin (1.23.0)
net.seesharpsoft.intellij.plugins.csv (3.4.0-242)
com.intellij.bigdatatools.core (242.22855.74)
com.intellij.bigdatatools.binary.files (242.20224.159)
com.intellij.bigdatatools.rfs (242.22855.74)
io.snyk.snyk-intellij-plugin (2.9.1)
com.github.copilot (1.5.25.10)

Sourcery Version:

Sourcery 1.23.0

Operating system and Version:
macOS Sonoma 14.7 (23H124)

@yaelmi3 yaelmi3 added the bug Something isn't working label Oct 22, 2024
@ruancomelli
Copy link
Contributor

Hello there - thanks for reaching out!

We've recently published v1.24.0 containing a fix for this bug.
Please update your plugin to get the fix, and feel free to reach out if you encounter any other issues.

@yaelmi3
Copy link
Author

yaelmi3 commented Nov 8, 2024

Thanks for the fix. Works perfectly now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants