#102: Create reports for reso common format testing#187
Conversation
report generation works via cli when -c is passed still needs to work with the lib
…-create-reports-for-reso-common-format-testing
also simplifies the payload accumulation process
…-create-reports-for-reso-common-format-testing
…and resolve to legacyODataValue and then use Edm.Int32 otherwise Edm.String
|
@mohit-s96 - can you bring this up to date with the main branch so we can merge? |
| const commander = spawn( | ||
| join(pathToWebApiCommander, 'gradlew'), | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`], | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`], |
Check warning
Code scanning / CodeQL
Unsafe shell command constructed from library input
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we should avoid using the shell: true option with the spawn function and instead pass the command arguments as an array to ensure they are not interpreted by the shell. This can be achieved by using the spawn function without the shell option and properly constructing the arguments array.
- Modify the
executeCommanderMetadataTestfunction to usespawnwithout theshell: trueoption. - Construct the arguments array properly to avoid shell interpretation.
| @@ -86,6 +86,5 @@ | ||
| join(pathToWebApiCommander, 'gradlew'), | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`], | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`], | ||
| { | ||
| cwd: pathToWebApiCommander, | ||
| shell: true | ||
| cwd: pathToWebApiCommander | ||
| } |
| const commander = spawn( | ||
| join(pathToWebApiCommander, 'gradlew'), | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`], | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`], |
Check warning
Code scanning / CodeQL
Unsafe shell command constructed from library input
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we should avoid using the shell: true option with the spawn function and instead pass the arguments as an array to ensure they are not interpreted by the shell. This can be achieved by using the spawn function without the shell option and properly passing the arguments.
- Modify the
executeCommanderMetadataTestfunction to usespawnwithout theshell: trueoption. - Pass the
pathToConfigFileas a separate argument in the array to avoid shell interpretation.
| @@ -86,6 +86,5 @@ | ||
| join(pathToWebApiCommander, 'gradlew'), | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`], | ||
| ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`], | ||
| { | ||
| cwd: pathToWebApiCommander, | ||
| shell: true | ||
| cwd: pathToWebApiCommander | ||
| } |
closes #102