Closed htourneu closed 9 months ago
Tagging @Michaelpalacce as we discussed that issue earlier.
Hey @htourneu , could you check if the issue still persists on your side with the latest Build Tools for Aria version? On my side I have a test project setup with XML module, Build Tools version 2.36.0 and it seems to parse the tags / path correctly and execute both local pull and push with changes and new tags added to the path:
@Michaelpalacce by any chance, do you know if someone has worked on fixing the issue but have not closed the Github ticket?
@VenelinBakalov the issue is with the symbol "&". Have you tested with that?
I think we need to figure out characters that are universally acceptable in all operating systems And provide a descriptive error message what the issue is, cause currently we get some nonesense.
@ognqnai will take over this one
Taking a look at: vropkg/src/serialize/tree.ts
We can add a check for the acceptable characters before line 89
@Michaelpalacce yeap, I was testing with &. Just in the screenshots above it was automatically translated to & but on the vRO screenshot it is visible and seems to be working ok at least for me. https://github.com/vmware/build-tools-for-vmware-aria/issues/165#issuecomment-1855301534 @ognqnai I can also provide access to the environment I was using for testing if that would help
@VenelinBakalov this is also OS dependant I beleive, so it'd work on mac but maybe not on Windows. Ogi is working on adding a filter that will give out an error in such cases
I see, ok that sounds good. Still, it would be good if someone on Windows can confirm that it is still breaking. But regardless of that, I agree that it is good to add such filter.
I have checked at: vropkg/src/serialize/tree.ts
When the name includes unsupported signs like "&," the name becomes "undefined."
The name was gotten from vropkg/src/parse/util.ts e.attr.name. I assume somewhere this name is filtered, but I can't find where.
exports.xmlToCategory = (categories) => categories.children.map(e => { return e.attr.name; });
Example log for category with correct name:
[ [INFO] XmlElement { [INFO] name: 'category', [INFO] attr: { name: 'TestName' }, [INFO] val: '', [INFO] children: [ [XmlElement] ], [INFO] firstChild: XmlElement { [INFO] name: 'name', [INFO] attr: {}, [INFO] val: 'TestName', [INFO] children: [Array], [INFO] firstChild: [XmlCDataNode], [INFO] lastChild: [XmlCDataNode], [INFO] line: 0, [INFO] column: 48, [INFO] position: 48, [INFO] startTagPosition: 43 [INFO] }, [INFO] lastChild: XmlElement { [INFO] name: 'name', [INFO] attr: {}, [INFO] val: 'TestName', [INFO] children: [Array], [INFO] firstChild: [XmlCDataNode], [INFO] lastChild: [XmlCDataNode], [INFO] line: 0, [INFO] column: 48, [INFO] position: 48, [INFO] startTagPosition: 43 [INFO] }, [INFO] line: 0, [INFO] column: 42, [INFO] position: 42, [INFO] startTagPosition: 13 [INFO] } [INFO] ]
Example log for a category with an incorrect name:
[ [INFO] XmlElement { [INFO] name: 'category', [INFO] attr: {}, [INFO] val: '', [INFO] children: [ [XmlElement] ], [INFO] firstChild: XmlElement { [INFO] name: 'name', [INFO] attr: {}, [INFO] val: 'Workload & Onboarding', [INFO] children: [Array], [INFO] firstChild: [XmlCDataNode], [INFO] lastChild: [XmlCDataNode], [INFO] line: 0, [INFO] column: 106, [INFO] position: 106, [INFO] startTagPosition: 101 [INFO] }, [INFO] lastChild: XmlElement { [INFO] name: 'name', [INFO] attr: {}, [INFO] val: 'Workload & Onboarding', [INFO] children: [Array], [INFO] firstChild: [XmlCDataNode], [INFO] lastChild: [XmlCDataNode], [INFO] line: 0, [INFO] column: 106, [INFO] position: 106, [INFO] startTagPosition: 101 [INFO] }, [INFO] line: 0, [INFO] column: 100, [INFO] position: 100, [INFO] startTagPosition: 91 [INFO] } [INFO] ]
Cause for the issue :-
When there are special characters('&') in the workflow path, inside the downloading temporary package (C:\Users\xxx\AppData\Local\Temp\vro-xml-pullXXX), 'package\elements\xxx\categories' file doesn't contains the 'name' attribute in the 'category' tag.
Without special characters in the path (/character-issue/TestFolder/)
<categories>
<category name='character-issue'>
<name><![CDATA[character-issue]]></name>
</category>
<category name='TestFolder'>
<name><![CDATA[TestFolder]]></name>
</category>
</categories>
With special characters in the path (/character-issue/TestFolder&/)
<categories>
<category name='character-issue'>
<name><![CDATA[character-issue]]></name>
</category>
<category>
<name><![CDATA[TestFolder&]]></name>
</category>
</categories>
Issue is generating from the JS files, when we accessing the attribute.
Tested OS :- Both in Windows & MAC, the issue is generated.
Current Solution :- I am working on implementation adding descriptive error message with the error. (check on whether attribute have a value from the typescript and using CDATA value to generate the error message)
During my recent implementation testing, I observed that prior to the implementation in the "vRO JS" type projects with the same scenario, there were no error during the project pull operation. But it's ignoring the special character folder.
/folder1/test&/folder2 -> /folder1/folder2
Given this behavior, we decided to apply a similar strategy to "XML Legacy" type projects and add warning logs in the both scenarios.
Description
When running a vro:pull command on legacy workflow archetype, if those workflows paths name contains the & character, the pull command will faill with the log below
Steps to Reproduce
Preconditions: Have the "&" character in the workflow folder path name
Expected behavior: vRBT to handle this character as any other character and succeed
Actual behavior: It fails when running the vro:pull command
Reproduces how often: 100%
Component/s: maven/plugins/vropkg
Affects Build/s: 2.32.0
Environment
Client
Server
Failure Logs