neo icon indicating copy to clipboard operation
neo copied to clipboard

IA: Check IA reviewer

Open shargon opened this issue 2 years ago • 13 comments

Add automatics reviews to ours prs

shargon avatar Feb 14 '24 19:02 shargon

@shargon We had to create a new repository inside the organization. It's not added to the repository itself (afaik). I think you need to fork it inside Neo

lock9 avatar Feb 14 '24 19:02 lock9

@shargon We had to create a new repository inside the organization. It's not added to the repository itself (afaik). I think you need to fork it inside Neo

I think that we need to wait for spread the api changes

shargon avatar Feb 14 '24 19:02 shargon

@shargon Hey why not use githubs?

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
  push:
    branches: ["master"]
    paths-ignore:
      - '.gitignore'
      - '.gitattributes'
      - 'LICENSE'
      - '**/*.md'
  schedule:
    - cron: "35 10 * * 3"

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language:
          - csharp

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v2
        with:
          languages: ${{ matrix.language }}

      - name: Setup .NET Core
        if: matrix.language == 'csharp'
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: "7.0.x"

      - name: Restore dependencies
        if: matrix.language == 'csharp'
        run: dotnet restore neo-express.sln

      - name: Build
        if: matrix.language == 'csharp'
        run: dotnet build neo.sln --configuration Release --no-restore --verbosity normal

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v2
        with:
          category: "/language:${{matrix.language}}"

cschuchardt88 avatar Feb 14 '24 22:02 cschuchardt88

@shargon Hey why not use githubs?

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
  push:
    branches: ["master"]
    paths-ignore:
      - '.gitignore'
      - '.gitattributes'
      - 'LICENSE'
      - '**/*.md'
  schedule:
    - cron: "35 10 * * 3"

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language:
          - csharp

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v2
        with:
          languages: ${{ matrix.language }}

      - name: Setup .NET Core
        if: matrix.language == 'csharp'
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: "7.0.x"

      - name: Restore dependencies
        if: matrix.language == 'csharp'
        run: dotnet restore neo-express.sln

      - name: Build
        if: matrix.language == 'csharp'
        run: dotnet build neo.sln --configuration Release --no-restore --verbosity normal

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v2
        with:
          category: "/language:${{matrix.language}}"

CodeQL is more for security than review, isn't it? we can have it, but it's a different thing

shargon avatar Feb 14 '24 22:02 shargon

what are you expecting it to do? Besides that? Write our code?

cschuchardt88 avatar Feb 14 '24 22:02 cschuchardt88

what are you expecting it to do? Besides that? Write our code?

Provide an automatic review. It could helps, or not, but we can try.

shargon avatar Feb 14 '24 22:02 shargon

Also it doesn't take into account our .editorconfig or any other preferences? Why not use some that works for our language. Not all languages.

cschuchardt88 avatar Feb 14 '24 22:02 cschuchardt88

https://learn.microsoft.com/en-us/dotnet/devops/dotnet-github-action-reference

please say something more than a link

shargon avatar Feb 14 '24 22:02 shargon

https://learn.microsoft.com/en-us/dotnet/devops/dotnet-github-action-reference

please say something more than a link

sorry posted wrong one this is the one https://github.com/dotnet/code-analysis

cschuchardt88 avatar Feb 14 '24 22:02 cschuchardt88

Also it doesn't take into account our .editorconfig or any other preferences? Why not use some that works for our language. Not all languages.

I don't know what percentage of comments will be useful until we try.

shargon avatar Feb 14 '24 22:02 shargon

https://learn.microsoft.com/en-us/dotnet/devops/dotnet-github-action-reference

please say something more than a link

sorry posted wrong one this is the one https://github.com/dotnet/code-analysis

  • This review only the PR, or all the code?
  • It leaves a comment or stop the workflow?

shargon avatar Feb 14 '24 22:02 shargon

Than try this

Enable all CAxxxx and IDExxxx rules for a single solution at repo root, such that code analysis violations break the build.

- name: Run .NET Code Analysis
  uses: dotnet/code-analysis@v1
  id: code-analysis
  with:
    solution: neo.sln
    build-breaking: true
    all-categories: all

We can configure it to whatever we want it to do.

I don't know what percentage of comments will be useful until we try.

If you dont know than we shouldnt use it.

cschuchardt88 avatar Feb 14 '24 22:02 cschuchardt88

Let's test it in neo-modules, and wait for add to other repos

shargon avatar Feb 15 '24 08:02 shargon