From c271bac08ef10c7dd4afdb175787f83f0e12356f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 5 Feb 2025 11:03:36 +0100 Subject: [PATCH 01/13] Applied review suggestion --- .github/workflows/preview_comment.yaml | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/preview_comment.yaml diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml new file mode 100644 index 0000000000..22b0b9f960 --- /dev/null +++ b/.github/workflows/preview_comment.yaml @@ -0,0 +1,61 @@ +name: "Post preview links for changed files" + +on: + pull_request: + paths: + - 'docs/**.md' + workflow_call: + inputs: + project: + description: 'The project to build (dev doc, user doc)' + default: '' + required: false + type: string + +jobs: + post-preview-links: + name: Post preview links for changed files + runs-on: ubuntu-latest + permissions: + # Needed to manage the comment + pull-requests: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create comment for changed files + run: | + file_limit=100 + build_url="https://ez-systems-developer-documentation--${{ github.event.pull_request.number }}.com.readthedocs.build/${{inputs.project}}en/${{ github.event.pull_request.number }}/" + + changed_files=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E ".md$" || [[ $? == 1 ]]) + number_of__changed_files=$(echo "$changed_files" | wc -l) + + if [[ $changed_files -eq "" ]] ; then + comment="Preview of modified Markdown files:: No Markdown change to preview." + elif [[ $number_of__changed_files -gt $file_limit ]] ; then + comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($number_of__changed_files files >h; $file_limit)" + else + comment=$(git diff --name-only HEAD "origin/master" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") + comment="Preview of modified Markdown files:\n\n$comment" + fi + + echo -e $comment > comment.md + + - name: Find comment + id: find-comment + uses: peter-evans/find-comment@v3 + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: 'Preview of modified Markdown files' + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v4 + with: + comment-id: ${{ steps.find-comment.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body-path: comment.md + edit-mode: replace From d9f9ffd5b8c0932d1032b73ca1a815d57b390757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 5 Feb 2025 11:20:57 +0100 Subject: [PATCH 02/13] [TMP] Add change --- docs/search/search_engines/solr_search_engine/install_solr.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/search/search_engines/solr_search_engine/install_solr.md b/docs/search/search_engines/solr_search_engine/install_solr.md index 884f54064d..aaab6724a2 100644 --- a/docs/search/search_engines/solr_search_engine/install_solr.md +++ b/docs/search/search_engines/solr_search_engine/install_solr.md @@ -22,6 +22,8 @@ Download and extract Solr: Copy the necessary configuration files. In the example below from the root of your project to the place you extracted Solr: +I AM A RANDOM CHANGE + ``` bash # Make sure to replace the /opt/solr/ path with where you have placed Solr cd /opt/solr @@ -293,4 +295,4 @@ Here are the most common issues you may encounter: - Solr Bundle on purpose doesn't commit changes directly on Repository updates *(on indexing)*, but lets you control this using Solr configuration. Adjust Solr's `autoSoftCommit` (visibility of changes to search index) and/or `autoCommit` (hard commit, for durability and replication) to balance performance and load on your Solr instance against needs you have for "[NRT](https://cwiki.apache.org/confluence/display/solr/Near+Real+Time+Searching)". - Running out of memory during indexing - In general make sure to run indexing using the prod environment to avoid debuggers and loggers from filling up memory. - - Flysystem: You can find further info in https://issues.ibexa.co/browse/EZP-25325. \ No newline at end of file + - Flysystem: You can find further info in https://issues.ibexa.co/browse/EZP-25325. From baa535d5c39ab2b4036edff3f52970a82049de79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 5 Feb 2025 11:24:40 +0100 Subject: [PATCH 03/13] [TMP] Random change 2 --- .../search_engines/elastic_search/install_elastic_search.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/search/search_engines/elastic_search/install_elastic_search.md b/docs/search/search_engines/elastic_search/install_elastic_search.md index c43f71fa7e..c2f31c25fa 100644 --- a/docs/search/search_engines/elastic_search/install_elastic_search.md +++ b/docs/search/search_engines/elastic_search/install_elastic_search.md @@ -17,6 +17,8 @@ docker run -d --name ibexa-dxp-elasticsearch -p 9200:9200 -p 9300:9300 -e "disco [[= product_name =]] supports Elasticsearch in version 7.16.2 or higher. +I AM A RANDOM CHANGE 2 + ## Verify the instance To make sure that the Elasticsearch instance operates properly, access the instance (for example, with `curl http://localhost:9200/`). @@ -91,4 +93,4 @@ php bin/console ibexa:reindex !!! caution "Risks of premature indexing" Don't reindex your data before you create index templates. - Otherwise Elasticsearch attempts to use its [dynamic field mapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/dynamic-field-mapping.html) feature to create type mappings automatically. \ No newline at end of file + Otherwise Elasticsearch attempts to use its [dynamic field mapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/dynamic-field-mapping.html) feature to create type mappings automatically. From 667727142c3ed26b33e9a81111a9d44e813c81bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 5 Feb 2025 11:25:31 +0100 Subject: [PATCH 04/13] Fixed hardcoded master --- .github/workflows/preview_comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index 22b0b9f960..bdc287e15a 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -38,7 +38,7 @@ jobs: elif [[ $number_of__changed_files -gt $file_limit ]] ; then comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($number_of__changed_files files >h; $file_limit)" else - comment=$(git diff --name-only HEAD "origin/master" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") + comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") comment="Preview of modified Markdown files:\n\n$comment" fi From ff893fde2bcc9e2b5647ec0c2da0ca152f6dcff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 5 Feb 2025 11:46:39 +0100 Subject: [PATCH 05/13] Fix? --- .github/workflows/preview_comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index bdc287e15a..c314001c7a 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -38,7 +38,7 @@ jobs: elif [[ $number_of__changed_files -gt $file_limit ]] ; then comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($number_of__changed_files files >h; $file_limit)" else - comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") + comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1\/)|") comment="Preview of modified Markdown files:\n\n$comment" fi From bc9ddb0e983aa4c2e8efafe1a68923e1407f9416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 5 Feb 2025 13:51:08 +0100 Subject: [PATCH 06/13] Fix? --- .github/workflows/preview_comment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index c314001c7a..f5e912b4a7 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -38,11 +38,11 @@ jobs: elif [[ $number_of__changed_files -gt $file_limit ]] ; then comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($number_of__changed_files files >h; $file_limit)" else - comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1\/)|") + comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)\n|") comment="Preview of modified Markdown files:\n\n$comment" fi - echo -e $comment > comment.md + echo -e "$comment" > comment.md - name: Find comment id: find-comment From cea3091d3a7a928a34785dcb598126a7b073057c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 11:02:44 +0100 Subject: [PATCH 07/13] Removed newline --- .github/workflows/preview_comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index f5e912b4a7..c34eeed771 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -38,7 +38,7 @@ jobs: elif [[ $number_of__changed_files -gt $file_limit ]] ; then comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($number_of__changed_files files >h; $file_limit)" else - comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)\n|") + comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") comment="Preview of modified Markdown files:\n\n$comment" fi From 0d34f95d76ff63b3af318f3faff792d8544a5a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 11:14:26 +0100 Subject: [PATCH 08/13] Refactoring --- .github/workflows/preview_comment.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index c34eeed771..ccc04c6dc4 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -30,16 +30,15 @@ jobs: file_limit=100 build_url="https://ez-systems-developer-documentation--${{ github.event.pull_request.number }}.com.readthedocs.build/${{inputs.project}}en/${{ github.event.pull_request.number }}/" - changed_files=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E ".md$" || [[ $? == 1 ]]) - number_of__changed_files=$(echo "$changed_files" | wc -l) + change_list=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") + change_count=$(echo "$change_list" | wc -l) - if [[ $changed_files -eq "" ]] ; then + if [[ $change_list -eq '' ]] ; then comment="Preview of modified Markdown files:: No Markdown change to preview." - elif [[ $number_of__changed_files -gt $file_limit ]] ; then - comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($number_of__changed_files files >h; $file_limit)" + elif [[ $change_count -gt $file_limit ]] ; then + comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($change_count files >h; $file_limit)" else - comment=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|") - comment="Preview of modified Markdown files:\n\n$comment" + comment="Preview of modified Markdown files:\n\n$change_list" fi echo -e "$comment" > comment.md From 7a01b22b690cd1c422df1bc05bc3127f47416116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 12:06:04 +0100 Subject: [PATCH 09/13] Revert "[TMP] Add change" This reverts commit d9f9ffd5b8c0932d1032b73ca1a815d57b390757. --- docs/search/search_engines/solr_search_engine/install_solr.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/search/search_engines/solr_search_engine/install_solr.md b/docs/search/search_engines/solr_search_engine/install_solr.md index aaab6724a2..884f54064d 100644 --- a/docs/search/search_engines/solr_search_engine/install_solr.md +++ b/docs/search/search_engines/solr_search_engine/install_solr.md @@ -22,8 +22,6 @@ Download and extract Solr: Copy the necessary configuration files. In the example below from the root of your project to the place you extracted Solr: -I AM A RANDOM CHANGE - ``` bash # Make sure to replace the /opt/solr/ path with where you have placed Solr cd /opt/solr @@ -295,4 +293,4 @@ Here are the most common issues you may encounter: - Solr Bundle on purpose doesn't commit changes directly on Repository updates *(on indexing)*, but lets you control this using Solr configuration. Adjust Solr's `autoSoftCommit` (visibility of changes to search index) and/or `autoCommit` (hard commit, for durability and replication) to balance performance and load on your Solr instance against needs you have for "[NRT](https://cwiki.apache.org/confluence/display/solr/Near+Real+Time+Searching)". - Running out of memory during indexing - In general make sure to run indexing using the prod environment to avoid debuggers and loggers from filling up memory. - - Flysystem: You can find further info in https://issues.ibexa.co/browse/EZP-25325. + - Flysystem: You can find further info in https://issues.ibexa.co/browse/EZP-25325. \ No newline at end of file From 953692892a60d30e7fe37e15f5b9cf20d058fa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 12:06:08 +0100 Subject: [PATCH 10/13] Revert "[TMP] Random change 2" This reverts commit baa535d5c39ab2b4036edff3f52970a82049de79. --- .../search_engines/elastic_search/install_elastic_search.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/search/search_engines/elastic_search/install_elastic_search.md b/docs/search/search_engines/elastic_search/install_elastic_search.md index c2f31c25fa..c43f71fa7e 100644 --- a/docs/search/search_engines/elastic_search/install_elastic_search.md +++ b/docs/search/search_engines/elastic_search/install_elastic_search.md @@ -17,8 +17,6 @@ docker run -d --name ibexa-dxp-elasticsearch -p 9200:9200 -p 9300:9300 -e "disco [[= product_name =]] supports Elasticsearch in version 7.16.2 or higher. -I AM A RANDOM CHANGE 2 - ## Verify the instance To make sure that the Elasticsearch instance operates properly, access the instance (for example, with `curl http://localhost:9200/`). @@ -93,4 +91,4 @@ php bin/console ibexa:reindex !!! caution "Risks of premature indexing" Don't reindex your data before you create index templates. - Otherwise Elasticsearch attempts to use its [dynamic field mapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/dynamic-field-mapping.html) feature to create type mappings automatically. + Otherwise Elasticsearch attempts to use its [dynamic field mapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/dynamic-field-mapping.html) feature to create type mappings automatically. \ No newline at end of file From d564bb515c5d4a1ef0619cc3db7dfe380991a65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 13:16:01 +0100 Subject: [PATCH 11/13] Removed file filter from the job --- .github/workflows/preview_comment.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index ccc04c6dc4..8a6180de69 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -1,9 +1,7 @@ name: "Post preview links for changed files" on: - pull_request: - paths: - - 'docs/**.md' + pull_request: ~ workflow_call: inputs: project: From bcf8182b4c8bf77855e15354f422369b62e56dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 13:25:17 +0100 Subject: [PATCH 12/13] Refined message --- .github/workflows/preview_comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index 8a6180de69..92ee40adb9 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -32,7 +32,7 @@ jobs: change_count=$(echo "$change_list" | wc -l) if [[ $change_list -eq '' ]] ; then - comment="Preview of modified Markdown files:: No Markdown change to preview." + comment="Preview of modified Markdown files: no Markdown changes to preview." elif [[ $change_count -gt $file_limit ]] ; then comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($change_count files >h; $file_limit)" else From 7cf53c9e6516af94de2ad8986226a9eab523fc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 6 Feb 2025 14:41:36 +0100 Subject: [PATCH 13/13] Applied review wording suggestion Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> --- .github/workflows/preview_comment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index 92ee40adb9..a856e21de4 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -32,11 +32,11 @@ jobs: change_count=$(echo "$change_list" | wc -l) if [[ $change_list -eq '' ]] ; then - comment="Preview of modified Markdown files: no Markdown changes to preview." + comment="Preview of modified Markdown: no Markdown change to preview." elif [[ $change_count -gt $file_limit ]] ; then - comment="Preview of modified Markdown files: Too many files modified in a single PR, preview link list is skipped. ($change_count files >h; $file_limit)" + comment="Preview of modified Markdown: Too many files modified in a single PR, preview link list is skipped. ($change_count files >h; $file_limit)" else - comment="Preview of modified Markdown files:\n\n$change_list" + comment="Preview of modified Markdown:\n\n$change_list" fi echo -e "$comment" > comment.md @@ -47,7 +47,7 @@ jobs: with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' - body-includes: 'Preview of modified Markdown files' + body-includes: 'Preview of modified Markdown' - name: Create or update comment uses: peter-evans/create-or-update-comment@v4