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

Sanity check for internal dependency resolve #20

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

MkuuWaUjinga
Copy link
Contributor

As dicussed in #18, we ran into the problem that the LLM mistakenly returns the same file as an internal dependency. This results in an infinite loop as the recursion doesn't end and therefore spams OpenAI's API.

This PR is adding a permissive sanity check. It removes the dependency and issues a warning.

Alternatively we could exit the migration process at this point. Happy to discuss!

@coditamar
Copy link

@CodiumAI-Agent please review

@CodiumAI-Agent
Copy link

PR Analysis

  • 🎯 Main theme: Adding a sanity check to prevent infinite loops when a file is mistakenly identified as its own internal dependency
  • 🔍 Description and title: Yes
  • 📌 Type of PR: Bug fix
  • 🧪 Relevant tests added: No
  • Minimal and focused: Yes, the PR is focused on adding a sanity check to prevent infinite loops in the dependency resolution process
  • 🔒 Security concerns: No, the changes in this PR do not introduce any obvious security concerns

PR Feedback

  • 💡 General PR suggestions: The PR is well-structured and solves a specific issue. However, it would be beneficial to add tests to verify the new functionality and prevent future regressions.

  • 🤖 Code suggestions:

    • relevant file: migrate.py
      suggestion content: Consider using a more robust method to remove the sourcefile from the internal_dependencies string. The current method .replace(sourcefile, '') could potentially remove unintended parts of the string if the sourcefile name happens to be a substring of another dependency. A safer approach might be to split the string into a list, remove the sourcefile, and then join it back into a string. [important]

    • relevant file: migrate.py
      suggestion content: The warning message could be more informative by including the list of remaining internal dependencies after the sourcefile has been removed. This would give the user a clearer understanding of the impact of the operation. [medium]

How to use

Tag me in a comment '@CodiumAI-Agent' to ask for a new review after you update the PR.
You can also tag me and ask any question, for example '@CodiumAI-Agent is the PR ready for merge?'

@joshpxyne joshpxyne merged commit fddb84e into joshpxyne:main Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants