From 6c1f8c6261424db3e7cb78c1b82c4c61cc776363 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Wed, 5 Mar 2025 13:47:40 +0100 Subject: [PATCH 01/12] Update update-urls.yml 690: Disable cron for activity for tests --- .github/workflows/update-urls.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index 491077e5aa..4b761826d5 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -1,8 +1,6 @@ name: Update URLS on: workflow_dispatch: - schedule: - - cron: '0 3 * * *' jobs: updateURLS: runs-on: ubuntu-latest From bc81c53293db7cc8b413f122c8fdcec6a5829264 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Wed, 5 Mar 2025 13:53:57 +0100 Subject: [PATCH 02/12] Update update-urls.yml 690: adjusted for starting only tool pip --- .github/workflows/update-urls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index 4b761826d5..4484e38205 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -25,7 +25,7 @@ jobs: run: | cd cli mvn -B -ntp -Dstyle.color=always install - mvn -B -ntp -Dstyle.color=always exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M" + mvn -B -ntp -Dstyle.color=always exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M pip" - name: Commit and push to ide-urls run: | cd ide-urls From ee9d5284842eb9fe72210d83a400cb7d99f30e73 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Wed, 5 Mar 2025 14:03:35 +0100 Subject: [PATCH 03/12] Update update-urls.yml 690: Removed "commit and pushed"; inserted "-DskipTests" --- .github/workflows/update-urls.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index 4484e38205..795e2078af 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -24,18 +24,5 @@ jobs: - name: Build and run url updater run: | cd cli - mvn -B -ntp -Dstyle.color=always install - mvn -B -ntp -Dstyle.color=always exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M pip" - - name: Commit and push to ide-urls - run: | - cd ide-urls - git config --global user.name ${{ secrets.BUILD_USER }} - git config --global user.email ${{ secrets.BUILD_USER_EMAIL }} - if [ "$(git status -z)" = "" ] - then - echo "No changes, nothing to commit." - else - git add . - git commit -m "Update urls" - git push - fi + mvn -B -ntp -Dstyle.color=always -DskipTests install + mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M pip" From 98e3a6122a9a7753a199e90a239ca9e7cd68c893 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Wed, 5 Mar 2025 14:07:02 +0100 Subject: [PATCH 04/12] Update update-urls.yml 690: Removed not necessary steps for tests on local repository --- .github/workflows/update-urls.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index 795e2078af..f346979f09 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -9,12 +9,6 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - - name: Checkout ide-urls - uses: actions/checkout@v3 - with: - repository: devonfw/ide-urls - path: ide-urls - token: ${{ secrets.ACTION_PUSH_TOKEN }} - name: Set up Java uses: actions/setup-java@v3 with: From bc1e4bd6587b146aaa2f6722a9877a2c3c6b9a8d Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Wed, 5 Mar 2025 14:11:05 +0100 Subject: [PATCH 05/12] Update update-urls.yml 690: Added vreation of ide-urls folder --- .github/workflows/update-urls.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index f346979f09..daf38acb8f 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -18,5 +18,6 @@ jobs: - name: Build and run url updater run: | cd cli + mkdir ../ide-urls mvn -B -ntp -Dstyle.color=always -DskipTests install mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M pip" From 27ce1b8a16aae38876d93e02ca5c1e1be0b02ea0 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Wed, 5 Mar 2025 14:24:54 +0100 Subject: [PATCH 06/12] Update update-urls.yml 690: set timeout to 1 sec. --- .github/workflows/update-urls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index daf38acb8f..ae60d94426 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -20,4 +20,4 @@ jobs: cd cli mkdir ../ide-urls mvn -B -ntp -Dstyle.color=always -DskipTests install - mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M pip" + mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT1S pip" From 26a4c94a93e4451e9d5f387618dd12c5da4b262c Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Thu, 6 Mar 2025 15:22:15 +0100 Subject: [PATCH 07/12] 690: url update with strategy matrix --- .../scheduled-update-urls-with-matrix.yml | 19 +++++++++++++++++++ .github/workflows/update-urls.yml | 14 ++++++++++++-- .../ide/url/updater/AbstractUrlUpdater.java | 4 ++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/scheduled-update-urls-with-matrix.yml diff --git a/.github/workflows/scheduled-update-urls-with-matrix.yml b/.github/workflows/scheduled-update-urls-with-matrix.yml new file mode 100644 index 0000000000..60e1b8cf6c --- /dev/null +++ b/.github/workflows/scheduled-update-urls-with-matrix.yml @@ -0,0 +1,19 @@ +name: Update URLs +run-name: Nightly update of URLs + +# Controls when the workflow will run +on: + workflow_dispatch: + +jobs: + # Update URLS from matrix (list) + IDEasy-update-urls: + strategy: + matrix: + tool-name: [ pip ] + fail-fast: false + uses: ./../.github/workflows/update-url.yml@main + with: + tool-name: ${{ matrix.tool-name }} + secrets: inherit + diff --git a/.github/workflows/update-urls.yml b/.github/workflows/update-urls.yml index ae60d94426..ae7fbc1ee0 100644 --- a/.github/workflows/update-urls.yml +++ b/.github/workflows/update-urls.yml @@ -1,6 +1,15 @@ -name: Update URLS +name: Update Urls (callable) +run-name: ${{ github.actor }} executes url update on ${{ github.ref_name }} 🚀 + on: workflow_dispatch: + + workflow_call: + inputs: + tool-name: + required: false + type: string + jobs: updateURLS: runs-on: ubuntu-latest @@ -17,7 +26,8 @@ jobs: cache: 'maven' - name: Build and run url updater run: | + toolName="${{ inputs.tool-name }}" cd cli mkdir ../ide-urls mvn -B -ntp -Dstyle.color=always -DskipTests install - mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT1S pip" + mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M $toolName" diff --git a/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java b/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java index eba14898f4..5832c26689 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java +++ b/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java @@ -739,6 +739,10 @@ protected void updateExistingVersions(UrlEdition edition) { String[] existingVersions = edition.getChildNames().toArray(i -> new String[i]); for (String version : existingVersions) { UrlVersion urlVersion = edition.getChild(version); + if (isTimeoutExpired()) { + logger.info("HLO: break :-))"); + break; + } if (urlVersion != null) { UrlStatusFile urlStatusFile = urlVersion.getOrCreateStatus(); StatusJson statusJson = urlStatusFile.getStatusJson(); From 40b30b568f58d239c155408151d463c73619a8fe Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Fri, 7 Mar 2025 09:33:22 +0100 Subject: [PATCH 08/12] 690: Adjusted path of "uses" in scheduled updater --- .../scheduled-update-urls-with-matrix.yml | 63 +++++++++++++++++-- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scheduled-update-urls-with-matrix.yml b/.github/workflows/scheduled-update-urls-with-matrix.yml index 60e1b8cf6c..039cd81685 100644 --- a/.github/workflows/scheduled-update-urls-with-matrix.yml +++ b/.github/workflows/scheduled-update-urls-with-matrix.yml @@ -1,19 +1,70 @@ -name: Update URLs +name: Scheduled Update URLs run-name: Nightly update of URLs # Controls when the workflow will run on: workflow_dispatch: + #schedule: + # - cron: '56 09 * * *' jobs: + + testUpdater: + runs-on: ubuntu-latest + steps: + - name: Checkout ide + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Build and run url updater + run: | + cd cli + mvn -B -ntp -DskipTests -Dstyle.color=always install + # Update URLS from matrix (list) IDEasy-update-urls: + runs-on: ubuntu-latest + needs: [ testUpdater ] strategy: matrix: - tool-name: [ pip ] + tool-name: [ jmc, pip, jasypt ] fail-fast: false - uses: ./../.github/workflows/update-url.yml@main - with: - tool-name: ${{ matrix.tool-name }} - secrets: inherit + steps: + - name: Checkout ide + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Build and run url updater + run: | + toolName="${{ matrix.tool-name }}" + echo "ToolName: [$toolName]" + if [ "$toolName" != null ] && [ ! -z "$toolName" ] + then + cd cli + mkdir ../ide-urls + mvn -B -ntp -Dstyle.color=always -DskipTests install + mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M $toolName" + else + echo "ERROR: Updater not startet due tool-name is null or empty" + fi + +# +# +# +# uses: hj-lorenz/IDEasy/.github/workflows/update-urls.yml@main +# with: +# tool-name: ${{ matrix.tool-name }} +# secrets: inherit From 05bacef492e43b0eaf06c6568e7c082d890d3a27 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Fri, 7 Mar 2025 09:33:22 +0100 Subject: [PATCH 09/12] 690: Adjusted path of "uses" in scheduled updater --- .../scheduled-update-urls-with-matrix.yml | 19 ------ .../update-urls-with-tool-matrix.yml | 61 +++++++++++++++++++ 2 files changed, 61 insertions(+), 19 deletions(-) delete mode 100644 .github/workflows/scheduled-update-urls-with-matrix.yml create mode 100644 .github/workflows/update-urls-with-tool-matrix.yml diff --git a/.github/workflows/scheduled-update-urls-with-matrix.yml b/.github/workflows/scheduled-update-urls-with-matrix.yml deleted file mode 100644 index 60e1b8cf6c..0000000000 --- a/.github/workflows/scheduled-update-urls-with-matrix.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Update URLs -run-name: Nightly update of URLs - -# Controls when the workflow will run -on: - workflow_dispatch: - -jobs: - # Update URLS from matrix (list) - IDEasy-update-urls: - strategy: - matrix: - tool-name: [ pip ] - fail-fast: false - uses: ./../.github/workflows/update-url.yml@main - with: - tool-name: ${{ matrix.tool-name }} - secrets: inherit - diff --git a/.github/workflows/update-urls-with-tool-matrix.yml b/.github/workflows/update-urls-with-tool-matrix.yml new file mode 100644 index 0000000000..88e053a286 --- /dev/null +++ b/.github/workflows/update-urls-with-tool-matrix.yml @@ -0,0 +1,61 @@ +name: Update URLs with tool matrix +run-name: Nightly update of URLs + +# Controls when the workflow will run +on: + workflow_dispatch: + + #schedule: + # - cron: '56 09 * * *' +jobs: + + testUpdater: + runs-on: ubuntu-latest + steps: + - name: Checkout ide + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Build and run url updater + run: | + cd cli + mvn -B -ntp -DskipTests -Dstyle.color=always install + + # Update URLS from matrix (list) + IDEasy-update-urls: + runs-on: ubuntu-latest + needs: [ testUpdater ] + strategy: + matrix: + tool-name: [ jmc, pip, jasypt ] + fail-fast: false + steps: + - name: Checkout ide + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Build and run url updater + run: | + toolName="${{ matrix.tool-name }}" + echo "ToolName: [$toolName]" + if [ "$toolName" != null ] && [ ! -z "$toolName" ] + then + cd cli + mkdir ../ide-urls + mvn -B -ntp -Dstyle.color=always -DskipTests install + mvn -B -ntp -Dstyle.color=always -DskipTests exec:java -Dexec.mainClass="com.devonfw.tools.ide.url.UpdateInitiator" -Dexec.args="../ide-urls PT5H30M $toolName" + else + echo "ERROR: Updater not startet due tool-name is null or empty" + fi From 56e10e228efdb05cd1aef211d32cedd454bb1f16 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Tue, 11 Mar 2025 15:51:09 +0100 Subject: [PATCH 10/12] #690: Excluded .github and .yml from ignoring --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4cfa743f86..078160f130 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .* !.gitignore !.gitkeep +!.github !.editorconfig !.ide.software.version !.devon.software.version @@ -14,6 +15,7 @@ !.anyedit.properties !.ide.properties !.templateengine +!.yml target/ eclipse-target/ generated/ From 8b3ea0974c4a83d2125d1d43b29fb01fe0d0c556 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Tue, 11 Mar 2025 15:52:57 +0100 Subject: [PATCH 11/12] #690: POC for dynamic and parallel update of URLs --- .../dynamic-parallel-url-updater-with-strategy.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dynamic-parallel-url-updater-with-strategy.yml b/.github/workflows/dynamic-parallel-url-updater-with-strategy.yml index b1366e74a0..0e098ce932 100644 --- a/.github/workflows/dynamic-parallel-url-updater-with-strategy.yml +++ b/.github/workflows/dynamic-parallel-url-updater-with-strategy.yml @@ -57,6 +57,7 @@ jobs: ls -l - name: Set Matrix id: set-matrix + # Nachfolgende Statements waren div. Versuche die Liste der Tools zu erstellen, anfangs noch ohne json-Format # echo "name=matrix::$(ls -lRd * | grep '^d' | gawk '{printf("%s, ",$9)}' | sed -e 's/,\ *$//')" >> $GITHUB_OUTPUT # echo "matrix=${{for i in `find -maxdepth 2 -type d`; do echo `basename $i`; done | grep -v "^\." | sort -u | awk 'BEGIN{printf("\047[")} {printf("%s, ",$1)}' | sed -e "s/,\ *$/]'/"}}" >> $GITHUB_OUTPUT # matrix=${{'[cpp,eclipse]'}} >> $GITHUB_OUTPUT @@ -66,12 +67,15 @@ jobs: # echo "matrix=${{env.TOOLS}}" # echo "matrix=${{env.TOOLS}}" >> $GITHUB_OUTPUT - #run: echo "matrix=$(jq -cr '@json' <<< "${{ env.TOOLS }}")" >> $GITHUB_OUTPUT - #run: echo "::set-output name=matrix::{[{\"cpp\"}, {\"jasypt\"}]}" - run: | #echo "::set-output name=matrix::{\"tools\":[{\"tool\":\"eclipse\"},{\"tool\":\"jmc\"}]}" + # Nachfolgende runs waren Versuche die json zu erzeugen. + # run: echo "matrix=$(jq -cr '@json' <<< "${{ env.TOOLS }}")" >> $GITHUB_OUTPUT + # run: echo "::set-output name=matrix::{[{\"cpp\"}, {\"jasypt\"}]}" + # run echo "::set-output name=matrix::{\"tools\":[{\"tool\":\"eclipse\"},{\"tool\":\"jmc\"}]}" + run: | toolsAsJson=$(for i in `find ide-urls/. -maxdepth 2 -type d`; do echo `basename $i`; done | grep -v "^\." | sort -u | awk 'BEGIN{printf("{\"tools\":[")} {printf("{\"tool\":\"%s\"},",$1)}' | sed -e "s/,\ *$/]}/") echo $toolsAsJson echo "::set-output name=matrix::`echo $toolsAsJson`" + # HINWEIS: Funktioniert nur, wenn die tools initial mindestens 1x bereits heruntergeladen wurden. # Optional: Parameter beim manuellen Aufruf, der mit der eine Liste übergeben werden kann. # * 3 Scripte @@ -79,14 +83,13 @@ jobs: # 2. Aufrufer-Script für Erstellen der Matrix aus Input-Parametern # 3. Aufrufer-Script zum dynamischen Ermitteln der bereits existierenden Tools - # Update URLS from matrix (list) IDEasy-update-urls: runs-on: ubuntu-latest needs: [ testUpdater, create-tool-list ] strategy: matrix: - ${{ fromJson(needs.create-tool-list.outputs.matrix) }} + ${{ fromJson(needs.create-tool-list.outputs.matrix.tools) }} fail-fast: false steps: - name: Checkout ide From 7584d715409a8eadea0cb13eefaf84f10240f2b7 Mon Sep 17 00:00:00 2001 From: hj-lorenz Date: Tue, 11 Mar 2025 15:54:24 +0100 Subject: [PATCH 12/12] #690: Removed not necessary info log. --- .../com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java b/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java index 5832c26689..feb7178250 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java +++ b/cli/src/main/java/com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java @@ -740,7 +740,6 @@ protected void updateExistingVersions(UrlEdition edition) { for (String version : existingVersions) { UrlVersion urlVersion = edition.getChild(version); if (isTimeoutExpired()) { - logger.info("HLO: break :-))"); break; } if (urlVersion != null) {