From 4e5dc0aa2fa1842458bcef044ea872e8231fee0a Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 19:51:43 +0100 Subject: [PATCH 01/14] add check for .md file changes to github workflow file filters --- .github/file-filters.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index eb0791ffa..c4168974b 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -11,3 +11,6 @@ webapp: &webapp - '.github/workflows/test-webapp.yml' - 'webapp/**/*' - 'package.json' + + markdown-files: &markdown-files + - '**/*.md' From b69166ff5036a452c44e691411f97994d6c0fd9a Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 19:53:53 +0100 Subject: [PATCH 02/14] add markdown link check config file to github workflows --- .github/workflows/mlc_config.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/mlc_config.json diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json new file mode 100644 index 000000000..dd9c81f3c --- /dev/null +++ b/.github/workflows/mlc_config.json @@ -0,0 +1,12 @@ +{ + "timeout": "20s", + "retryOn429": true, + "retryCount": 2, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206], + "ignorePatterns": [ + { + "pattern": "^(https:\/\/github.com\/Ocelot-Social-Community\/Ocelot-Social\/pull\/|http:\/\/localhost)" + } + ] +} From 089369a48c1761ab62367bfe7ecff624fa7f1c18 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 19:56:43 +0100 Subject: [PATCH 03/14] add workflow to validate against .md file changes --- .github/workflows/check-documentation.yml | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/check-documentation.yml diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml new file mode 100644 index 000000000..e75224ce4 --- /dev/null +++ b/.github/workflows/check-documentation.yml @@ -0,0 +1,77 @@ +name: ocelot.social check documentation + +on: + push: + branches: + - trigger-docs.ocelot.social-deployment-by-markdown-file-changes-in-master-branch + +jobs: + files-changed: + name: Detect File Changes - Markdown files + runs-on: ubuntu-latest + outputs: + markdown-files: ${{ steps.changes.outputs.markdown-files }} + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Check for markdown file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + check-summary: + name: Check documentation summary + if: needs.files-changed.outputs.markdown-files == 'true' + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Check, if all .md files listed in SUMMARY.dm exist in current branch + run: | + if [ ! -f "SUMMARY.md" ]; then + echo "The file SUMMARY.md does not exist." + exit 1 + fi + + md_files=$(grep -o -P '\[[^\]]+\]\(([^)]+\.md)\)' SUMMARY.md | sed -r 's/.*\(([^)]+)\)/\1/') + missing_files=() + + for file in $md_files; do + if [ ! -f "$file" ]; then + missing_files+=("$file") + fi + done + + if [ ${#missing_files[@]} -eq 0 ]; then + echo "All .md files listed in SUMMARY.dm exist." + else + echo "These files listed in SUMMARY.dm do not exist:" + for missing_file in "${missing_files[@]}"; do + echo "$missing_file" + done + exit 1 + fi + + check-markdown-links: + name: Check Markdown links + if: needs.files-changed.outputs.markdown-files == 'true' + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Check Markdown Links + uses: gaurav-nelson/github-action-markdown-link-check@master + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'no' + check-modified-files-only: 'no' + config-file: '.github/workflows/mlc_config.json' + base-branch: 'trigger-docs.ocelot.social-deployment-by-markdown-file-changes-in-master-branch' # set to branch of current PR's branch + folder-path: '.' From bab306aad57d45d8233f4ab5dc59d89c0954f45b Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 19:56:43 +0100 Subject: [PATCH 04/14] add workflow to validate against .md file changes --- .github/file-filters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index c4168974b..7dd58c68f 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -12,5 +12,5 @@ webapp: &webapp - 'webapp/**/*' - 'package.json' - markdown-files: &markdown-files +markdown-files: &markdown-files - '**/*.md' From 7a93afcc00db7c74bf8e91314dc8443882fcf884 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 19:56:43 +0100 Subject: [PATCH 05/14] add workflow to validate against .md file changes --- .github/workflows/check-documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index e75224ce4..66e2df5e4 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -71,6 +71,7 @@ jobs: with: use-quiet-mode: 'yes' use-verbose-mode: 'no' + # at any .md file change take the chance to check the links in all .md files check-modified-files-only: 'no' config-file: '.github/workflows/mlc_config.json' base-branch: 'trigger-docs.ocelot.social-deployment-by-markdown-file-changes-in-master-branch' # set to branch of current PR's branch From 3a209e3364c962f038ba288448dc2acbfc77ab37 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 20:13:11 +0100 Subject: [PATCH 06/14] change SUMMARY.md for testing --- SUMMARY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUMMARY.md b/SUMMARY.md index 097da9986..e93708a3d 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -14,6 +14,7 @@ * [Testing Guide](testing.md) * [End-to-end Tests](cypress/README.md) * [Webapp (Frontend) Tests](webapp/testing.md) + * [TEST](webapp/TEST/TEST/TEST/testing.md) * [Backend Tests](backend/testing.md) * [Deployment](deployment/README.md) * [Contributing](CONTRIBUTING.md) From 8e90cbeab8ec38787c3ea9dc8b47dbf7dcd31685 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 20:14:47 +0100 Subject: [PATCH 07/14] change backend/testing.md for testing --- backend/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/testing.md b/backend/testing.md index a246569e5..de4329384 100644 --- a/backend/testing.md +++ b/backend/testing.md @@ -1,3 +1,3 @@ # Unit Testing - +# TEST ***TODO:** To be filled in* From 4749d648b8be59bb1ff31630bbd1884975de453b Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 20:16:35 +0100 Subject: [PATCH 08/14] set trigger branch to the current one for testing --- .github/workflows/check-documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 66e2df5e4..763d75655 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -3,7 +3,7 @@ name: ocelot.social check documentation on: push: branches: - - trigger-docs.ocelot.social-deployment-by-markdown-file-changes-in-master-branch + - 6816-refactor-docsocelotsocial-ensure-vuepress-does-not-break jobs: files-changed: From 7ef4199396f4a4cf41a480451635f18f01fad02d Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 20:38:24 +0100 Subject: [PATCH 09/14] Revert "change backend/testing.md for testing" This reverts commit 8e90cbeab8ec38787c3ea9dc8b47dbf7dcd31685. --- backend/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/testing.md b/backend/testing.md index de4329384..a246569e5 100644 --- a/backend/testing.md +++ b/backend/testing.md @@ -1,3 +1,3 @@ # Unit Testing -# TEST + ***TODO:** To be filled in* From 04b0bf5c29b0e242d70080ec0ff16a68f92cbdba Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 Nov 2023 20:38:59 +0100 Subject: [PATCH 10/14] Revert "change SUMMARY.md for testing" This reverts commit 3a209e3364c962f038ba288448dc2acbfc77ab37. --- SUMMARY.md | 1 - 1 file changed, 1 deletion(-) diff --git a/SUMMARY.md b/SUMMARY.md index e93708a3d..097da9986 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -14,7 +14,6 @@ * [Testing Guide](testing.md) * [End-to-end Tests](cypress/README.md) * [Webapp (Frontend) Tests](webapp/testing.md) - * [TEST](webapp/TEST/TEST/TEST/testing.md) * [Backend Tests](backend/testing.md) * [Deployment](deployment/README.md) * [Contributing](CONTRIBUTING.md) From 246c5e544c9f219789f8b07a6b775f0e7ea9aa7b Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 8 Nov 2023 08:31:35 +0100 Subject: [PATCH 11/14] fix typo in .github/workflows/check-documentation.yml Co-authored-by: Ulf Gebhardt --- .github/workflows/check-documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 763d75655..329d58236 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout code uses: actions/checkout@master - - name: Check, if all .md files listed in SUMMARY.dm exist in current branch + - name: Check, if all .md files listed in SUMMARY.md exist in current branch run: | if [ ! -f "SUMMARY.md" ]; then echo "The file SUMMARY.md does not exist." From 10d0b03bcae90d0f1c7d4829105a927378ce5862 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 8 Nov 2023 09:08:11 +0100 Subject: [PATCH 12/14] remove redundant summary check job from documentation check workflow --- .github/workflows/check-documentation.yml | 35 ----------------------- 1 file changed, 35 deletions(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 329d58236..065a5bc54 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -23,41 +23,6 @@ jobs: filters: .github/file-filters.yml list-files: shell - check-summary: - name: Check documentation summary - if: needs.files-changed.outputs.markdown-files == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@master - - - name: Check, if all .md files listed in SUMMARY.md exist in current branch - run: | - if [ ! -f "SUMMARY.md" ]; then - echo "The file SUMMARY.md does not exist." - exit 1 - fi - - md_files=$(grep -o -P '\[[^\]]+\]\(([^)]+\.md)\)' SUMMARY.md | sed -r 's/.*\(([^)]+)\)/\1/') - missing_files=() - - for file in $md_files; do - if [ ! -f "$file" ]; then - missing_files+=("$file") - fi - done - - if [ ${#missing_files[@]} -eq 0 ]; then - echo "All .md files listed in SUMMARY.dm exist." - else - echo "These files listed in SUMMARY.dm do not exist:" - for missing_file in "${missing_files[@]}"; do - echo "$missing_file" - done - exit 1 - fi - check-markdown-links: name: Check Markdown links if: needs.files-changed.outputs.markdown-files == 'true' From e58b943d92fb8ac8a0ba9db384eee44c37d7468a Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 8 Nov 2023 09:45:18 +0100 Subject: [PATCH 13/14] set base-branch to master in documentation check workflow --- .github/workflows/check-documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 065a5bc54..8c2e2ca52 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -39,5 +39,5 @@ jobs: # at any .md file change take the chance to check the links in all .md files check-modified-files-only: 'no' config-file: '.github/workflows/mlc_config.json' - base-branch: 'trigger-docs.ocelot.social-deployment-by-markdown-file-changes-in-master-branch' # set to branch of current PR's branch + base-branch: 'master' folder-path: '.' From 27186da3ce78a6350deb1444be4923bd4c80059c Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 9 Nov 2023 09:53:02 +0100 Subject: [PATCH 14/14] set documentation check workflow trigger to push Co-authored-by: Ulf Gebhardt --- .github/workflows/check-documentation.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 8c2e2ca52..d374f41e8 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -1,9 +1,6 @@ name: ocelot.social check documentation -on: - push: - branches: - - 6816-refactor-docsocelotsocial-ensure-vuepress-does-not-break +on: push jobs: files-changed: