patchwork icon indicating copy to clipboard operation
patchwork copied to clipboard

When the context is larger then the context_token_length warn the user

Open codelion opened this issue 1 year ago • 1 comments

In the get_source_code_context method in the ExtractCode.py file. If the context is larger than the context_token_length we just return None, None as position (as seen here - https://github.com/patched-codes/patchwork/blob/f1b107ab86c70a246691fc3062d561dd098a75ff/patchwork/steps/ExtractCode/ExtractCode.py#L32).

As a result the patchflow may fail to execute and the only thing user sees is No context found. Instead we should warn them with a logger.warn and suggest that the context selected is larger than the context_token_length and they can increase the context_token_length to process the larger context.

codelion avatar Jun 29 '24 01:06 codelion

The following files in the repository may be relevant to the issue:


  • patchwork/steps/ExtractCodeMethodForCommentContexts/ExtractCodeMethodForCommentContexts.py
  • patchwork/steps/ExtractCodeContexts/ExtractCodeContexts.py
  • patchwork/common/context_strategy/generic.py
  • patchwork/steps/ExtractCode/ExtractCode.py
  • patchwork/common/client/patched.py
  • patchwork/app.py
  • patchwork/steps/CreateIssueComment/CreateIssueComment.py

patched-admin avatar Jun 29 '24 01:06 patched-admin