nikhiln64 commented on PR #18434:
URL: 
https://github.com/apache/dolphinscheduler/pull/18434#issuecomment-5250422129

   Good point, the UI should not accept a config the worker will reject. I 
applied the same rule in the json validator in use-datax.ts. When the inline 
json is empty it now requires exactly one resource whose name ends with .json, 
using the same fullName list the resource picker already binds to 
model.resourceList. An auxiliary only selection like a lone keytab, and a 
selection with more than one json, both fail validation now, while one json 
with auxiliary files alongside it passes, which matches 
DataxParameters.getJobDefinitionResource on the backend. I also added a 
dedicated message key datax_custom_json_resource_tips in the en and zh locales 
instead of the old generic empty tip, so the reason is clear in the form.
   
   On the validator test coverage, I looked for a place to add it and the ui 
module has no frontend unit test harness at the moment. There is no vitest or 
jest config, no test script in package.json, and no .test.ts or .spec.ts under 
dolphinscheduler-ui/src, so validator behavior is not unit testable here the 
way the backend is, it is exercised through the selenium e2e suite. I did not 
want to pull a whole test framework into this fix. I ran the project prettier 
2.7.1 over the three changed files and they pass. Happy to add e2e coverage for 
the datax resource cases in a follow up, or to wire up a validator unit test 
harness separately if you would like that as its own change.


-- 
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]

Reply via email to