ArafatKhan2198 opened a new pull request, #12253:
URL: https://github.com/apache/ozone/pull/12253

   ## What changes were proposed in this pull request?
   
   This is the first sub-task of HDDS-17986, the Recon AI Assistant V2 work. 
Before building new features on top of the assistant, we want the current one 
to be reliable. This PR fixes five existing problems that make it give wrong 
answers, fail, or behave unsafely. It does not add any new feature.
   
   - **"Mismatched containers" questions failed.** If the question did not say 
whether to look in OM or SCM, the assistant sent an empty value and Recon 
rejected it. It now defaults to SCM, the same as the Recon REST API.
   - **"Which folders use the most space" questions returned the wrong list.** 
The assistant returned every sub-path unsorted, while Recon's own API returns 
the 30 largest sorted by size. It now uses the same default as Recon.
   - **Some container results could not be returned at all.** Results that 
include pipeline details failed to convert to JSON because of a date field. 
They now convert correctly.
   - **The assistant could load images from outside.** If a reply contained an 
image link, the browser fetched it from that server. A reply could use this to 
send out information about the cluster. Images are no longer shown in replies.
   - **Outdated comments and documentation removed.** Old comments in the code 
described a component that no longer exists. The guide the assistant reads now 
states the two defaults above, so it matches what the code does.
   
   These changes are small and do not depend on Code Mode. They improve the 
assistant as it works today.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17987 (parent: 
https://issues.apache.org/jira/browse/HDDS-17986)
   
   ## How was this patch tested?
   
   Each fix has a regression test. I confirmed each test fails when its fix is 
reverted and passes with it:
   
   - `TestReconEndpointRouter`
       - `testRouteContainersMismatchDefaultsMissingInToScm` (new)
       - `testRouteNamespaceUsagePassesPathAndFlags` (updated to expect the new 
default)
       - `testRouteNamespaceUsageHonoursSortSubPathsFalse` (new)
   - `TestReconResponseUnwrapper#testUnwrapEntityWithHddsPipeline` (new): 
unwraps a `ContainerDiscrepancyInfo` holding a real `Pipeline`.
   - `Assistant.test.tsx`: "does not render images in markdown responses" 
(new), with the `mockChatWithImage` mock.
   
   Results:
   
   - `mvn -pl :ozone-recon test 
-Dtest='org.apache.hadoop.ozone.recon.chatbot.**' -DskipShade -DskipRecon`: 159 
tests, 0 failures.
   - `npx vitest --run src/__tests__/assistant`: 15 of 15 pass.
   - `npx eslint` on the changed web files: 0 errors.
   - `./hadoop-ozone/dev-support/checks/checkstyle.sh`: BUILD SUCCESS.
   
   There are no visible UI changes other than images no longer appearing in 
replies, so no screenshot is attached.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to