From f00a5bb185c6c6915ed21f0cb0084ca4a31926c0 Mon Sep 17 00:00:00 2001 From: nereboss Date: Tue, 14 May 2024 14:23:38 +0200 Subject: [PATCH 01/14] Update docs that timeout needs to be installed on mac #3322 --- DEV_START_GUIDE.md | 26 ++++++++++++-------- gh-pages/_docs/07-02-new-to-code-analysis.md | 2 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/DEV_START_GUIDE.md b/DEV_START_GUIDE.md index 8042adf958..04280e9de5 100644 --- a/DEV_START_GUIDE.md +++ b/DEV_START_GUIDE.md @@ -90,11 +90,25 @@ npm run start You can also directly build a distributable package (.zip) of the standalone client for your system. For more information, see the 'Package' section of the [visualisation readme](https://github.com/MaibornWolff/codecharta/tree/main/visualization#package). -# IntelliJ setup +# Testing -We mainly use IntelliJ for our development. The project generally works right away, except for two issues that sometimes occur: +The analysis and visualisation parts are tested separately with different tools. \ +For the analysis, we use gradle for testing, linting and formatting. More information is available [here](https://maibornwolff.github.io/codecharta/docs/new-to-code-analysis/#testing).\ +For the visualisation, we utilize Jest and puppeteer for unit- and e2e-tests. To run all unit tests, execute `npm test`. More information about e2e-tests can be found [here](https://maibornwolff.github.io/codecharta/dev-guide/e2e-testing-with-puppeteer/). + +When opening a pull requests, all tests are executed automatically using GitHub-actions and a branch can only be merged if all tests are successful. However, it is highly recommended to test changes before pushing them! + +# Troubleshooting + +We mainly use IntelliJ for our development. The project generally works right away, but sometimes issues can occur: - Sometimes when opening the main CodeCharta folder, the analysis part does not get detected as a module. To solve this, directly open the analysis folder. +- The integration tests for the analysis can fail due to OS specific problems: + + - On windows this may be caused by a missing or unknown `sh` command. + To make it work, add the path to the Git `sh.exe` (which is normally placed here `C:\\Git\bin`) to your PATH variable. + - For macOS, it is necessary to install the `timeout` command (e.g. using `brew install coreutils`) to execute the integration tests. + - When working on visualization, IntelliJ does not correctly detect our test-suite. To execute tests using the build in runners, it is necessary to adjust the Jest-Configuration: - First select 'Edit...' from the 'More actions' menu next to the Runner icon @@ -102,14 +116,6 @@ We mainly use IntelliJ for our development. The project generally works right aw - Select 'Jest' and set 'jestUnit.config.json' as the configuration file as well as adding the Jest option '--env=jsdom' - After clicking apply, IntelliJ should e able to execute all visualisation tests -# Testing - -The analysis and visualisation parts are tested separately with different tools. \ -For the analysis, we use gradle for testing, linting and formatting. More information is available [here](https://maibornwolff.github.io/codecharta/docs/new-to-code-analysis/#testing).\ -For the visualisation, we utilize Jest and puppeteer for unit- and e2e-tests. To run all unit tests, execute `npm test`. More information about e2e-tests can be found [here](https://maibornwolff.github.io/codecharta/dev-guide/e2e-testing-with-puppeteer/). - -When opening a pull requests, all tests are executed automatically using GitHub-actions and a branch can only be merged if all tests are successful. However, it is highly recommended to test changes before pushing them! - # Documentation structure Our documentation is generally split between user docs and developer docs. diff --git a/gh-pages/_docs/07-02-new-to-code-analysis.md b/gh-pages/_docs/07-02-new-to-code-analysis.md index 3d1dece66d..8ba667b5e6 100644 --- a/gh-pages/_docs/07-02-new-to-code-analysis.md +++ b/gh-pages/_docs/07-02-new-to-code-analysis.md @@ -60,6 +60,8 @@ A simple way to only import the analysis is to clone the whole repository and th The integration tests might fail on windows, because of a missing or unknown `sh` command. To make it work, add the path to the Git `sh.exe` (which is normally placed here `C:\\Git\bin`) to your PATH variable. +If the integration tests fail on macOS, it is likely because the `terminal` command is not installed. This is necessary for the integration test and can be installed e.g. with `brew install coreutils`. + **If you want to run the JUnit tests with the IntelliJ-Runner, make sure to go to `File -> Settings ->Build,Execution, Deployment -> Build Tools -> Gradle` and select `Run test using: IntelliJ IDEA`** ### Linting/Formatting From 907c598a67d02eb23bbf60a2e0b1a5b8743f57ff Mon Sep 17 00:00:00 2001 From: nereboss Date: Tue, 14 May 2024 14:29:50 +0200 Subject: [PATCH 02/14] Update changelog #3322 --- analysis/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/analysis/CHANGELOG.md b/analysis/CHANGELOG.md index 21cc16f656..903552b4d9 100644 --- a/analysis/CHANGELOG.md +++ b/analysis/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/) Chore 👨‍💻 👩‍💻 - Upgrade Gradle to version 8.7, now with support for Java version 21. [#3570](https://github.com/MaibornWolff/codecharta/pull/3570) +- Update docs to include that the `timeout` command is necessary on macOS to run integration tests [#3322](https://github.com/MaibornWolff/codecharta/pull/3615) ## [1.123.0] - 2024-04-10 From 858d9e5f6fedff57a4a9434a094389e99cd0262a Mon Sep 17 00:00:00 2001 From: nereboss Date: Tue, 14 May 2024 14:41:34 +0200 Subject: [PATCH 03/14] Include review comments #3322 --- DEV_START_GUIDE.md | 6 +++--- gh-pages/_docs/07-02-new-to-code-analysis.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEV_START_GUIDE.md b/DEV_START_GUIDE.md index 04280e9de5..06c38166e2 100644 --- a/DEV_START_GUIDE.md +++ b/DEV_START_GUIDE.md @@ -103,11 +103,11 @@ When opening a pull requests, all tests are executed automatically using GitHub- We mainly use IntelliJ for our development. The project generally works right away, but sometimes issues can occur: - Sometimes when opening the main CodeCharta folder, the analysis part does not get detected as a module. To solve this, directly open the analysis folder. -- The integration tests for the analysis can fail due to OS specific problems: +- The integration tests for the analysis (`./gradlew integrationTest`) can fail due to OS specific problems: - - On windows this may be caused by a missing or unknown `sh` command. + - On **windows** this may be caused by a missing or unknown `sh` command. To make it work, add the path to the Git `sh.exe` (which is normally placed here `C:\\Git\bin`) to your PATH variable. - - For macOS, it is necessary to install the `timeout` command (e.g. using `brew install coreutils`) to execute the integration tests. + - For **macOS**, it is necessary to install the `timeout` command (e.g. using `brew install coreutils`) to execute the integration tests. - When working on visualization, IntelliJ does not correctly detect our test-suite. To execute tests using the build in runners, it is necessary to adjust the Jest-Configuration: diff --git a/gh-pages/_docs/07-02-new-to-code-analysis.md b/gh-pages/_docs/07-02-new-to-code-analysis.md index 8ba667b5e6..4363130e91 100644 --- a/gh-pages/_docs/07-02-new-to-code-analysis.md +++ b/gh-pages/_docs/07-02-new-to-code-analysis.md @@ -60,7 +60,7 @@ A simple way to only import the analysis is to clone the whole repository and th The integration tests might fail on windows, because of a missing or unknown `sh` command. To make it work, add the path to the Git `sh.exe` (which is normally placed here `C:\\Git\bin`) to your PATH variable. -If the integration tests fail on macOS, it is likely because the `terminal` command is not installed. This is necessary for the integration test and can be installed e.g. with `brew install coreutils`. +If the integration tests fail on macOS, it is likely because the `timeout` command is not installed. This is necessary for the integration test and can be installed e.g. with `brew install coreutils`. **If you want to run the JUnit tests with the IntelliJ-Runner, make sure to go to `File -> Settings ->Build,Execution, Deployment -> Build Tools -> Gradle` and select `Run test using: IntelliJ IDEA`** From 628f1a244b15a5dfea11b05d410966e37bf3ef0a Mon Sep 17 00:00:00 2001 From: VictoriaG Date: Wed, 15 May 2024 12:39:04 +0200 Subject: [PATCH 04/14] Releasing ana-1.124.0 --- README.md | 2 +- analysis/CHANGELOG.md | 2 ++ analysis/gradle.properties | 2 +- analysis/node-wrapper/package-lock.json | 4 ++-- analysis/node-wrapper/package.json | 2 +- .../_posts/release/2024-05-15-ana_1_124_0.md | 24 +++++++++++++++++++ 6 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 gh-pages/_posts/release/2024-05-15-ana_1_124_0.md diff --git a/README.md b/README.md index 65ecddf6ff..007c424781 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@

Latest Release:
- Analysis 1.123.0 | Visualization 1.125.0 + Analysis 1.124.0 | Visualization 1.125.0 [comment]: ################################################################################## [comment]: diff --git a/analysis/CHANGELOG.md b/analysis/CHANGELOG.md index 903552b4d9..9209b0f999 100644 --- a/analysis/CHANGELOG.md +++ b/analysis/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/) ## [unreleased] (Added 🚀 | Changed | Removed 🗑 | Fixed 🐞 | Chore 👨‍💻 👩‍💻) +## [1.124.0] - 2024-05-15 + ### Fixed 🐞 - Add default Docker user to mitigate `GitLogParser` issues during repo-scan [#3571](https://github.com/MaibornWolff/codecharta/pull/3571) diff --git a/analysis/gradle.properties b/analysis/gradle.properties index 03c88b66b0..b6a631d844 100644 --- a/analysis/gradle.properties +++ b/analysis/gradle.properties @@ -1,4 +1,4 @@ -currentVersion=1.123.0 +currentVersion=1.124.0 org.gradle.parallel=true org.gradle.caching=true org.gradle.unsafe.configuration-cache=true diff --git a/analysis/node-wrapper/package-lock.json b/analysis/node-wrapper/package-lock.json index 8729126ad2..38d7222bc8 100644 --- a/analysis/node-wrapper/package-lock.json +++ b/analysis/node-wrapper/package-lock.json @@ -1,12 +1,12 @@ { "name": "codecharta-analysis", - "version": "1.123.0", + "version": "1.124.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codecharta-analysis", - "version": "1.123.0", + "version": "1.124.0", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { diff --git a/analysis/node-wrapper/package.json b/analysis/node-wrapper/package.json index 9a31c74686..1b928ec52b 100644 --- a/analysis/node-wrapper/package.json +++ b/analysis/node-wrapper/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/MaibornWolff/codecharta.git" }, "name": "codecharta-analysis", - "version": "1.123.0", + "version": "1.124.0", "description": "MaibornWolff CodeCharta Analysis Tools", "scripts": { "prepare": "rm -rf ../build/install/codecharta-analysis public && ../gradlew -p .. installDist && cp -R ../build/install/codecharta-analysis public", diff --git a/gh-pages/_posts/release/2024-05-15-ana_1_124_0.md b/gh-pages/_posts/release/2024-05-15-ana_1_124_0.md new file mode 100644 index 0000000000..5821277fef --- /dev/null +++ b/gh-pages/_posts/release/2024-05-15-ana_1_124_0.md @@ -0,0 +1,24 @@ +--- +categories: + - Release +tags: + - gh-pages + - release + - analysis + +title: Analysis version 1.124.0 +--- + +{{page.title}} is live and ready for [download](https://github.com/MaibornWolff/codecharta/releases/tag/ana-1.124.0). +This version brings the following: + +### Fixed 🐞 + +- Add default Docker user to mitigate `GitLogParser` issues during repo-scan [#3571](https://github.com/MaibornWolff/codecharta/pull/3571) +- Escaping and un-escaping windows paths, auto-detecting path separator for Unix and Windows + paths [#3569](https://github.com/MaibornWolff/codecharta/pull/3569) + +Chore 👨‍💻 👩‍💻 + +- Upgrade Gradle to version 8.7, now with support for Java version 21. [#3570](https://github.com/MaibornWolff/codecharta/pull/3570) +- Update docs to include that the `timeout` command is necessary on macOS to run integration tests [#3322](https://github.com/MaibornWolff/codecharta/pull/3615) From a0171edadc59110bd15848b9d9e19790519d2469 Mon Sep 17 00:00:00 2001 From: nereboss Date: Wed, 15 May 2024 15:16:03 +0200 Subject: [PATCH 05/14] Revert "Releasing ana-1.124.0" This reverts commit 628f1a244b15a5dfea11b05d410966e37bf3ef0a. --- README.md | 2 +- analysis/CHANGELOG.md | 2 -- analysis/gradle.properties | 2 +- analysis/node-wrapper/package-lock.json | 4 ++-- analysis/node-wrapper/package.json | 2 +- .../_posts/release/2024-05-15-ana_1_124_0.md | 24 ------------------- 6 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 gh-pages/_posts/release/2024-05-15-ana_1_124_0.md diff --git a/README.md b/README.md index 007c424781..65ecddf6ff 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@

Latest Release:
- Analysis 1.124.0 | Visualization 1.125.0 + Analysis 1.123.0 | Visualization 1.125.0 [comment]: ################################################################################## [comment]: diff --git a/analysis/CHANGELOG.md b/analysis/CHANGELOG.md index 9209b0f999..903552b4d9 100644 --- a/analysis/CHANGELOG.md +++ b/analysis/CHANGELOG.md @@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/) ## [unreleased] (Added 🚀 | Changed | Removed 🗑 | Fixed 🐞 | Chore 👨‍💻 👩‍💻) -## [1.124.0] - 2024-05-15 - ### Fixed 🐞 - Add default Docker user to mitigate `GitLogParser` issues during repo-scan [#3571](https://github.com/MaibornWolff/codecharta/pull/3571) diff --git a/analysis/gradle.properties b/analysis/gradle.properties index b6a631d844..03c88b66b0 100644 --- a/analysis/gradle.properties +++ b/analysis/gradle.properties @@ -1,4 +1,4 @@ -currentVersion=1.124.0 +currentVersion=1.123.0 org.gradle.parallel=true org.gradle.caching=true org.gradle.unsafe.configuration-cache=true diff --git a/analysis/node-wrapper/package-lock.json b/analysis/node-wrapper/package-lock.json index 38d7222bc8..8729126ad2 100644 --- a/analysis/node-wrapper/package-lock.json +++ b/analysis/node-wrapper/package-lock.json @@ -1,12 +1,12 @@ { "name": "codecharta-analysis", - "version": "1.124.0", + "version": "1.123.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codecharta-analysis", - "version": "1.124.0", + "version": "1.123.0", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { diff --git a/analysis/node-wrapper/package.json b/analysis/node-wrapper/package.json index 1b928ec52b..9a31c74686 100644 --- a/analysis/node-wrapper/package.json +++ b/analysis/node-wrapper/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/MaibornWolff/codecharta.git" }, "name": "codecharta-analysis", - "version": "1.124.0", + "version": "1.123.0", "description": "MaibornWolff CodeCharta Analysis Tools", "scripts": { "prepare": "rm -rf ../build/install/codecharta-analysis public && ../gradlew -p .. installDist && cp -R ../build/install/codecharta-analysis public", diff --git a/gh-pages/_posts/release/2024-05-15-ana_1_124_0.md b/gh-pages/_posts/release/2024-05-15-ana_1_124_0.md deleted file mode 100644 index 5821277fef..0000000000 --- a/gh-pages/_posts/release/2024-05-15-ana_1_124_0.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -categories: - - Release -tags: - - gh-pages - - release - - analysis - -title: Analysis version 1.124.0 ---- - -{{page.title}} is live and ready for [download](https://github.com/MaibornWolff/codecharta/releases/tag/ana-1.124.0). -This version brings the following: - -### Fixed 🐞 - -- Add default Docker user to mitigate `GitLogParser` issues during repo-scan [#3571](https://github.com/MaibornWolff/codecharta/pull/3571) -- Escaping and un-escaping windows paths, auto-detecting path separator for Unix and Windows - paths [#3569](https://github.com/MaibornWolff/codecharta/pull/3569) - -Chore 👨‍💻 👩‍💻 - -- Upgrade Gradle to version 8.7, now with support for Java version 21. [#3570](https://github.com/MaibornWolff/codecharta/pull/3570) -- Update docs to include that the `timeout` command is necessary on macOS to run integration tests [#3322](https://github.com/MaibornWolff/codecharta/pull/3615) From 4e9b9ed8e7437633095b897e13bff4c75a5506ea Mon Sep 17 00:00:00 2001 From: Sebastian Wolf <65733509+phanlezz@users.noreply.github.com> Date: Thu, 16 May 2024 11:19:13 +0200 Subject: [PATCH 06/14] Change assert to vararg string contains instead of listOf --- .../test/kotlin/de/maibornwolff/codecharta/ccsh/CcshTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analysis/tools/ccsh/src/test/kotlin/de/maibornwolff/codecharta/ccsh/CcshTest.kt b/analysis/tools/ccsh/src/test/kotlin/de/maibornwolff/codecharta/ccsh/CcshTest.kt index 8ab569336b..b9c3c57643 100644 --- a/analysis/tools/ccsh/src/test/kotlin/de/maibornwolff/codecharta/ccsh/CcshTest.kt +++ b/analysis/tools/ccsh/src/test/kotlin/de/maibornwolff/codecharta/ccsh/CcshTest.kt @@ -153,8 +153,8 @@ private val outContent = ByteArrayOutputStream() // then Assertions.assertThat(exitCode).isEqualTo(0) - Assertions.assertThat(outStream.toString()) - .contains(listOf("version", "Copyright(c) 2024, MaibornWolff GmbH\n")) + // The actual printed version is null, as well as the package name, as it is not set for this test class + Assertions.assertThat(outStream.toString()).contains("version", "Copyright(c) 2024, MaibornWolff GmbH") verify(exactly = 0) { ParserService.executePreconfiguredParser(any(), any()) } // clean up From e469192a3885f7b06f85c97101b0e99b358c235b Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 12:08:03 +0200 Subject: [PATCH 07/14] Add args to change default user #3308 This was caused by sapmachine who decided to add a user in a patch :) --- analysis/Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/analysis/Dockerfile b/analysis/Dockerfile index 3e8ce1f4c2..d616f123e1 100644 --- a/analysis/Dockerfile +++ b/analysis/Dockerfile @@ -1,5 +1,10 @@ FROM sapmachine:11.0.23 +ARG USER_ADD +ARG USER_ID=1000 +ARG USER_GID=$USER_UID +ARG USERNAME=nonroot-docker-user + COPY ./build/distributions/codecharta-analysis-*.tar /usr/local/ RUN cd /usr/local; \ @@ -34,12 +39,13 @@ RUN wget -qO /tmp/sonar-scanner.zip https://binaries.sonarsource.com/Distributio mkdir --parents /usr/local/conf ; cp ./conf/sonar-scanner.properties /usr/local/conf/; \ cp -r ./jre/ /usr/local/jre; cd /; rm /tmp/sonar-scanner.zip; rm -rf /tmp/sonar-scanner-*-linux; -ARG USERNAME=nonroot-docker-user -ARG USER_UID=1000 -ARG USER_GID=$USER_UID -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME; +RUN if [ -n "$USER_ADD" ]; then \ + groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_ID --gid $USER_GID -m $USERNAME; \ + else \ + USERNAME=ubuntu; \ + fi USER $USERNAME From 1ef6ae2f9a9af7a7782c3c93296a162733726010 Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 12:48:23 +0200 Subject: [PATCH 08/14] Change default user to ubuntu #3308 --- .github/workflows/test.yml | 4 ++-- analysis/Dockerfile | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff3530c6d2..f98d918c50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -150,9 +150,9 @@ jobs: - name: Docker Test Analysis run: | - docker build ./analysis -t local-ccsh --build-arg USER_UID=1001 + docker build ./analysis -t local-ccsh --build-arg USER_ADD=true USER_ID=1001 current_version=$(node -pe "require('./analysis/node-wrapper/package.json').version") - docker run -w /home/nonroot-docker-user/cc/analysis/test -v $(pwd):/home/nonroot-docker-user/cc local-ccsh bash ./golden_test.sh ${current_version} /home/nonroot-docker-user/tmp-files/ /usr/local/bin/ccsh + docker run -w /home/ubuntu/cc/analysis/test -v $(pwd):/home/ubuntu/cc local-ccsh bash ./golden_test.sh ${current_version} /home/ubuntu/tmp-files/ /usr/local/bin/ccsh working-directory: ${{env.project-directory}} - name: Setup Java JDK diff --git a/analysis/Dockerfile b/analysis/Dockerfile index d616f123e1..b1129bea71 100644 --- a/analysis/Dockerfile +++ b/analysis/Dockerfile @@ -3,7 +3,7 @@ FROM sapmachine:11.0.23 ARG USER_ADD ARG USER_ID=1000 ARG USER_GID=$USER_UID -ARG USERNAME=nonroot-docker-user +ARG USERNAME=ubuntu COPY ./build/distributions/codecharta-analysis-*.tar /usr/local/ @@ -43,8 +43,6 @@ RUN wget -qO /tmp/sonar-scanner.zip https://binaries.sonarsource.com/Distributio RUN if [ -n "$USER_ADD" ]; then \ groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_ID --gid $USER_GID -m $USERNAME; \ - else \ - USERNAME=ubuntu; \ fi USER $USERNAME From 07c375d6f8a00410064ca19847c7127953037a82 Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 12:59:23 +0200 Subject: [PATCH 09/14] Fix arg error #3308 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f98d918c50..0fa0dac65d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -150,7 +150,7 @@ jobs: - name: Docker Test Analysis run: | - docker build ./analysis -t local-ccsh --build-arg USER_ADD=true USER_ID=1001 + docker build ./analysis -t local-ccsh --build-arg USER_ADD=true --build-arg USER_ID=1001 current_version=$(node -pe "require('./analysis/node-wrapper/package.json').version") docker run -w /home/ubuntu/cc/analysis/test -v $(pwd):/home/ubuntu/cc local-ccsh bash ./golden_test.sh ${current_version} /home/ubuntu/tmp-files/ /usr/local/bin/ccsh working-directory: ${{env.project-directory}} From 0edaf5b2f0fc2768f8d280a43b1fd2a887e7b373 Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 13:11:00 +0200 Subject: [PATCH 10/14] Fix another arg error #3308 --- analysis/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysis/Dockerfile b/analysis/Dockerfile index b1129bea71..77ff7e7de6 100644 --- a/analysis/Dockerfile +++ b/analysis/Dockerfile @@ -2,7 +2,7 @@ FROM sapmachine:11.0.23 ARG USER_ADD ARG USER_ID=1000 -ARG USER_GID=$USER_UID +ARG USER_GID=$USER_ID ARG USERNAME=ubuntu COPY ./build/distributions/codecharta-analysis-*.tar /usr/local/ From 63823c111648008c7e62d5977e9ba952ec8912be Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 14:12:14 +0200 Subject: [PATCH 11/14] Change username because ubuntu doesnt work #3308 --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fa0dac65d..9872d3dd8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -150,9 +150,10 @@ jobs: - name: Docker Test Analysis run: | - docker build ./analysis -t local-ccsh --build-arg USER_ADD=true --build-arg USER_ID=1001 + user_instance="docker_runner" + docker build ./analysis -t local-ccsh --build-arg USER_ADD=true --build-arg USER_ID=1001 --build-arg USERNAME=${user_instance} current_version=$(node -pe "require('./analysis/node-wrapper/package.json').version") - docker run -w /home/ubuntu/cc/analysis/test -v $(pwd):/home/ubuntu/cc local-ccsh bash ./golden_test.sh ${current_version} /home/ubuntu/tmp-files/ /usr/local/bin/ccsh + docker run -w /home/${user_instance}/cc/analysis/test -v $(pwd):/home/${user_instance}/cc local-ccsh bash ./golden_test.sh ${current_version} /home/${user_instance}/tmp-files/ /usr/local/bin/ccsh working-directory: ${{env.project-directory}} - name: Setup Java JDK From 8d717b15086089273c1903fafdb6d41b599b3b4e Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 14:58:32 +0200 Subject: [PATCH 12/14] Add docs about new docker build and run functionality #3308 --- .github/workflows/test.yml | 3 +- DEV_START_GUIDE.md | 4 +++ gh-pages/_docs/01-04-docker-containers.md | 36 ++++++++++++++++++++++- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9872d3dd8f..3678524c51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -151,9 +151,10 @@ jobs: - name: Docker Test Analysis run: | user_instance="docker_runner" - docker build ./analysis -t local-ccsh --build-arg USER_ADD=true --build-arg USER_ID=1001 --build-arg USERNAME=${user_instance} + docker build ./analysis -t local-ccsh --build-arg USER_ADD=true --build-arg USER_ID=1001 --build-arg USERNAME=${user_instance} --no-cache current_version=$(node -pe "require('./analysis/node-wrapper/package.json').version") docker run -w /home/${user_instance}/cc/analysis/test -v $(pwd):/home/${user_instance}/cc local-ccsh bash ./golden_test.sh ${current_version} /home/${user_instance}/tmp-files/ /usr/local/bin/ccsh + docker build ./analysis -t local-ccsh --no-cache working-directory: ${{env.project-directory}} - name: Setup Java JDK diff --git a/DEV_START_GUIDE.md b/DEV_START_GUIDE.md index 06c38166e2..3aa56907e7 100644 --- a/DEV_START_GUIDE.md +++ b/DEV_START_GUIDE.md @@ -98,6 +98,10 @@ For the visualisation, we utilize Jest and puppeteer for unit- and e2e-tests. To When opening a pull requests, all tests are executed automatically using GitHub-actions and a branch can only be merged if all tests are successful. However, it is highly recommended to test changes before pushing them! +# Docker + +For deployment and usage of the docker images, check out our documentation page [here](https://maibornwolff.github.io/codecharta/docs/docker-containers/). + # Troubleshooting We mainly use IntelliJ for our development. The project generally works right away, but sometimes issues can occur: diff --git a/gh-pages/_docs/01-04-docker-containers.md b/gh-pages/_docs/01-04-docker-containers.md index 1946d556ee..760bdb0667 100644 --- a/gh-pages/_docs/01-04-docker-containers.md +++ b/gh-pages/_docs/01-04-docker-containers.md @@ -83,5 +83,39 @@ docker run -it -v $(pwd):/src -w /src codecharta/codecharta-analysis ccsh gitlog # gitlogparser [...] : check the gitlogparser documentation for more info ``` -> Be aware, that by default the user inside the docker image is 'nonroot-docker-user' with an ID of 1000. You may +> Be aware, that by default the user inside the docker image is 'ubuntu' with an ID of 1000. You may > encounter errors with `git` when you try to execute commands inside a repository cloned by a different `UID` + +> For **macOS users**, it is necessary to add `--user=501:dialout` Before the image name. Why? because docker on mac is fun :) + +### Build it yourself + +You can also build a docker image from the locally installed instance of codecharta. To do this, you would execute the following commands: + +```bash +# to build the container you need to navigate into the analysis folder +cd analysis + +# makes a clean build to ensure everything will be built correctly +./gradlew clean build + +# builds the docker container with an image name of your choice +docker build . -t your-image-name + +# executes bash inside of the created container +docker run -it your-image-name bash + +# to run the docker container with your current working directory mounted into it, +# you can alternatively run this +docker run -it -v $(pwd):/src -w /src your-image-name bash +``` + +There is also the option to customize the used docker user during the build. +This will create a new user with the given name and IDs. + +```bash +#USER_ADD: set it to any value to to add a new user +#USERNAME: the name of the user to be created +#USER_ID: the ID that is used for the new user and for its group +docker build ./analysis -t local-ccsh --build-arg USER_ADD=true --build-arg USER_ID=1001 --build-arg USERNAME=your_name +``` From dbf73890a4378db21091076ef78101970b7d57f0 Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 15:05:42 +0200 Subject: [PATCH 13/14] Update Changelog #3308 --- analysis/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/analysis/CHANGELOG.md b/analysis/CHANGELOG.md index 903552b4d9..1a65d39b49 100644 --- a/analysis/CHANGELOG.md +++ b/analysis/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/) ## [unreleased] (Added 🚀 | Changed | Removed 🗑 | Fixed 🐞 | Chore 👨‍💻 👩‍💻) +### Changed + +- Update GH-Pages and dev guide on how to use our docker images [#3621](https://github.com/MaibornWolff/codecharta/pull/3621/files) + ### Fixed 🐞 - Add default Docker user to mitigate `GitLogParser` issues during repo-scan [#3571](https://github.com/MaibornWolff/codecharta/pull/3571) From ee17710a1fbb998ccdae83c5ef8ea7ed11307250 Mon Sep 17 00:00:00 2001 From: nereboss Date: Thu, 16 May 2024 16:17:53 +0200 Subject: [PATCH 14/14] Releasing ana-1.125.0 --- README.md | 2 +- analysis/CHANGELOG.md | 2 ++ analysis/gradle.properties | 2 +- analysis/node-wrapper/package-lock.json | 4 +-- analysis/node-wrapper/package.json | 2 +- .../_posts/release/2024-05-16-ana_1_125_0.md | 28 +++++++++++++++++++ 6 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 gh-pages/_posts/release/2024-05-16-ana_1_125_0.md diff --git a/README.md b/README.md index 65ecddf6ff..c0026f68df 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@

Latest Release:
- Analysis 1.123.0 | Visualization 1.125.0 + Analysis 1.125.0 | Visualization 1.125.0 [comment]: ################################################################################## [comment]: diff --git a/analysis/CHANGELOG.md b/analysis/CHANGELOG.md index 1a65d39b49..2cf6e0cf4a 100644 --- a/analysis/CHANGELOG.md +++ b/analysis/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/) ## [unreleased] (Added 🚀 | Changed | Removed 🗑 | Fixed 🐞 | Chore 👨‍💻 👩‍💻) +## [1.125.0] - 2024-05-16 + ### Changed - Update GH-Pages and dev guide on how to use our docker images [#3621](https://github.com/MaibornWolff/codecharta/pull/3621/files) diff --git a/analysis/gradle.properties b/analysis/gradle.properties index 03c88b66b0..4baece1dac 100644 --- a/analysis/gradle.properties +++ b/analysis/gradle.properties @@ -1,4 +1,4 @@ -currentVersion=1.123.0 +currentVersion=1.125.0 org.gradle.parallel=true org.gradle.caching=true org.gradle.unsafe.configuration-cache=true diff --git a/analysis/node-wrapper/package-lock.json b/analysis/node-wrapper/package-lock.json index 8729126ad2..066b6a536b 100644 --- a/analysis/node-wrapper/package-lock.json +++ b/analysis/node-wrapper/package-lock.json @@ -1,12 +1,12 @@ { "name": "codecharta-analysis", - "version": "1.123.0", + "version": "1.125.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codecharta-analysis", - "version": "1.123.0", + "version": "1.125.0", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { diff --git a/analysis/node-wrapper/package.json b/analysis/node-wrapper/package.json index 9a31c74686..5f9e471a78 100644 --- a/analysis/node-wrapper/package.json +++ b/analysis/node-wrapper/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/MaibornWolff/codecharta.git" }, "name": "codecharta-analysis", - "version": "1.123.0", + "version": "1.125.0", "description": "MaibornWolff CodeCharta Analysis Tools", "scripts": { "prepare": "rm -rf ../build/install/codecharta-analysis public && ../gradlew -p .. installDist && cp -R ../build/install/codecharta-analysis public", diff --git a/gh-pages/_posts/release/2024-05-16-ana_1_125_0.md b/gh-pages/_posts/release/2024-05-16-ana_1_125_0.md new file mode 100644 index 0000000000..770688be38 --- /dev/null +++ b/gh-pages/_posts/release/2024-05-16-ana_1_125_0.md @@ -0,0 +1,28 @@ +--- +categories: + - Release +tags: + - gh-pages + - release + - analysis + +title: Analysis version 1.125.0 +--- + +{{page.title}} is live and ready for [download](https://github.com/MaibornWolff/codecharta/releases/tag/ana-1.125.0). +This version brings the following: + +### Changed + +- Update GH-Pages and dev guide on how to use our docker images [#3621](https://github.com/MaibornWolff/codecharta/pull/3621/files) + +### Fixed 🐞 + +- Add default Docker user to mitigate `GitLogParser` issues during repo-scan [#3571](https://github.com/MaibornWolff/codecharta/pull/3571) +- Escaping and un-escaping windows paths, auto-detecting path separator for Unix and Windows + paths [#3569](https://github.com/MaibornWolff/codecharta/pull/3569) + +Chore 👨‍💻 👩‍💻 + +- Upgrade Gradle to version 8.7, now with support for Java version 21. [#3570](https://github.com/MaibornWolff/codecharta/pull/3570) +- Update docs to include that the `timeout` command is necessary on macOS to run integration tests [#3322](https://github.com/MaibornWolff/codecharta/pull/3615)