From baa517845141077fa5944f469ebac842a6cf7558 Mon Sep 17 00:00:00 2001 From: JimAelf <165892081+JimAelf@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:41:15 +0800 Subject: [PATCH 01/13] update issue template update issue template --- .github/ISSUE_TEMPLATE/bug_report.md | 42 ++++++++++++----------- .github/ISSUE_TEMPLATE/config.yml | 10 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 29 ++++++++++------ 3 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6e4b2c3526..ea59817cf7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,31 +1,33 @@ --- -name: Bug report -about: Create a report to help us improve +name: 👾 Bug Report +about: Report a bug or issue with the project. title: '' -labels: '' +labels: 'bug' assignees: '' --- -**Describe the bug** +### Description A clear and concise description of what the bug is. -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +### Steps To Reproduce +1. Log in... +2. Ensure that... +3. Allow a long period of inactivity to pass... +4. Observe that... +5. Attempt to log in... -**Expected behavior** -A clear and concise description of what you expected to happen. +### Current Behavior +- After the period of inactivity... +- When the user tries to log in using another method... +- This causes a bug due to... -**Screenshots** -If applicable, add screenshots to help explain your problem. +### Expected Behavior +- After a long period of inactivity... +- When a user logs in successfully... +- This ensures that only... -**Environment (please complete the following information):** - - OS and version: [e.g. Ubuntu 18.04] - - Dotnet core version [e.g. 2.2.106] - -**Additional context** -Add any other context about the problem here. +### Environment +- Platform: PC +- Node: v18.18.0 +- Browser: Chrome 126.0.6478.56 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..163c1c437c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +blank_issues_enabled: false +issue_template: + - name: 👾 Bug Report + description: Report a bug or issue with the project. + labels: ["bug"] + template: bug_report.md + - name: 💡 Feature Request + description: Create a new ticket for a new feature request. + labels: ["enhancement"] + template: feature_request.md \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d61..a4b817533a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,27 @@ --- -name: Feature request -about: Suggest an idea for this project +name: 💡 Feature Request +about: Create a new ticket for a new feature request title: '' -labels: '' +labels: 'enhancement' assignees: '' --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +### Expected Behavior +Describe the expected behavior here. -**Describe the solution you'd like** -A clear and concise description of what you want to happen. +### Specifications +As a `user`, I would like to `action` so that `reason`. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +**Features:** +- describe feature details here. -**Additional context** -Add any other context or screenshots about the feature request here. +**Development Tasks:** +- [ ] Task 1 +- [ ] Task 2 + +### Dependencies +List any dependencies that are required for this feature by providing links to the issues or repositories. + +### References +List any references that are related to this feature request. \ No newline at end of file From 612468d739cd80eac0250b0a7d451d684809ba55 Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 09:42:59 +0800 Subject: [PATCH 02/13] Add a SonarQube configuration file to implement static code analysis. --- .github/workflows/sonarqube.yaml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/sonarqube.yaml diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml new file mode 100644 index 0000000000..0209b437e1 --- /dev/null +++ b/.github/workflows/sonarqube.yaml @@ -0,0 +1,42 @@ +on: + pull_request: + types: [opened, synchronize, reopened] + +name: PR Static Code Analysis +jobs: + static-code-analysis: + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '7.0' + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache SonarQube scanner + id: cache-sonar-scanner + uses: actions/cache@v1 + with: + path: ./.sonar/scanner + key: ${{ runner.os }}-sonar-scanner + restore-keys: ${{ runner.os }}-sonar-scanner + - name: Install SonarScanner for .NET + run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + - name: Add .NET global tools to PATH + run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH + - name: Begin SonarQube analysis + run: | + ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + dotnet build + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file From 8010f68613d900029d12286927de3ccf010cef9b Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 14:35:00 +0800 Subject: [PATCH 03/13] To clarify the specific project to be built. --- .github/workflows/sonarqube.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 0209b437e1..4f021c18b0 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -38,5 +38,5 @@ jobs: - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" - dotnet build - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + dotnet build AElf.All.sln + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 98846f27a59c747a1a24ade0be29a6938405c369 Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 14:50:24 +0800 Subject: [PATCH 04/13] Add protobuf in sonarqube.yaml --- .github/workflows/sonarqube.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 4f021c18b0..19c1f8357b 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -35,8 +35,10 @@ jobs: run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner - name: Add .NET global tools to PATH run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH + - name: Install protobuf + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" dotnet build AElf.All.sln - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file From 784bcb5a0d02ff65eebf80edf4525662aa8c4669 Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:01:24 +0800 Subject: [PATCH 05/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 19c1f8357b..d4066c57ad 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -35,8 +35,10 @@ jobs: run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner - name: Add .NET global tools to PATH run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - - name: Install protobuf - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - name: Install Protoc + uses: arduino/setup-protoc@v3 + with: + version: "19.4" - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 66de35c0b59b8a017198007eb101f7521d364769 Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:03:40 +0800 Subject: [PATCH 06/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index d4066c57ad..abc7545e76 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -38,7 +38,7 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v3 with: - version: "19.4" + version: "3.19.4" - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 6b701bff8a99afbd7703fda35d8d03a535288653 Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:11:33 +0800 Subject: [PATCH 07/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index abc7545e76..29ec611228 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -35,10 +35,10 @@ jobs: run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner - name: Add .NET global tools to PATH run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - version: "3.19.4" + - name: Install Protobuf 3.19.4 + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler=3.19.4 - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 54d980ee2c0cab70df6ee42d0442c8a689baaefe Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:13:26 +0800 Subject: [PATCH 08/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 29ec611228..1f70cc8d32 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -38,7 +38,7 @@ jobs: - name: Install Protobuf 3.19.4 run: | sudo apt-get update - sudo apt-get install -y protobuf-compiler=3.19.4 + sudo apt-get install -y protobuf-compiler=3.19.4-1 - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 9f3b2766b6d9825dc545b27985af4f4431fc997a Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:35:22 +0800 Subject: [PATCH 09/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 1f70cc8d32..32bcb0fbd2 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -35,10 +35,11 @@ jobs: run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner - name: Add .NET global tools to PATH run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - - name: Install Protobuf 3.19.4 + - name: Install Protobuf for C# run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler=3.19.4-1 + dotnet tool install --global Grpc.Tools --version 2.51.0 + dotnet tool install --global Google.Protobuf.Tools --version 3.19.4 + echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 4006f5b2239442372183175aa918e90cdbe24c5c Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:38:45 +0800 Subject: [PATCH 10/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 32bcb0fbd2..19c1f8357b 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -35,11 +35,8 @@ jobs: run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner - name: Add .NET global tools to PATH run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - - name: Install Protobuf for C# - run: | - dotnet tool install --global Grpc.Tools --version 2.51.0 - dotnet tool install --global Google.Protobuf.Tools --version 3.19.4 - echo "$HOME/.dotnet/tools" >> $GITHUB_PATH + - name: Install protobuf + run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Begin SonarQube analysis run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From 6540d8fba5d1be51d345d638e00b4fef6247018d Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 15:44:16 +0800 Subject: [PATCH 11/13] Change dotnet-version to 6. --- .github/workflows/sonarqube.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 19c1f8357b..cf33b0dd86 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -13,7 +13,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: '7.0' + dotnet-version: '6.0' - name: Set up JDK 17 uses: actions/setup-java@v1 with: From b41e056de354f631fc0deec35d3df639f29e50bd Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 16:04:54 +0800 Subject: [PATCH 12/13] dotnet-version: '6.0' -> dotnet-version: '7.0' --- .github/workflows/sonarqube.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index cf33b0dd86..19c1f8357b 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -13,7 +13,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0' + dotnet-version: '7.0' - name: Set up JDK 17 uses: actions/setup-java@v1 with: From 39d6aa122c268803ba7b8a348270bda1e374f444 Mon Sep 17 00:00:00 2001 From: "chopin.fan" Date: Thu, 27 Jun 2024 16:16:40 +0800 Subject: [PATCH 13/13] Change the version of Protobuf to 3.19.4 --- .github/workflows/sonarqube.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 19c1f8357b..01e315a740 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -14,6 +14,8 @@ jobs: - uses: actions/setup-dotnet@v4 with: dotnet-version: '7.0' + - name: Create temporary global.json + run: echo '{"sdk":{"version":"7.0.410"}}' > ./global.json - name: Set up JDK 17 uses: actions/setup-java@v1 with: @@ -41,4 +43,7 @@ jobs: run: | ./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" dotnet build AElf.All.sln - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + + + \ No newline at end of file