From b4f594aef239cfe52f1a905c73522d07b14c0337 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 14:11:57 +0530 Subject: [PATCH 01/45] test: Added a comment to check for failed lint check --- CLI/src/main/java/main/Drifty_CLI.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index d44ad21b9..381870d87 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -332,6 +332,9 @@ private static void batchDownloader() { } messageBroker.msgFilenameInfo("Retrieving filename from link..."); fileName = findFilenameInLink(link); +// if (!Objects.requireNonNull(fileName).isEmpty()) { +// messageBroker.msgFilenameInfo(FILENAME_DETECTED + "\"" + fileName + "\""); +// } } } if (isSpotifyLink && link.contains("playlist")) { From 384eaf03178ead4d3fa67b418d96f770ca063aa8 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 14:20:09 +0530 Subject: [PATCH 02/45] fix: Set continue on error option to true to upload artifacts --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a2becdbe1..26bf161d2 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,6 +21,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base uses: super-linter/super-linter/slim@v5 + continue-on-error: true env: DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 22957d8a6d41c81db72d24e38f3066ed7c49f255 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 14:32:36 +0530 Subject: [PATCH 03/45] test: Added a wrong package name to check for failed linter workflow --- CLI/src/main/java/cli/{init => init_one}/Environment.java | 2 +- CLI/src/main/java/cli/utils/Utility.java | 2 +- CLI/src/main/java/main/Drifty_CLI.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename CLI/src/main/java/cli/{init => init_one}/Environment.java (94%) diff --git a/CLI/src/main/java/cli/init/Environment.java b/CLI/src/main/java/cli/init_one/Environment.java similarity index 94% rename from CLI/src/main/java/cli/init/Environment.java rename to CLI/src/main/java/cli/init_one/Environment.java index 2c0354265..f840503a4 100644 --- a/CLI/src/main/java/cli/init/Environment.java +++ b/CLI/src/main/java/cli/init_one/Environment.java @@ -1,4 +1,4 @@ -package cli.init; +package cli.init_one; import cli.utils.MessageBroker; diff --git a/CLI/src/main/java/cli/utils/Utility.java b/CLI/src/main/java/cli/utils/Utility.java index 7c5a3304d..4d5a634ee 100644 --- a/CLI/src/main/java/cli/utils/Utility.java +++ b/CLI/src/main/java/cli/utils/Utility.java @@ -1,6 +1,6 @@ package cli.utils; -import cli.init.Environment; +import cli.init_one.Environment; import java.util.LinkedList; import java.util.Objects; diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index 381870d87..eff74f72d 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -2,7 +2,7 @@ import backend.FileDownloader; import cli.utils.MessageBroker; -import cli.init.Environment; +import cli.init_one.Environment; import org.yaml.snakeyaml.Yaml; import preferences.AppSettings; import properties.MessageType; From 6888a93cf62c05982b91271a45ebb517ef35c423 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 14:41:27 +0530 Subject: [PATCH 04/45] test: Added a wrong package name to check for failed linter workflow --- .../main/java/{backend => backend_cli}/DownloaderThread.java | 2 +- .../main/java/{backend => backend_cli}/FileDownloader.java | 2 +- .../main/java/{backend => backend_cli}/ProgressBarThread.java | 2 +- CLI/src/main/java/cli/{init_one => init}/Environment.java | 2 +- CLI/src/main/java/cli/utils/Utility.java | 2 +- CLI/src/main/java/main/Drifty_CLI.java | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) rename CLI/src/main/java/{backend => backend_cli}/DownloaderThread.java (98%) rename CLI/src/main/java/{backend => backend_cli}/FileDownloader.java (99%) rename CLI/src/main/java/{backend => backend_cli}/ProgressBarThread.java (99%) rename CLI/src/main/java/cli/{init_one => init}/Environment.java (94%) diff --git a/CLI/src/main/java/backend/DownloaderThread.java b/CLI/src/main/java/backend_cli/DownloaderThread.java similarity index 98% rename from CLI/src/main/java/backend/DownloaderThread.java rename to CLI/src/main/java/backend_cli/DownloaderThread.java index 95f6410b9..152a239c9 100644 --- a/CLI/src/main/java/backend/DownloaderThread.java +++ b/CLI/src/main/java/backend_cli/DownloaderThread.java @@ -1,4 +1,4 @@ -package backend; +package backend_cli; import java.io.FileOutputStream; import java.io.IOException; diff --git a/CLI/src/main/java/backend/FileDownloader.java b/CLI/src/main/java/backend_cli/FileDownloader.java similarity index 99% rename from CLI/src/main/java/backend/FileDownloader.java rename to CLI/src/main/java/backend_cli/FileDownloader.java index 2aed89109..52cb3184b 100644 --- a/CLI/src/main/java/backend/FileDownloader.java +++ b/CLI/src/main/java/backend_cli/FileDownloader.java @@ -1,4 +1,4 @@ -package backend; +package backend_cli; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/backend/ProgressBarThread.java b/CLI/src/main/java/backend_cli/ProgressBarThread.java similarity index 99% rename from CLI/src/main/java/backend/ProgressBarThread.java rename to CLI/src/main/java/backend_cli/ProgressBarThread.java index abe153044..9378c088c 100644 --- a/CLI/src/main/java/backend/ProgressBarThread.java +++ b/CLI/src/main/java/backend_cli/ProgressBarThread.java @@ -1,4 +1,4 @@ -package backend; +package backend_cli; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/cli/init_one/Environment.java b/CLI/src/main/java/cli/init/Environment.java similarity index 94% rename from CLI/src/main/java/cli/init_one/Environment.java rename to CLI/src/main/java/cli/init/Environment.java index f840503a4..2c0354265 100644 --- a/CLI/src/main/java/cli/init_one/Environment.java +++ b/CLI/src/main/java/cli/init/Environment.java @@ -1,4 +1,4 @@ -package cli.init_one; +package cli.init; import cli.utils.MessageBroker; diff --git a/CLI/src/main/java/cli/utils/Utility.java b/CLI/src/main/java/cli/utils/Utility.java index 4d5a634ee..7c5a3304d 100644 --- a/CLI/src/main/java/cli/utils/Utility.java +++ b/CLI/src/main/java/cli/utils/Utility.java @@ -1,6 +1,6 @@ package cli.utils; -import cli.init_one.Environment; +import cli.init.Environment; import java.util.LinkedList; import java.util.Objects; diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index eff74f72d..598ea8cc9 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -1,8 +1,8 @@ package main; -import backend.FileDownloader; +import backend_cli.FileDownloader; import cli.utils.MessageBroker; -import cli.init_one.Environment; +import cli.init.Environment; import org.yaml.snakeyaml.Yaml; import preferences.AppSettings; import properties.MessageType; From d7f344c9e182bae9f18eaf6fae45ed2029b135cb Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 16:13:56 +0530 Subject: [PATCH 05/45] feat(CI): Added Workflow summary generation support to linter CI --- .github/workflows/linter.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 26bf161d2..373f3b9b2 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -20,6 +20,7 @@ jobs: # list of changed files within `super-linter` fetch-depth: 0 - name: Lint Code Base + id: lint uses: super-linter/super-linter/slim@v5 continue-on-error: true env: @@ -40,4 +41,22 @@ jobs: uses: actions/upload-artifact@v4 with: name: linter-result - path: super-linter.log \ No newline at end of file + path: super-linter.log + - name: Generate Workflow Summary for successful run + if: ${{ steps.lint.outcome == 'success' }} + run: | + echo "## :ballot_box_with_check: Kudos! No linting errors found!" >> $GITHUB_STEP_SUMMARY + - name: Generate Workflow Summary for failed run + if: ${{ steps.lint.outcome == 'failure' }} + run: | + echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + - name: Fail Workflow for failure in linting + if: ${{ steps.lint.outcome == 'failure' }} + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + core.setFailed("Linting errors found! Please check workflow summary for details.") \ No newline at end of file From 57254103b67026f35a8fa992c8284178b2e00750 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 16:18:44 +0530 Subject: [PATCH 06/45] revert: Reverted back the changes made solely for testing CI --- .../main/java/{backend_cli => backend}/DownloaderThread.java | 2 +- .../main/java/{backend_cli => backend}/FileDownloader.java | 2 +- .../java/{backend_cli => backend}/ProgressBarThread.java | 2 +- CLI/src/main/java/main/Drifty_CLI.java | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) rename CLI/src/main/java/{backend_cli => backend}/DownloaderThread.java (98%) rename CLI/src/main/java/{backend_cli => backend}/FileDownloader.java (99%) rename CLI/src/main/java/{backend_cli => backend}/ProgressBarThread.java (99%) diff --git a/CLI/src/main/java/backend_cli/DownloaderThread.java b/CLI/src/main/java/backend/DownloaderThread.java similarity index 98% rename from CLI/src/main/java/backend_cli/DownloaderThread.java rename to CLI/src/main/java/backend/DownloaderThread.java index 152a239c9..95f6410b9 100644 --- a/CLI/src/main/java/backend_cli/DownloaderThread.java +++ b/CLI/src/main/java/backend/DownloaderThread.java @@ -1,4 +1,4 @@ -package backend_cli; +package backend; import java.io.FileOutputStream; import java.io.IOException; diff --git a/CLI/src/main/java/backend_cli/FileDownloader.java b/CLI/src/main/java/backend/FileDownloader.java similarity index 99% rename from CLI/src/main/java/backend_cli/FileDownloader.java rename to CLI/src/main/java/backend/FileDownloader.java index 52cb3184b..2aed89109 100644 --- a/CLI/src/main/java/backend_cli/FileDownloader.java +++ b/CLI/src/main/java/backend/FileDownloader.java @@ -1,4 +1,4 @@ -package backend_cli; +package backend; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/backend_cli/ProgressBarThread.java b/CLI/src/main/java/backend/ProgressBarThread.java similarity index 99% rename from CLI/src/main/java/backend_cli/ProgressBarThread.java rename to CLI/src/main/java/backend/ProgressBarThread.java index 9378c088c..abe153044 100644 --- a/CLI/src/main/java/backend_cli/ProgressBarThread.java +++ b/CLI/src/main/java/backend/ProgressBarThread.java @@ -1,4 +1,4 @@ -package backend_cli; +package backend; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index 598ea8cc9..d44ad21b9 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -1,6 +1,6 @@ package main; -import backend_cli.FileDownloader; +import backend.FileDownloader; import cli.utils.MessageBroker; import cli.init.Environment; import org.yaml.snakeyaml.Yaml; @@ -332,9 +332,6 @@ private static void batchDownloader() { } messageBroker.msgFilenameInfo("Retrieving filename from link..."); fileName = findFilenameInLink(link); -// if (!Objects.requireNonNull(fileName).isEmpty()) { -// messageBroker.msgFilenameInfo(FILENAME_DETECTED + "\"" + fileName + "\""); -// } } } if (isSpotifyLink && link.contains("playlist")) { From 4e2f6ad2968d3fd2d200de8026f27715efeae346 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 16:31:47 +0530 Subject: [PATCH 07/45] fix: added ansi-remover --- .github/workflows/linter.yml | 15 +++++++++++++-- .../DownloaderThread.java | 2 +- .../{backend => backend_cli}/FileDownloader.java | 2 +- .../ProgressBarThread.java | 2 +- CLI/src/main/java/main/Drifty_CLI.java | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) rename CLI/src/main/java/{backend => backend_cli}/DownloaderThread.java (98%) rename CLI/src/main/java/{backend => backend_cli}/FileDownloader.java (99%) rename CLI/src/main/java/{backend => backend_cli}/ProgressBarThread.java (99%) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 373f3b9b2..fd02f04f7 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -46,12 +46,23 @@ jobs: if: ${{ steps.lint.outcome == 'success' }} run: | echo "## :ballot_box_with_check: Kudos! No linting errors found!" >> $GITHUB_STEP_SUMMARY - - name: Generate Workflow Summary for failed run + - name: Generate Workflow Summary for failed run part 1 + id: error if: ${{ steps.lint.outcome == 'failure' }} run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' >> $GITHUB_STEP_SUMMARY + log=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//') + echo "log=$log" >> $GITHUB_ENV + - name: Remove ANSI color escape sequences + uses: marcransome/remove-ansi-colors@v1 + id: remove-ansi-colors + with: + colored: ${{ steps.error.outputs.log }} + - name: Generate Workflow Summary for failed run part 2 + if: ${{ steps.lint.outcome == 'failure' }} + run: | + echo "${{ steps.remove-ansi-colors.outputs.uncolored }}" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} diff --git a/CLI/src/main/java/backend/DownloaderThread.java b/CLI/src/main/java/backend_cli/DownloaderThread.java similarity index 98% rename from CLI/src/main/java/backend/DownloaderThread.java rename to CLI/src/main/java/backend_cli/DownloaderThread.java index 95f6410b9..152a239c9 100644 --- a/CLI/src/main/java/backend/DownloaderThread.java +++ b/CLI/src/main/java/backend_cli/DownloaderThread.java @@ -1,4 +1,4 @@ -package backend; +package backend_cli; import java.io.FileOutputStream; import java.io.IOException; diff --git a/CLI/src/main/java/backend/FileDownloader.java b/CLI/src/main/java/backend_cli/FileDownloader.java similarity index 99% rename from CLI/src/main/java/backend/FileDownloader.java rename to CLI/src/main/java/backend_cli/FileDownloader.java index 2aed89109..52cb3184b 100644 --- a/CLI/src/main/java/backend/FileDownloader.java +++ b/CLI/src/main/java/backend_cli/FileDownloader.java @@ -1,4 +1,4 @@ -package backend; +package backend_cli; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/backend/ProgressBarThread.java b/CLI/src/main/java/backend_cli/ProgressBarThread.java similarity index 99% rename from CLI/src/main/java/backend/ProgressBarThread.java rename to CLI/src/main/java/backend_cli/ProgressBarThread.java index abe153044..9378c088c 100644 --- a/CLI/src/main/java/backend/ProgressBarThread.java +++ b/CLI/src/main/java/backend_cli/ProgressBarThread.java @@ -1,4 +1,4 @@ -package backend; +package backend_cli; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index d44ad21b9..b50f7c213 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -1,6 +1,6 @@ package main; -import backend.FileDownloader; +import backend_cli.FileDownloader; import cli.utils.MessageBroker; import cli.init.Environment; import org.yaml.snakeyaml.Yaml; From 1102c196d38653df05f9941b65af6e13491a9d2b Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 16:41:07 +0530 Subject: [PATCH 08/45] fix: added ansi-remover --- .github/workflows/linter.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index fd02f04f7..c4a03b718 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -51,14 +51,13 @@ jobs: if: ${{ steps.lint.outcome == 'failure' }} run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - log=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//') - echo "log=$log" >> $GITHUB_ENV + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "log=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//')" >> $GITHUB_ENV - name: Remove ANSI color escape sequences uses: marcransome/remove-ansi-colors@v1 id: remove-ansi-colors with: - colored: ${{ steps.error.outputs.log }} + colored: $log - name: Generate Workflow Summary for failed run part 2 if: ${{ steps.lint.outcome == 'failure' }} run: | From 95a6e518230e3b4752d43c80c8235281e9b9167f Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 16:49:26 +0530 Subject: [PATCH 09/45] feat(CI): Added Workflow summary generation support to linter CI --- .github/workflows/linter.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index c4a03b718..717ed8512 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -46,22 +46,12 @@ jobs: if: ${{ steps.lint.outcome == 'success' }} run: | echo "## :ballot_box_with_check: Kudos! No linting errors found!" >> $GITHUB_STEP_SUMMARY - - name: Generate Workflow Summary for failed run part 1 - id: error + - name: Generate Workflow Summary for failed run if: ${{ steps.lint.outcome == 'failure' }} run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - echo "log=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//')" >> $GITHUB_ENV - - name: Remove ANSI color escape sequences - uses: marcransome/remove-ansi-colors@v1 - id: remove-ansi-colors - with: - colored: $log - - name: Generate Workflow Summary for failed run part 2 - if: ${{ steps.lint.outcome == 'failure' }} - run: | - echo "${{ steps.remove-ansi-colors.outputs.uncolored }}" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} From fc11ee245f7efc0dee686a77f683552d02c91902 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 16:58:10 +0530 Subject: [PATCH 10/45] feat(CI): Added Workflow summary generation support to linter CI --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 717ed8512..458c74bda 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -51,7 +51,7 @@ jobs: run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" >> $GITHUB_STEP_SUMMARY + cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/�\[0m�\[0\;31m�\[0m�\[0m//" | head -n -1 >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} From b58d0710f19d975bc1fff74edbeefa22f43b97c0 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 17:05:45 +0530 Subject: [PATCH 11/45] feat(CI): Added Workflow summary generation support to linter CI --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 458c74bda..2a0178fd0 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -51,7 +51,7 @@ jobs: run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/�\[0m�\[0\;31m�\[0m�\[0m//" | head -n -1 >> $GITHUB_STEP_SUMMARY + cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g | head -n -1 | sed '1,2d' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} From ddb2a5a8470634a101eee948f5bc1b65bd7acf1f Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 21:07:38 +0530 Subject: [PATCH 12/45] fix(CI): Fixed extra newlines in workflow summary --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 2a0178fd0..f3b9c3701 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -51,7 +51,7 @@ jobs: run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g | head -n -1 | sed '1,2d' >> $GITHUB_STEP_SUMMARY + cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} From 101792aa3ed3e62a7b9ca52205ed15dafcd2e672 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 21:19:37 +0530 Subject: [PATCH 13/45] fix(CI): Fixed extra newlines in workflow summary --- .github/workflows/linter.yml | 2 +- CLI/src/main/java/main/Drifty_CLI.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f3b9c3701..3ccc2e866 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -51,7 +51,7 @@ jobs: run: | echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' >> $GITHUB_STEP_SUMMARY + cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index b50f7c213..5c7f087cc 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -332,6 +332,7 @@ private static void batchDownloader() { } messageBroker.msgFilenameInfo("Retrieving filename from link..."); fileName = findFilenameInLink(link); +// System.out.println(fileName); } } if (isSpotifyLink && link.contains("playlist")) { From e47caf03da28e94e0b2d0ccac637f7e77fa09072 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 21:33:23 +0530 Subject: [PATCH 14/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 3ccc2e866..29bd54eda 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -53,6 +53,15 @@ jobs: echo "\`\`\`" >> $GITHUB_STEP_SUMMARY cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + - name: Comment on PR for failed run + if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} + run: | + export COMMENT_BODY="## :negative_squared_cross_mark: Linting errors found!\n\n\`\`\`\n" + export COMMENT_BODY+=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') + export COMMENT_BODY+="\n\`\`\`" + gh pr comment ${{ github.event.number }} --body "@${{ github.actor }} $COMMENT_BODY" + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From 37d8d98306db9fe704a7a79dc2e0e4b3e597308e Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 11 Jan 2024 21:35:20 +0530 Subject: [PATCH 15/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 29bd54eda..0723ecaaa 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -60,8 +60,8 @@ jobs: export COMMENT_BODY+=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') export COMMENT_BODY+="\n\`\`\`" gh pr comment ${{ github.event.number }} --body "@${{ github.actor }} $COMMENT_BODY" - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GH_TOKEN: ${{ github.token }} - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From 12fc2251c8e3ae1adda915ae5aaf56af45c9cfb8 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 00:04:19 +0530 Subject: [PATCH 16/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0723ecaaa..0dcf34e49 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -49,19 +49,23 @@ jobs: - name: Generate Workflow Summary for failed run if: ${{ steps.lint.outcome == 'failure' }} run: | + echo "COMMENT_BODY=\`cat super-linter.log | grep \"\[ERROR\]\" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR\]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r \"s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g\" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///'\`\n" >> $GITHUB_ENV echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Comment on PR for failed run if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} - run: | - export COMMENT_BODY="## :negative_squared_cross_mark: Linting errors found!\n\n\`\`\`\n" - export COMMENT_BODY+=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - export COMMENT_BODY+="\n\`\`\`" - gh pr comment ${{ github.event.number }} --body "@${{ github.actor }} $COMMENT_BODY" - env: - GH_TOKEN: ${{ github.token }} + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: process.env.COMMENT_BODY + }) - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From a72d84987c5b6af0660fca138e4071216c687ded Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 00:14:21 +0530 Subject: [PATCH 17/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0dcf34e49..92df2e573 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -60,7 +60,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - github.issues.createComment({ + github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, From 58bab179542b5b6e0ebe6439d22e57100ffdf8f3 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 00:27:24 +0530 Subject: [PATCH 18/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 92df2e573..727792485 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -49,23 +49,21 @@ jobs: - name: Generate Workflow Summary for failed run if: ${{ steps.lint.outcome == 'failure' }} run: | - echo "COMMENT_BODY=\`cat super-linter.log | grep \"\[ERROR\]\" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR\]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r \"s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g\" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///'\`\n" >> $GITHUB_ENV + echo "COMMENT_BODY=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///')" >> $GITHUB_ENV echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Comment on PR for failed run if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} - uses: actions/github-script@v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: process.env.COMMENT_BODY - }) + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/OWNER/REPO/pulls/PULL_NUMBER/comments \ + -d "{\"body\": \"$COMMENT_BODY\"}" - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From 81b2f2a40fdd4914fe027835679ed440411157b2 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 00:36:45 +0530 Subject: [PATCH 19/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 727792485..f33dc3c06 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -49,7 +49,6 @@ jobs: - name: Generate Workflow Summary for failed run if: ${{ steps.lint.outcome == 'failure' }} run: | - echo "COMMENT_BODY=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///')" >> $GITHUB_ENV echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///' >> $GITHUB_STEP_SUMMARY @@ -57,6 +56,7 @@ jobs: - name: Comment on PR for failed run if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} run: | + COMMENT_BODY=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ From 4777bc776c32358d758c8a476dce11e2c5d5c643 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 00:46:21 +0530 Subject: [PATCH 20/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f33dc3c06..846517e91 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -62,8 +62,8 @@ jobs: -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/OWNER/REPO/pulls/PULL_NUMBER/comments \ - -d "{\"body\": \"$COMMENT_BODY\"}" + https://api.github.com/repos/OWNER/REPO/issues/${{ github.event.pull_request.number }}/comments \ + -d "{\"body\": \"## :negative_squared_cross_mark: Linting errors found! \n\`\`\`\n$COMMENT_BODY\n\`\`\`\"}" - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From b037c6337ee8fdd689f4caa916230fb6ac81b8bf Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 08:32:33 +0530 Subject: [PATCH 21/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 846517e91..81d18a462 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -57,13 +57,14 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} run: | COMMENT_BODY=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') + echo $COMMENT_BODY curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/issues/${{ github.event.pull_request.number }}/comments \ - -d "{\"body\": \"## :negative_squared_cross_mark: Linting errors found! \n\`\`\`\n$COMMENT_BODY\n\`\`\`\"}" + -d "## :negative_squared_cross_mark: Linting errors found! \n\`\`\` \n$COMMENT_BODY \n\`\`\`" - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From f5b6042cc7a295105998611481add8d29109a3c7 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 08:41:39 +0530 Subject: [PATCH 22/45] feat(CI): Added PR comment code --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 81d18a462..4f625dba9 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -63,8 +63,8 @@ jobs: -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/OWNER/REPO/issues/${{ github.event.pull_request.number }}/comments \ - -d "## :negative_squared_cross_mark: Linting errors found! \n\`\`\` \n$COMMENT_BODY \n\`\`\`" + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -d '{"body": "## :negative_squared_cross_mark: Linting errors found!\n\`\`\`\n'"$COMMENT_BODY"'\n\`\`\`"}' - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From 3b2563d1f4875a9dbd9545ca42cfc6f5de7d04bd Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 10:11:32 +0530 Subject: [PATCH 23/45] feat(CI): Added PR comment permission --- .github/workflows/linter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 4f625dba9..404819ddf 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -12,6 +12,8 @@ jobs: contents: read packages: read statuses: write + pull-requests: write + issues: write steps: - name: Checkout Code uses: actions/checkout@v4 From 87e2025fe4e0a9c2d4dd7dfecfb6c735c4399781 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 10:29:42 +0530 Subject: [PATCH 24/45] feat(CI): Added PR comment permission --- .github/workflows/linter.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 404819ddf..25ff52946 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -12,7 +12,6 @@ jobs: contents: read packages: read statuses: write - pull-requests: write issues: write steps: - name: Checkout Code @@ -66,7 +65,7 @@ jobs: -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ - -d '{"body": "## :negative_squared_cross_mark: Linting errors found!\n\`\`\`\n'"$COMMENT_BODY"'\n\`\`\`"}' + -d "{\"body\": \"## :negative_squared_cross_mark: Linting errors found! \n\`\`\`\n$COMMENT_BODY\n\`\`\`\n\"}" - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From 98ccef58402e5c0ad42d94b0e6b43c2639a23eea Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 10:42:25 +0530 Subject: [PATCH 25/45] feat(CI): Added PR comment permission --- .github/workflows/linter.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 25ff52946..1f9837f5b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -8,11 +8,7 @@ jobs: build: name: Lint Code Base runs-on: ubuntu-latest - permissions: - contents: read - packages: read - statuses: write - issues: write + permissions: write-all steps: - name: Checkout Code uses: actions/checkout@v4 From d04ed94894744ef7d3b7a04840e3c51a877a1fea Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 10:56:20 +0530 Subject: [PATCH 26/45] feat(CI): Added PR comment permission --- .github/workflows/linter.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1f9837f5b..1384636b3 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -55,13 +55,14 @@ jobs: run: | COMMENT_BODY=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') echo $COMMENT_BODY - curl -L \ - -X POST \ + gh api \ + --method POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ - -d "{\"body\": \"## :negative_squared_cross_mark: Linting errors found! \n\`\`\`\n$COMMENT_BODY\n\`\`\`\n\"}" + /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -f body="## :negative_squared_cross_mark: Linting errors found!\n\`\`\`\n${COMMENT_BODY}\n\`\`\`" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail Workflow for failure in linting if: ${{ steps.lint.outcome == 'failure' }} uses: actions/github-script@v7.0.1 From 926bf7ca1aca394eda84c07a1eba3b1eb2428978 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 11:18:32 +0530 Subject: [PATCH 27/45] feat(CI): Added PR comment permission --- .github/workflows/linter.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1384636b3..ce6ae8e6d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -60,7 +60,10 @@ jobs: -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ - -f body="## :negative_squared_cross_mark: Linting errors found!\n\`\`\`\n${COMMENT_BODY}\n\`\`\`" + -f body="## :negative_squared_cross_mark: Linting errors found! \ + \`\`\` \ + $COMMENT_BODY \ + \`\`\`" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail Workflow for failure in linting From c5b21ee04bde03680696542cd3e84e93fa66d20f Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 11:55:39 +0530 Subject: [PATCH 28/45] feat(CI): Added PR comment permission --- .github/workflows/linter.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ce6ae8e6d..a3b2f5fd6 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -53,17 +53,16 @@ jobs: - name: Comment on PR for failed run if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} run: | - COMMENT_BODY=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') + COMMENT_INITIAL=$(echo "## :negative_squared_cross_mark: Linting errors found!\n\`\`\`\n") + COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') + COMMENT_END=$(echo "\n\`\`\`") echo $COMMENT_BODY gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ - -f body="## :negative_squared_cross_mark: Linting errors found! \ - \`\`\` \ - $COMMENT_BODY \ - \`\`\`" + -f body="$COMMENT_INITIAL$COMMENT_MIDDLE$COMMENT_END" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail Workflow for failure in linting From 2c00aa123127df7cb2ec5cdd0671f8634f2c7e59 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 12:08:36 +0530 Subject: [PATCH 29/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a3b2f5fd6..0587de41e 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -46,23 +46,23 @@ jobs: - name: Generate Workflow Summary for failed run if: ${{ steps.lint.outcome == 'failure' }} run: | - echo "## :negative_squared_cross_mark: Linting errors found!" >> $GITHUB_STEP_SUMMARY + echo "## :x: Linting errors found!" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///' >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Comment on PR for failed run if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} run: | - COMMENT_INITIAL=$(echo "## :negative_squared_cross_mark: Linting errors found!\n\`\`\`\n") + COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:\n\`\`\`") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') COMMENT_END=$(echo "\n\`\`\`") - echo $COMMENT_BODY + COMMENT_BODY=$(echo "$COMMENT_INITIAL$COMMENT_MIDDLE$COMMENT_END") gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ - -f body="$COMMENT_INITIAL$COMMENT_MIDDLE$COMMENT_END" + -f body="$COMMENT_BODY" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail Workflow for failure in linting From 0865da852e63120b4c656d34ee4a996eaa94f53a Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 12:16:21 +0530 Subject: [PATCH 30/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0587de41e..a7d25f227 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -52,6 +52,7 @@ jobs: echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - name: Comment on PR for failed run if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} + shell: bash run: | COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:\n\`\`\`") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') From 63b033b863673c083187f02d11d1545006a2ab61 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 12:29:03 +0530 Subject: [PATCH 31/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a7d25f227..d20d4f547 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,9 +54,9 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:\n\`\`\`") + COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:
\`\`\`") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_END=$(echo "\n\`\`\`") + COMMENT_END=$(echo "
\`\`\`") COMMENT_BODY=$(echo "$COMMENT_INITIAL$COMMENT_MIDDLE$COMMENT_END") gh api \ --method POST \ From 0a567c55782efd18312a3e57a6177897e4d8b5a4 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 12:38:50 +0530 Subject: [PATCH 32/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index d20d4f547..3f327f2d7 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,10 +54,9 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:
\`\`\`") + COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors: ") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_END=$(echo "
\`\`\`") - COMMENT_BODY=$(echo "$COMMENT_INITIAL$COMMENT_MIDDLE$COMMENT_END") + COMMENT_BODY=$(echo "$COMMENT_INITIAL
\`\`\`
$COMMENT_MIDDLE
\`\`\`") gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ From d3c571df05a3cbe529e91ad46fee839ce544116e Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 12:50:56 +0530 Subject: [PATCH 33/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 3f327f2d7..b533dbd91 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,7 +54,7 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors: ") + COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:
") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') COMMENT_BODY=$(echo "$COMMENT_INITIAL
\`\`\`
$COMMENT_MIDDLE
\`\`\`") gh api \ From 424608793258be4b23d40f59734133ef11bc13d2 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 12:53:45 +0530 Subject: [PATCH 34/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b533dbd91..bd54f47e5 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,9 +54,9 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:
") + COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:
") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_BODY=$(echo "$COMMENT_INITIAL
\`\`\`
$COMMENT_MIDDLE
\`\`\`") + COMMENT_BODY=$(echo "$COMMENT_INITIAL\`\`\`
$COMMENT_MIDDLE
\`\`\`") gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ From e33da4a51bbe8e78e2d3741a8a2b506601d0f250 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 13:08:02 +0530 Subject: [PATCH 35/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index bd54f47e5..883d603f0 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,7 +54,7 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors:
") + COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors: ") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') COMMENT_BODY=$(echo "$COMMENT_INITIAL\`\`\`
$COMMENT_MIDDLE
\`\`\`") gh api \ From a310eb10b898beff00aee2dec27667cb3b2ebb6e Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 13:51:39 +0530 Subject: [PATCH 36/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 883d603f0..14c706c11 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,15 +54,16 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo "## :x: Linting errors found. Please fix the following errors: ") + COMMENT_INITIAL=$(echo -e "## :x: Linting errors found. Please fix the following errors:\n") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_BODY=$(echo "$COMMENT_INITIAL\`\`\`
$COMMENT_MIDDLE
\`\`\`") + COMMENT_BODY=$(echo -e "$COMMENT_INITIAL\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") + COMMENT=$(echo "$COMMENT_BODY") gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ - -f body="$COMMENT_BODY" + -f body="$COMMENT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail Workflow for failure in linting From 58b0df7e2fb0a4459e271a99aa4da73d2806a459 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 14:07:15 +0530 Subject: [PATCH 37/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 14c706c11..792fe4d39 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -56,7 +56,7 @@ jobs: run: | COMMENT_INITIAL=$(echo -e "## :x: Linting errors found. Please fix the following errors:\n") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_BODY=$(echo -e "$COMMENT_INITIAL\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") + COMMENT_BODY=$(echo -e "$COMMENT_INITIAL\n\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") COMMENT=$(echo "$COMMENT_BODY") gh api \ --method POST \ From 9afcb6400f65364c2a27a166326bb695a9ddc74d Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 14:45:27 +0530 Subject: [PATCH 38/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 792fe4d39..09407e778 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -54,9 +54,9 @@ jobs: if: ${{ steps.lint.outcome == 'failure' && github.event_name == 'pull_request' }} shell: bash run: | - COMMENT_INITIAL=$(echo -e "## :x: Linting errors found. Please fix the following errors:\n") + COMMENT_INITIAL=$(echo -e "## :x: Linting errors found!\n") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_BODY=$(echo -e "$COMMENT_INITIAL\n\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") + COMMENT_BODY=$(echo -e "$COMMENT_INITIAL @${{ github.actor }} Please fix the following errors:\n\n\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") COMMENT=$(echo "$COMMENT_BODY") gh api \ --method POST \ From fac092a5e4879471851ad4462f1ad17819c21f71 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 15:21:26 +0530 Subject: [PATCH 39/45] fix(CI): Fixed gh pr comment formatting issue --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 09407e778..f068cdb4b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -56,7 +56,7 @@ jobs: run: | COMMENT_INITIAL=$(echo -e "## :x: Linting errors found!\n") COMMENT_MIDDLE=$(cat super-linter.log | grep "\[ERROR]" | sed 's/[0-9A-Z:.-]\+ [0-9:]\+ //' | sed 's/\[ERROR]//' | sed 's/ //' | sed 's/Found errors in \[[A-Za-z]\+\] linter!//' | sed 's/Error code: 1. Command output://' | sed 's/ //' | sed 's/ERRORSFOUND//' | sed 's/ in [A-Z:]\+//' | sed 's/[[0-9]\+]//' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" | sed '1,2d' | tr -s '\n' '\n' | sed 's/\/github\/workspace\///') - COMMENT_BODY=$(echo -e "$COMMENT_INITIAL @${{ github.actor }} Please fix the following errors:\n\n\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") + COMMENT_BODY=$(echo -e "$COMMENT_INITIAL \n @${{ github.actor }} Please fix the following errors:\n\n\`\`\`\n$COMMENT_MIDDLE\n\`\`\`") COMMENT=$(echo "$COMMENT_BODY") gh api \ --method POST \ From 728a072fc834c2486c1258ae0ac0c5905b4de32c Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 15:49:19 +0530 Subject: [PATCH 40/45] feat(CI): Added limit to run only the latest trigger --- .github/workflows/linter.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f068cdb4b..9e286aa10 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Lint Code Base From ece184c514f591c9591c3acda9f9421af60f84cb Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 15:53:44 +0530 Subject: [PATCH 41/45] feat(CI): Added limit to run only the latest trigger --- .github/workflows/linter.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 9e286aa10..7bac360ea 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,14 +5,19 @@ on: pull_request: concurrency: - group: ${{ github.ref }} + group: ${{ github.event.pull_request.number }} cancel-in-progress: true jobs: build: name: Lint Code Base runs-on: ubuntu-latest - permissions: write-all + permissions: + contents: write + pull-requests: write + issues: write + statuses: write + packages: read steps: - name: Checkout Code uses: actions/checkout@v4 From 470ff8d63ae7147556749cb16f307a5c1cc1aee4 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 15:57:28 +0530 Subject: [PATCH 42/45] feat(CI): Added limit to run only the latest trigger --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 7bac360ea..9a753fae7 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,7 +5,7 @@ on: pull_request: concurrency: - group: ${{ github.event.pull_request.number }} + group: ${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: From 654e8883d0c406c37c52de48f8cb11186e6f6593 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 16:11:44 +0530 Subject: [PATCH 43/45] revert: Reverted back the changes made solely for testing CI --- .../main/java/{backend_cli => backend}/DownloaderThread.java | 2 +- CLI/src/main/java/{backend_cli => backend}/FileDownloader.java | 2 +- .../main/java/{backend_cli => backend}/ProgressBarThread.java | 2 +- CLI/src/main/java/main/Drifty_CLI.java | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) rename CLI/src/main/java/{backend_cli => backend}/DownloaderThread.java (98%) rename CLI/src/main/java/{backend_cli => backend}/FileDownloader.java (99%) rename CLI/src/main/java/{backend_cli => backend}/ProgressBarThread.java (99%) diff --git a/CLI/src/main/java/backend_cli/DownloaderThread.java b/CLI/src/main/java/backend/DownloaderThread.java similarity index 98% rename from CLI/src/main/java/backend_cli/DownloaderThread.java rename to CLI/src/main/java/backend/DownloaderThread.java index 152a239c9..95f6410b9 100644 --- a/CLI/src/main/java/backend_cli/DownloaderThread.java +++ b/CLI/src/main/java/backend/DownloaderThread.java @@ -1,4 +1,4 @@ -package backend_cli; +package backend; import java.io.FileOutputStream; import java.io.IOException; diff --git a/CLI/src/main/java/backend_cli/FileDownloader.java b/CLI/src/main/java/backend/FileDownloader.java similarity index 99% rename from CLI/src/main/java/backend_cli/FileDownloader.java rename to CLI/src/main/java/backend/FileDownloader.java index 52cb3184b..2aed89109 100644 --- a/CLI/src/main/java/backend_cli/FileDownloader.java +++ b/CLI/src/main/java/backend/FileDownloader.java @@ -1,4 +1,4 @@ -package backend_cli; +package backend; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/backend_cli/ProgressBarThread.java b/CLI/src/main/java/backend/ProgressBarThread.java similarity index 99% rename from CLI/src/main/java/backend_cli/ProgressBarThread.java rename to CLI/src/main/java/backend/ProgressBarThread.java index 9378c088c..abe153044 100644 --- a/CLI/src/main/java/backend_cli/ProgressBarThread.java +++ b/CLI/src/main/java/backend/ProgressBarThread.java @@ -1,4 +1,4 @@ -package backend_cli; +package backend; import cli.utils.Utility; import init.Environment; diff --git a/CLI/src/main/java/main/Drifty_CLI.java b/CLI/src/main/java/main/Drifty_CLI.java index 5c7f087cc..d44ad21b9 100644 --- a/CLI/src/main/java/main/Drifty_CLI.java +++ b/CLI/src/main/java/main/Drifty_CLI.java @@ -1,6 +1,6 @@ package main; -import backend_cli.FileDownloader; +import backend.FileDownloader; import cli.utils.MessageBroker; import cli.init.Environment; import org.yaml.snakeyaml.Yaml; @@ -332,7 +332,6 @@ private static void batchDownloader() { } messageBroker.msgFilenameInfo("Retrieving filename from link..."); fileName = findFilenameInLink(link); -// System.out.println(fileName); } } if (isSpotifyLink && link.contains("playlist")) { From 5f35435ccdea166e5a3b55e7b876e97214817404 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 16:20:23 +0530 Subject: [PATCH 44/45] chore: Changed the summary for successful run of linter --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 9a753fae7..12536edfe 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -51,7 +51,7 @@ jobs: - name: Generate Workflow Summary for successful run if: ${{ steps.lint.outcome == 'success' }} run: | - echo "## :ballot_box_with_check: Kudos! No linting errors found!" >> $GITHUB_STEP_SUMMARY + echo "## :ballot_box_with_check: Linting passed!" >> $GITHUB_STEP_SUMMARY - name: Generate Workflow Summary for failed run if: ${{ steps.lint.outcome == 'failure' }} run: | From b85a57d40d1d96dba82e66bc0ca98fa582b34559 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 12 Jan 2024 16:42:07 +0530 Subject: [PATCH 45/45] fix: Fixed failure in running Build CI in source branch if it is triggered in PR --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0322a8082..0f66159e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ on: type: boolean concurrency: - group: ${{ github.ref }} + group: ${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: