Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ jobs:
fi

- name: Add a comment on the PR with new CI failures
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inversion of logic detected. Please verify the intended behavior.

The condition for adding a comment on the PR with new CI failures has been changed from checking if env.ci_test_failed is 'true' to checking if it is not 'true'. This inverts the logic, causing a comment to be added when there are no CI test failures.

If the intention is to add a comment only when there are new CI failures, please revert the condition as follows:

-if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
+if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'

uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand All @@ -306,7 +306,7 @@ jobs:
```

- name: Add a comment on the PR when ci-test-limited is successful
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inversion of logic detected. Please verify the intended behavior.

The condition for adding a comment when the ci-test-limited job is successful has been changed from checking if env.ci_test_failed is not 'true' to checking if it is 'true'. This inverts the logic, causing a comment to be added only when there are CI test failures.

If the intention is to add a comment when the ci-test-limited job succeeds, please revert the condition as follows:

-if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'  
+if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'

uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand Down Expand Up @@ -451,7 +451,7 @@ jobs:
fi

- name: Add a comment on the PR with new CI failures
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand All @@ -465,7 +465,7 @@ jobs:
```

- name: Add a comment on the PR when ci-test-limited-existing-docker-image is success
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-limited-with-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ jobs:
cat "$FAILURE_FLAG_FILE"

- name: Trim number of cypress log files
if: always()
if: failure()
run: |
find ${{ github.workspace }}/app/client/cypress/cypress-logs -name '*.json' -type f | tail -n +11 | xargs -I {} rm -- {}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/client/cypress/scripts/.yarn/install-state.gz
Binary file not shown.
48 changes: 48 additions & 0 deletions app/client/generate_csv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# Define the folder and postfix
FOLDER="./cypress/e2e"
POSTFIX="spec.js"
OUTPUT_CSV="output.csv"

# Initialize the CSV file with headers
echo "rowNum,folder,filename,tags1,tags2,tags3,tags4,tags5,tags6,tags7,tags8,tags9" > "$OUTPUT_CSV"

# Initialize row number counter
rowNum=1

# Find all files in the folder with the specified postfix and process each one
find "$FOLDER" -name "*$POSTFIX" | while read -r file; do
# Extract the directory path and filename
dirpath=$(dirname "$file")
filename=$(basename "$file")

# Extract tags from the describe section using grep and awk
tags=$(awk -v RS='[{}]' '/tags:/ {gsub(/[["\]]/, ""); print $0}' "$file" | grep -Eo '@tag\.[A-Za-z0-9_-]+')

# Remove brackets and split tags into an array
IFS=',' read -r -a tagArray <<< "$(echo "$tags" | tr '\n' ',' | sed 's/,$//')"

# Initialize empty tag variables for up to 9 tags
tags1=""; tags2=""; tags3=""; tags4=""; tags5=""
tags6=""; tags7=""; tags8=""; tags9=""

