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

eval generator #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

eval generator #2

wants to merge 1 commit into from

Conversation

Kvadratni
Copy link
Collaborator

This pull request introduces the automatic evaluation generation feature to the ai_migrate tool, enhancing its capabilities by automatically creating evaluation test cases from successful migrations.

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I'll let @jamadeo do the lgtm, here are some random comments

info.pr_number = url.split("/pull/")[-1]

if info.pr_number:
if not info.pr_number.isdigit():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and

old_dirs = [
d for d in examples_dir.iterdir() if d.is_dir() and d.name.endswith(".old")
]

for old_dir in old_dirs:
# Construct the corresponding .new directory name
base_name = old_dir.name[:-4] # remove .old
base_name = old_dir.name[:-4]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. removesuffix

@@ -366,7 +362,22 @@ async def run(
log_stream,
local_worktrees,
llm_fakes,
target_dir: str = "",
target_basename: str = "",
dont_create_evals=False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might as well type the rest too then

@@ -378,6 +389,10 @@ async def run(
start_point = (
await subprocess_run(["git", "rev-parse", "HEAD"], check=True)
).strip()

# Define target_dir_rel_path
target_dir_rel_path = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, is this set somewhere to something else than None? Should it be what's in 397?

dont_create_evals,
target_dir=target_dir,
target_dir_rel_path=target_dir_rel_path,
target_basename=target_basename,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't seem to be used as far as I can tell

@@ -0,0 +1,301 @@
import tempfile
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the AI provided comments here that don't add value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to purge the test files.

Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Douwe's notes but also there's something we should take a closer look at in pr_utils.py

if base:
return f"// Original content of {file_path}\n// This is a placeholder for demonstration purposes"
else:
return f"// Modified content of {file_path}\n// This is a placeholder for demonstration purposes"
except Exception as e:
print(f"Approach 3 failed: {e}")

# If all approaches fail, return a minimal placeholder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should have caught this before because I see it's not part of this diff, but this "Approach 3" doesn't seem to make a lot of sense -- I don't think you'd ever want placeholders for content, I think you'd just want to fail loudly. You'd also never need to put this particular code in a try/except

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i'll drop this

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.

3 participants