From 6d289d4e4246b930c9790ff1eb18245e82ff0965 Mon Sep 17 00:00:00 2001 From: dr6817 Date: Thu, 1 Feb 2024 16:50:41 +0100 Subject: [PATCH 1/4] Update Retriever.java Remove Save Repository --- .../org/palladiosimulator/retriever/core/main/Retriever.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.palladiosimulator.retriever.core/src/org/palladiosimulator/retriever/core/main/Retriever.java b/bundles/org.palladiosimulator.retriever.core/src/org/palladiosimulator/retriever/core/main/Retriever.java index 3dd32cf2..2f3ed09f 100644 --- a/bundles/org.palladiosimulator.retriever.core/src/org/palladiosimulator/retriever/core/main/Retriever.java +++ b/bundles/org.palladiosimulator.retriever.core/src/org/palladiosimulator/retriever/core/main/Retriever.java @@ -147,7 +147,7 @@ private static void executeWith(final Path projectPath, final Path outPath, fina // Persist the repository at ./pcm.repository blackboard.addPartition(RetrieverBlackboard.KEY_REPOSITORY, pcm); - ModelSaver.saveRepository(pcm, outPath.toString(), "pcm"); + // ModelSaver.saveRepository(pcm, outPath.toString(), "pcm"); } /** From a9791209628ad189fba1a247026149882bdab3ec Mon Sep 17 00:00:00 2001 From: dr6817 Date: Thu, 1 Feb 2024 17:02:12 +0100 Subject: [PATCH 2/4] Update action.yml --- action.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 816dc12d..743ecb13 100644 --- a/action.yml +++ b/action.yml @@ -48,9 +48,10 @@ runs: cd "${{ github.workspace }}/${{ inputs.source_path }}" echo "GIT_INFO_FILE=$GIT_INFO_FILE" >> $GITHUB_ENV { - echo "# Git repository information" - echo "| | |" - echo "|--- | ---|" + echo "# [Retriever](https://github.com/PalladioSimulator/Palladio-ReverseEngineering-Retriever) Report" + echo "## Git repository information" + echo "| Attribute | Value |" + echo "| -------------- | ----- |" echo "| Repository URL | $(git config --get remote.origin.url) |" echo "| Branch | $(git branch --show-current) |" echo "| Commit | $(git log -1 --pretty=format:"%H") |" @@ -67,7 +68,7 @@ runs: SYSTEM_INFO_FILE=${{ env.tmp_dir }}/retriever_out/system_info.md echo "SYSTEM_INFO_FILE=$SYSTEM_INFO_FILE" >> $GITHUB_ENV { - echo "# System information" + echo "## System information" echo "| Attribute | Value |" echo "| --------- | ----- |" neofetch os distro kernel cpu gpu memory --stdout | \ @@ -85,7 +86,7 @@ runs: CLOC_INFO_FILE=${{ env.tmp_dir }}/retriever_out/cloc.md echo "CLOC_INFO_FILE=$CLOC_INFO_FILE" >> $GITHUB_ENV { - echo "# Cloc analysis" + echo "## Cloc analysis" cloc ${{ inputs.source_path }} --unicode --autoconf --diff-timeout 300 --docstring-as-code --read-binary-files --md --quiet | \ sed -e '1d; 2s/cloc|github.com\/AlDanial\///; /^--- | ---$/d' } > $CLOC_INFO_FILE @@ -162,7 +163,7 @@ runs: # Remove the first column from the table using sed sed -i 's/^[^|]*|[^|]*|/|/' $TIMING_INFO_FILE { - echo "# Retriever execution time" + echo "## Retriever execution time" cat $TIMING_INFO_FILE } > "${TIMING_INFO_FILE}.tmp" && mv "${TIMING_INFO_FILE}.tmp" "$TIMING_INFO_FILE" @@ -171,7 +172,7 @@ runs: /usr/bin/time -p -o "$TIMING_INFO_FILE" $RETRIEVER_COMMAND # Read and reformat the timing information { - echo "# Retriever execution time" + echo "## Retriever execution time" echo "| Metric | Time (seconds) |" echo "| --- | ---: |" while IFS= read -r line; do @@ -204,7 +205,7 @@ runs: cat $TIMING_INFO_FILE echo cat $CLOC_INFO_FILE - } > ${{ env.tmp_dir }}/retriever_out/report.md + } > ${{ env.tmp_dir }}/retriever_out/README.md # Delete the original files rm -f $GIT_INFO_FILE $SYSTEM_INFO_FILE $CLOC_INFO_FILE $TIMING_INFO_FILE From 3785f4a2b101f69e5771845d0e1114c7ee442f95 Mon Sep 17 00:00:00 2001 From: dr6817 Date: Tue, 6 Feb 2024 13:57:37 +0100 Subject: [PATCH 3/4] Update action.yml Added a Retriever info file with version and date. --- action.yml | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/action.yml b/action.yml index 743ecb13..80c07840 100644 --- a/action.yml +++ b/action.yml @@ -34,13 +34,25 @@ runs: distribution: "temurin" java-version: "17" - - name: Create temporary directory + - name: Create Temporary Directory shell: bash run: | TMP_DIR=$(mktemp -d) echo "tmp_dir=$TMP_DIR" >> $GITHUB_ENV mkdir $TMP_DIR/retriever_out + - name: Gather Retriever Info + shell: bash + run: | + RETRIEVER_INFO_FILE=${{ env.tmp_dir }}/retriever_out/retriever_info.md + echo "RETRIEVER_INFO_FILE=$RETRIEVER_INFO_FILE" >> $GITHUB_ENV + { + echo "# [Retriever](https://github.com/PalladioSimulator/Palladio-ReverseEngineering-Retriever) Report" + echo "| Version | Date |" + echo "| ------- | ---- |" + echo "| $(curl -sL ${{ github.api_url }}/repos/PalladioSimulator/Palladio-ReverseEngineering-Retriever/releases/latest | jq -r ".tag_name") | $(date -u) |" + } > $RETRIEVER_INFO_FILE + - name: Gather Git Repository Info shell: bash run: | @@ -48,14 +60,12 @@ runs: cd "${{ github.workspace }}/${{ inputs.source_path }}" echo "GIT_INFO_FILE=$GIT_INFO_FILE" >> $GITHUB_ENV { - echo "# [Retriever](https://github.com/PalladioSimulator/Palladio-ReverseEngineering-Retriever) Report" echo "## Git repository information" echo "| Attribute | Value |" echo "| -------------- | ----- |" echo "| Repository URL | $(git config --get remote.origin.url) |" echo "| Branch | $(git branch --show-current) |" echo "| Commit | $(git log -1 --pretty=format:"%H") |" - echo "| Date | $(date -u) |" } > $GIT_INFO_FILE - name: Install Neofetch @@ -80,7 +90,7 @@ runs: run: | sudo apt install cloc - - name: Run cloc analysis + - name: Run cloc Analysis shell: bash run: | CLOC_INFO_FILE=${{ env.tmp_dir }}/retriever_out/cloc.md @@ -91,7 +101,7 @@ runs: sed -e '1d; 2s/cloc|github.com\/AlDanial\///; /^--- | ---$/d' } > $CLOC_INFO_FILE - - name: Get action version + - name: Get Action Version shell: bash # Assuming a format like in the GitHub Actions documentation: # /home/runner/work/_actions/repo-owner/name-of-action-repo/v1 @@ -101,7 +111,7 @@ runs: ACTION_VERSION=$(echo ${{ github.action_path }} | cut -d / -f 8- -) echo "action_version=$ACTION_VERSION" >> $GITHUB_ENV - - name: Download latest Retriever + - name: Download Latest Retriever if: env.action_version == 'main' shell: bash run: | @@ -130,7 +140,7 @@ runs: working-directory: ${{ env.tmp_dir }} run: unzip retriever.zip -d retriever - - name: Install Hyperfine + - name: Install hyperfine if: inputs.benchmark == 'true' shell: bash run: | @@ -198,6 +208,8 @@ runs: run: | # Combine files into one, with empty lines between file contents { + cat $RETRIEVER_INFO_FILE + echo cat $GIT_INFO_FILE echo cat $SYSTEM_INFO_FILE @@ -207,10 +219,10 @@ runs: cat $CLOC_INFO_FILE } > ${{ env.tmp_dir }}/retriever_out/README.md # Delete the original files - rm -f $GIT_INFO_FILE $SYSTEM_INFO_FILE $CLOC_INFO_FILE $TIMING_INFO_FILE + rm -f $RETRIEVER_INFO_FILE $GIT_INFO_FILE $SYSTEM_INFO_FILE $CLOC_INFO_FILE $TIMING_INFO_FILE - - name: Prepare analysis results for upload + - name: Prepare Analysis Results for Upload shell: bash working-directory: ${{ env.tmp_dir }} run: | @@ -219,13 +231,13 @@ runs: mv tmp/* retriever_out rmdir tmp - - name: Upload analysis results + - name: Upload Analysis Results uses: actions/upload-artifact@v3 with: name: retriever path: ${{ env.tmp_dir }}/retriever_out - - name: Prepare Eclipse logs for upload + - name: Prepare Eclipse Logs for Upload if: failure() shell: bash working-directory: ${{ env.tmp_dir }} @@ -233,14 +245,14 @@ runs: mkdir -p eclipse_logs/${{ inputs.source_path }} mv retriever/configuration/*.log retriever/workspace/.metadata/.log eclipse_logs/${{ inputs.source_path }} - - name: Upload Eclipse logs + - name: Upload Eclipse Logs if: failure() uses: actions/upload-artifact@v3 with: name: eclipse_logs path: ${{ env.tmp_dir }}/eclipse_logs - - name: Delete temporary directory + - name: Delete Temporary Directory if: always() shell: bash run: rm -rf ${{ env.tmp_dir }} From 79b974e90fc0d56700863617f4cd1ad0db7fe897 Mon Sep 17 00:00:00 2001 From: dr6817 Date: Mon, 12 Feb 2024 09:45:21 +0100 Subject: [PATCH 4/4] Update BasicTest.java --- .../retriever/test/integration/BasicTest.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/org.palladiosimulator.retriever.test/src/org/palladiosimulator/retriever/test/integration/BasicTest.java b/tests/org.palladiosimulator.retriever.test/src/org/palladiosimulator/retriever/test/integration/BasicTest.java index da7f292b..c5d5f556 100644 --- a/tests/org.palladiosimulator.retriever.test/src/org/palladiosimulator/retriever/test/integration/BasicTest.java +++ b/tests/org.palladiosimulator.retriever.test/src/org/palladiosimulator/retriever/test/integration/BasicTest.java @@ -51,18 +51,6 @@ private OperationInterface getConflictingMethods(final List interface return conflictingMethods; } - /** - * Tests the basic functionality of Retriever. Requires it to execute without an exception and - * produce an output file. - */ - @Test - void testExecutesAndProducesFile() { - assertTrue(new File(this.getConfig() - .getOutputFolder() - .appendSegment("pcm.repository") - .devicePath()).exists()); - } - @Disabled("FIXME: Reliance on outdated JaxRS rule") @Test void testArray() {