From 5691a7667654ceae22891d6b598d3449035436f1 Mon Sep 17 00:00:00 2001 From: George Tay Date: Mon, 1 Apr 2024 12:08:52 +0800 Subject: [PATCH 1/8] Migrate CI/CD to Java 11 --- .github/workflows/integration.yml | 8 ++++---- build.gradle | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bca3ab3167..86109a4c12 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -13,11 +13,11 @@ on: env: NODE_VER: '16.x' JAVA_DISTRIBUTION: 'zulu' - JAVA_VER: 8 + JAVA_VER: 11 jobs: mainbuild: - name: ${{ matrix.os }} JDK 8 + name: ${{ matrix.os }} JDK 11 strategy: fail-fast: false matrix: @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 1.8 + - name: Set up JDK 1.11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} @@ -120,7 +120,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 1.8 + - name: Set up JDK 1.11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} diff --git a/build.gradle b/build.gradle index 95e377018b..521a863b78 100644 --- a/build.gradle +++ b/build.gradle @@ -18,8 +18,8 @@ mainClassName = 'reposense.RepoSense' node.download = false // The Liferay Node Gradle Plugin will use the system PATH to find the Node/npm executable. -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_11 +targetCompatibility = JavaVersion.VERSION_11 repositories { mavenCentral() From 8af326525547d31dd62733ed9a64a072629a4fa7 Mon Sep 17 00:00:00 2001 From: George Tay Date: Thu, 4 Apr 2024 10:08:06 +0800 Subject: [PATCH 2/8] Update Docs to reflect Java 11 --- docs/dg/devOpsGuide.md | 4 ++-- docs/dg/learningBasics.md | 4 ++-- docs/dg/projectManagement.md | 4 ++-- docs/dg/settingUp.md | 2 +- docs/ug/generatingReports.md | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/dg/devOpsGuide.md b/docs/dg/devOpsGuide.md index 7682dc7275..52ccf5157b 100644 --- a/docs/dg/devOpsGuide.md +++ b/docs/dg/devOpsGuide.md @@ -28,8 +28,8 @@ This page documents the various components that form part of the DevOps infrastr All three types of tests in the test suite are run in a single GitHub Actions workflow called "Continuous Integration". The steps are defined in [`integration.yml`](https://github.com/reposense/RepoSense/blob/master/.github/workflows/integration.yml) and are split into two types of jobs: -1. Ubuntu/macOS/Windows JDK 8 (`mainbuild`): Runs both unit tests and system tests on JDK 1.8 running on supported Ubuntu, macOS and Windows versions. For Ubuntu, this job also produces a RepoSense report and the MarkBind documentation website for previewing. -2. Cypress frontend tests (`cypress`): Runs only the frontend tests on JDK 1.8 running on Ubuntu. +1. Ubuntu/macOS/Windows JDK 11 (`mainbuild`): Runs both unit tests and system tests on JDK 11 running on supported Ubuntu, macOS and Windows versions. For Ubuntu, this job also produces a RepoSense report and the MarkBind documentation website for previewing. +2. Cypress frontend tests (`cypress`): Runs only the frontend tests on JDK 11 running on Ubuntu. The list of supported OS versions are [available on the GitHub Docs website](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources). These jobs should be updated regularly whenever RepoSense supports newer versions of the Java Development Kit (JDK) as well as when new OS versions are made available (via the job OS matrix). Frontend tests are run separately to take advantage of parallel job execution. diff --git a/docs/dg/learningBasics.md b/docs/dg/learningBasics.md index d69923593c..d4b7e2366e 100644 --- a/docs/dg/learningBasics.md +++ b/docs/dg/learningBasics.md @@ -31,9 +31,9 @@ The backend implementation of RepoSense is located in `src/main`. {{ step(1) }} **Know Java** -The RepoSense backend is mostly written in `Java 8`. +The RepoSense backend is mostly written in `Java 11`. -1. You need to have a basic knowledge of Java before getting started, including its syntax, [API](https://docs.oracle.com/javase/8/docs/api/), and certain frameworks such as [JUnit](https://se-education.org/learningresources/contents/java/JUnit.html). +1. You need to have a basic knowledge of Java before getting started, including its syntax, [API](https://docs.oracle.com/javase/11/docs/api/), and certain frameworks such as [JUnit](https://se-education.org/learningresources/contents/java/JUnit.html). 1. Once you are familiar with the basic syntax, you may wish to learn more advanced topics such as [concurrency](https://se-education.org/learningresources/contents/java/JavaConcurrency.html), [synchronization](https://se-education.org/learningresources/contents/java/JavaSynchronization.html), and [streams](https://se-education.org/learningresources/contents/java/streams-an-introduction.html). These topics can help you to understand certain part of the backend implementation (concurrent cloning and analysis of multiple repositories, etc.). They are optional but you may find them useful when working on certain issues. {{ step(2) }} **Learn the RepoSense backend architecture** diff --git a/docs/dg/projectManagement.md b/docs/dg/projectManagement.md index 6a50b1dca4..388a02cc77 100644 --- a/docs/dg/projectManagement.md +++ b/docs/dg/projectManagement.md @@ -25,7 +25,7 @@ This page contains information about project management tasks. The target audien Before making a release, please check the following prerequisites: -* Ensure that you have **JDK `1.8.0`** installed (==Not other major release versions such as **JDK `9`** or **JDK `11`**==). +* Ensure that you have **JDK `11`** installed (==Not other major release versions such as **JDK `12`** or **JDK `13`**==). * Ensure that the `JAVA_HOME` environment variable is correctly set to your JDK installation directory. You can refer to the [JDK Installation Guide](https://docs.oracle.com/cd/E19182-01/821-0917/inst_jdk_javahome_t/index.html). * Ensure that you have merged the [upstream](https://github.com/RepoSense/reposense) `master` branch into both the local and upstream `release` branch according to the following steps: 1. In your local repository, reset your `master` branch to be exactly the same as the upstream `master` branch. @@ -43,7 +43,7 @@ Take note of the following when making the release according to the above guide: * Before launching the release, generate the `RepoSense.jar` file and attach it to the release. 1. Switch to the `release` branch. 1. In the terminal, change the directory to the project root directory. - 1. Run `gradlew --version` to check that the JDK version is 1.8.0. + 1. Run `gradlew --version` to check that the JDK version is 11. 1. Run `gradlew shadowJar`, and the Jar file will be generated at `{buildDir}/jar/`. 1. Check that the Jar file is working. You may need to check that the report can be generated from the Jar file both locally and remotely by following the [Generating Reports Guide](../ug/generatingReports.html). diff --git a/docs/dg/settingUp.md b/docs/dg/settingUp.md index cdeee4eb50..cc26d56ee8 100644 --- a/docs/dg/settingUp.md +++ b/docs/dg/settingUp.md @@ -9,7 +9,7 @@

