Skip to main content

AI Code Review from CodeRider

Project description

CodeRider CodeReview

How to set up

Copy .env.example to .env, and set ENV:

CR_AI_BOT_TOKEN=""
# CR_MR_PROJECT_PATH=""
# CR_MR_IID=""

Install dependencies:

poetry install

Publish

Update versions of pyproject.toml and coderider_codereview/__init__.py.

https://pypi.org/project/coderider-codereview/

poetry build
poetry config pypi-token.pypi <pypi-token>
poetry publish

Use it in local

pip install coderider_codereview
CR_AI_BOT_TOKEN="" CR_MR_PROJECT_PATH="" CR_MR_IID="" crcr

GitLab CI Template File

https://jihulab.com/-/snippets/6198

include:
  - remote: 'https://jihulab.com/-/snippets/6198/raw/main/coderider-codereview-0.5.1.yml'
# 0.5.1

CodeRiderCodeReview:
  stage: test
  image: python:3.11
  variables:
  # CR_AI_BOT_TOKEN: "<Set it through GitLab CI/CD variables>"
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      needs:
        - job: semgrep-sast
          optional: true
          artifacts: true
        - job: secret_detection
          optional: true
          artifacts: true
  before_script: [ ]
  after_script: [ ]
  script:
    - ls -l gl-sast-report.json || true
    - ls -l gl-secret-detection-report.json || true
    - pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
    - pip install --no-cache-dir coderider-codereview==0.5.1
    - crcr

# Override artifacts paths
sast:
  artifacts:
    access: 'developer'
    reports:
      sast: gl-sast-report.json
    paths: [ gl-sast-report.json ]
  rules:
    - when: never
  script:
    - echo "$CI_JOB_NAME is used for configuration only, and its script should not be executed"
    - exit 1

.secret-analyzer:
  artifacts:
    access: 'developer'
    reports:
      secret_detection: gl-secret-detection-report.json
    paths: [ gl-secret-detection-report.json ]

Dependencies

  • Vulnerability comments in diff: GitLab >= 16.5
  • Customize analyzer settings: Premium Plan
  • Project Access Token: Premium Plan

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coderider_codereview-0.5.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coderider_codereview-0.5.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file coderider_codereview-0.5.1.tar.gz.

File metadata

  • Download URL: coderider_codereview-0.5.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.6 Darwin/23.4.0

File hashes

Hashes for coderider_codereview-0.5.1.tar.gz
Algorithm Hash digest
SHA256 9a027d20ea0185effc63fdb091e4fc56d6dcbc13459ec1fc614ef60c6474ead8
MD5 c2ccbc2f7b1435488ad23da2e8f9622d
BLAKE2b-256 1c07d9ef977e01638190efd3733bde98faef8cdf4ca6e3b6ee307f2a44abb8b3

See more details on using hashes here.

File details

Details for the file coderider_codereview-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for coderider_codereview-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 daeb1ae8e19c9db8855718bb9a8cc1074cb6a73bf08cf1199bdc65a8698bfdc9
MD5 6e973999d71456b4faac23fa89f92cc8
BLAKE2b-256 7ec8243a65fab664a9766f29a828d0a32441a9dbca19fa49dc8f5a99de112a31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page