# Assign tags to respective variables
if [ ${#tagArray[@]} -gt 0 ]; then tags1="${tagArray[0]}"; fi
if [ ${#tagArray[@]} -gt 1 ]; then tags2="${tagArray[1]}"; fi
if [ ${#tagArray[@]} -gt 2 ]; then tags3="${tagArray[2]}"; fi
if [ ${#tagArray[@]} -gt 3 ]; then tags4="${tagArray[3]}"; fi
if [ ${#tagArray[@]} -gt 4 ]; then tags5="${tagArray[4]}"; fi
if [ ${#tagArray[@]} -gt 5 ]; then tags6="${tagArray[5]}"; fi
if [ ${#tagArray[@]} -gt 6 ]; then tags7="${tagArray[6]}"; fi
if [ ${#tagArray[@]} -gt 7 ]; then tags8="${tagArray[7]}"; fi
if [ ${#tagArray[@]} -gt 8 ]; then tags9="${tagArray[8]}"; fi
Comment on lines +23 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tag assignment logic works, but let's make it more efficient and readable. 📝

  1. Replace the multiple if statements with a loop to assign tags to variables dynamically. This will reduce code duplication and make the script more maintainable.

  2. Use an array to store the tag variables instead of individual variables. This will simplify the initialization and make the code more concise.

Here's an example of how you can refactor the code:

-    # Initialize empty tag variables for up to 9 tags
-    tags1=""; tags2=""; tags3=""; tags4=""; tags5=""
-    tags6=""; tags7=""; tags8=""; tags9=""
-
-    # Assign tags to respective variables
-    if [ ${#tagArray[@]} -gt 0 ]; then tags1="${tagArray[0]}"; fi
-    if [ ${#tagArray[@]} -gt 1 ]; then tags2="${tagArray[1]}"; fi
-    if [ ${#tagArray[@]} -gt 2 ]; then tags3="${tagArray[2]}"; fi
-    if [ ${#tagArray[@]} -gt 3 ]; then tags4="${tagArray[3]}"; fi
-    if [ ${#tagArray[@]} -gt 4 ]; then tags5="${tagArray[4]}"; fi
-    if [ ${#tagArray[@]} -gt 5 ]; then tags6="${tagArray[5]}"; fi
-    if [ ${#tagArray[@]} -gt 6 ]; then tags7="${tagArray[6]}"; fi
-    if [ ${#tagArray[@]} -gt 7 ]; then tags8="${tagArray[7]}"; fi
-    if [ ${#tagArray[@]} -gt 8 ]; then tags9="${tagArray[8]}"; fi
+    # Initialize an array to store tag variables
+    tagVars=("" "" "" "" "" "" "" "" "")
+
+    # Assign tags to respective variables using a loop
+    for i in "${!tagArray[@]}"; do
+        if [ $i -lt 9 ]; then
+            tagVars[$i]="${tagArray[$i]}"
+        fi
+    done

These changes will make the script more efficient and easier to understand.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Remove brackets and split tags into an array
IFS=',' read -r -a tagArray <<< "$(echo "$tags" | tr '\n' ',' | sed 's/,$//')"
# Initialize empty tag variables for up to 9 tags
tags1=""; tags2=""; tags3=""; tags4=""; tags5=""
tags6=""; tags7=""; tags8=""; tags9=""
# Assign tags to respective variables
if [ ${#tagArray[@]} -gt 0 ]; then tags1="${tagArray[0]}"; fi
if [ ${#tagArray[@]} -gt 1 ]; then tags2="${tagArray[1]}"; fi
if [ ${#tagArray[@]} -gt 2 ]; then tags3="${tagArray[2]}"; fi
if [ ${#tagArray[@]} -gt 3 ]; then tags4="${tagArray[3]}"; fi
if [ ${#tagArray[@]} -gt 4 ]; then tags5="${tagArray[4]}"; fi
if [ ${#tagArray[@]} -gt 5 ]; then tags6="${tagArray[5]}"; fi
if [ ${#tagArray[@]} -gt 6 ]; then tags7="${tagArray[6]}"; fi
if [ ${#tagArray[@]} -gt 7 ]; then tags8="${tagArray[7]}"; fi
if [ ${#tagArray[@]} -gt 8 ]; then tags9="${tagArray[8]}"; fi
# Remove brackets and split tags into an array
IFS=',' read -r -a tagArray <<< "$(echo "$tags" | tr '\n' ',' | sed 's/,$//')"
# Initialize an array to store tag variables
tagVars=("" "" "" "" "" "" "" "" "")
# Assign tags to respective variables using a loop
for i in "${!tagArray[@]}"; do
if [ $i -lt 9 ]; then
tagVars[$i]="${tagArray[$i]}"
fi
done


# Append the data to the CSV file
echo "$rowNum,$dirpath,$filename,$tags1,$tags2,$tags3,$tags4,$tags5,$tags6,$tags7,$tags8,$tags9" >> "$OUTPUT_CSV"

# Increment row number
rowNum=$((rowNum + 1))
done

echo "CSV file created: $OUTPUT_CSV"
403 changes: 403 additions & 0 deletions app/client/output.csv

Large diffs are not rendered by default.

3,323 changes: 3,323 additions & 0 deletions app/client/scanned-files.txt

Large diffs are not rendered by default.