Skip to content

#102: Create reports for reso common format testing#187

Open
mohit-s96 wants to merge 46 commits into
mainfrom
102-create-reports-for-reso-common-format-testing
Open

#102: Create reports for reso common format testing#187
mohit-s96 wants to merge 46 commits into
mainfrom
102-create-reports-for-reso-common-format-testing

Conversation

@mohit-s96

Copy link
Copy Markdown
Contributor

closes #102

mohit-s96 and others added 30 commits August 30, 2024 20:20
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 mohit-s96 linked an issue Oct 3, 2024 that may be closed by this pull request
@mohit-s96 mohit-s96 self-assigned this Oct 3, 2024
@mohit-s96
mohit-s96 requested a review from darnjo October 3, 2024 15:49
@mohit-s96
mohit-s96 marked this pull request as ready for review October 3, 2024 15:49
@darnjo

darnjo commented Oct 28, 2024

Copy link
Copy Markdown
Member

@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

This shell argument which depends on [library input](1) is later used in a [shell command](2).

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 executeCommanderMetadataTest function to use spawn without the shell: true option.
  • Construct the arguments array properly to avoid shell interpretation.
Suggested changeset 1
lib/certification/data-dictionary/index.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/lib/certification/data-dictionary/index.js b/lib/certification/data-dictionary/index.js
--- a/lib/certification/data-dictionary/index.js
+++ b/lib/certification/data-dictionary/index.js
@@ -86,6 +86,5 @@
       join(pathToWebApiCommander, 'gradlew'),
-      ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`],
+      ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`],
       {
-        cwd: pathToWebApiCommander,
-        shell: true
+        cwd: pathToWebApiCommander
       }
EOF
@@ -86,6 +86,5 @@
join(pathToWebApiCommander, 'gradlew'),
['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`],
['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`],
{
cwd: pathToWebApiCommander,
shell: true
cwd: pathToWebApiCommander
}
Copilot is powered by AI and may make mistakes. Always verify output.
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

This shell argument which depends on [library input](1) is later used in a [shell command](2).

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 executeCommanderMetadataTest function to use spawn without the shell: true option.
  • Pass the pathToConfigFile as a separate argument in the array to avoid shell interpretation.
Suggested changeset 1
lib/certification/data-dictionary/index.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/lib/certification/data-dictionary/index.js b/lib/certification/data-dictionary/index.js
--- a/lib/certification/data-dictionary/index.js
+++ b/lib/certification/data-dictionary/index.js
@@ -86,6 +86,5 @@
       join(pathToWebApiCommander, 'gradlew'),
-      ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`],
+      ['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`],
       {
-        cwd: pathToWebApiCommander,
-        shell: true
+        cwd: pathToWebApiCommander
       }
EOF
@@ -86,6 +86,5 @@
join(pathToWebApiCommander, 'gradlew'),
['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript="${pathToConfigFile}"`],
['testDataDictionary', `-Dversion=${version}`, `-DpathToRESOScript=${pathToConfigFile}`],
{
cwd: pathToWebApiCommander,
shell: true
cwd: pathToWebApiCommander
}
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Reports for RESO Common Format Testing

3 participants