{{ title }}

**Prerequisites:** -* **JDK `1.8.0_60`** up to **`17`** ([download :fas-download:](https://www.oracle.com/technetwork/java/javase/downloads/index.html)). +* **JDK `11.0.21+9`** up to **`17`** ([download :fas-download:](https://www.oracle.com/technetwork/java/javase/downloads/index.html)). * **Node.js** **`18`** up to the latest minor version of **`19`** ([download :fas-download:](https://www.npmjs.com/get-npm)). * **git `2.23`** or later ([download :fas-download:](https://git-scm.com/downloads)). diff --git a/docs/ug/generatingReports.md b/docs/ug/generatingReports.md index 75137da9a5..bbc574d4d8 100644 --- a/docs/ug/generatingReports.md +++ b/docs/ug/generatingReports.md @@ -29,7 +29,7 @@ For other types of repositories, external links are disabled. ## Generating reports locally 1. **Ensure you have the prerequisites**: - * **Java 8** (JRE `1.8.0_60`) or later ([download :fas-download:](https://www.java.com/en/)). + * **Java 11** or later ([download :fas-download:](https://www.java.com/en/)). * **git `2.23`** or later on the command line. ([download :fas-download:](https://git-scm.com/downloads)).
run `git --version` in your OS terminal to confirm the version. 1. **Download the latest JAR file** from our [releases](https://github.com/reposense/RepoSense/releases/latest). From 1efd495ac4b648ac72adf6713f6f01287cedd504 Mon Sep 17 00:00:00 2001 From: George Tay Date: Thu, 4 Apr 2024 10:10:38 +0800 Subject: [PATCH 3/8] Update CI JDK version --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8d502015d2..08aa4a60fb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 1.11 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} @@ -120,7 +120,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 1.11 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} From 6ac96e69ff256b1d2acf2036112375c1a52cc9cb Mon Sep 17 00:00:00 2001 From: George Tay Date: Fri, 5 Apr 2024 23:00:43 +0800 Subject: [PATCH 4/8] Update checkstyle tool --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 521a863b78..0f9b6a4198 100644 --- a/build.gradle +++ b/build.gradle @@ -99,7 +99,7 @@ run { } checkstyle { - toolVersion = '9.3' + toolVersion = '10.10.0' getConfigDirectory().set(file("$rootProject.projectDir/config/checkstyle")) } From 3bec826f2e0665a4b76b5463187db39bc5f6d00d Mon Sep 17 00:00:00 2001 From: George Tay Date: Sat, 13 Apr 2024 16:28:30 +0800 Subject: [PATCH 5/8] Revert "Update CI JDK version" The updating of the Checkstyle tool will be deferred to another PR to avoid causing dependency issues arising from backwards compatibility. --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 08aa4a60fb..8d502015d2 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK 1.11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} @@ -120,7 +120,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK 1.11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} From 04457890ef49f572bcd36e6958b920db98320075 Mon Sep 17 00:00:00 2001 From: George Tay Date: Sat, 13 Apr 2024 17:26:20 +0800 Subject: [PATCH 6/8] Reapply "Update CI JDK version" Reapplying revert action as it was reverted on the wrong commit. --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8d502015d2..08aa4a60fb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 1.11 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} @@ -120,7 +120,7 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 1.11 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: distribution: ${{ env.JAVA_DISTRIBUTION }} From 5b1ca538942aff4c3969005e2768c40d2c49d8c8 Mon Sep 17 00:00:00 2001 From: George Tay Date: Sat, 13 Apr 2024 17:27:05 +0800 Subject: [PATCH 7/8] Revert "Update checkstyle tool" The updating of the Checkstyle tool will be deferred to another PR to avoid causing dependency issues arising from backwards compatibility. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0f9b6a4198..521a863b78 100644 --- a/build.gradle +++ b/build.gradle @@ -99,7 +99,7 @@ run { } checkstyle { - toolVersion = '10.10.0' + toolVersion = '9.3' getConfigDirectory().set(file("$rootProject.projectDir/config/checkstyle")) } From 8063be0f35ef1527d3e108cf432da09a02bf57a5 Mon Sep 17 00:00:00 2001 From: George Tay Date: Fri, 26 Apr 2024 13:31:45 +0800 Subject: [PATCH 8/8] Remove deprecated flags --- build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index 521a863b78..cd12100862 100644 --- a/build.gradle +++ b/build.gradle @@ -199,8 +199,6 @@ def serveTestReportInBackground = tasks.register('serveTestReportInBackground', args = ['--config', './exampleconfig', '--since', 'd1', '--view'] String versionJvmArgs = '-Dversion=' + getRepoSenseVersion() jvmArgs = [ versionJvmArgs ] - killDescendants = false // Kills descendants of started process using methods only found in Java 9 and beyond. - // Above flag is set to true by default but is incompatible with Java 8. It should be removed from this file if we fully migrate to Java 11. waitForPort = 9000 }