Skip to content

Update task_manager.py#733

Open
RohanMishra315 wants to merge 1 commit into
konveyor:mainfrom
RohanMishra315:patch-1
Open

Update task_manager.py#733
RohanMishra315 wants to merge 1 commit into
konveyor:mainfrom
RohanMishra315:patch-1

Conversation

@RohanMishra315

Copy link
Copy Markdown

fixes: #722

  1. Check you have corrected Java version
  2. IsADirectoryError separately handeled.

fixes: konveyor#722
1. Check you have corrected Java version
2. IsADirectoryError separately handeled.

Signed-off-by: Rohan Mishra <315scisyb2020rohanmishra@gmail.com>

@pranavgaikwad pranavgaikwad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for attempting a fix for this. Really appreciate it. A few suggestions...It would be better to fix this issue at the root instead of catching it as an exception. What is happening is that something that is not an error is being parsed as an OtherError with a wrong file path. The correct place to fix this would be in file https://github.com/konveyor/kai/blob/main/kai/reactive_codeplanner/task_runner/compiler/maven_validator.py

This is where we run the maven command and parse its output. To understand how we are parsing the errors, take a look at this function

def parse_error_line(
lines: list[str], index: int, match: re.Match[str]
) -> tuple[MavenCompilerError, int]:
"""
Parses an error line and returns a MavenCompilerError instance and the next index.
"""
acc = [lines[index]]
file_path = match.group(1).strip()
line_number = int(match.group(2)) if match.group(2) else -1
column_number = int(match.group(3)) if match.group(3) else -1
message = match.group(4).strip()
error_class = classify_error(message)
error = error_class(
file=file_path,
line=line_number,
column=column_number,
message=message,
details=[],
)
# Look ahead for details
details, next_index = extract_error_details(lines, index + 1)
error.details.extend(details)
# Extract additional information based on error type
extract_additional_info(error)
error.parse_lines = "\n".join(acc + details)
return error, next_index

Most probably the fix will be in this function (you may have to reproduce the issue to figure that out). To reproduce, you can simply create a new test in file https://github.com/konveyor/kai/blob/main/tests/test_maven_validator.py

Use the output in the issue description. Take a look at existing tests to figure out how the parse_error_lines function is called. And finally, reach out if you need help :)

Thank you again.

@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days.
It will remain open for visibility and reporting purposes.
Please comment if this PR is still relevant.

@github-actions github-actions Bot added the stale label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven parsing error (see description for details)

2 participants