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 and readme.md.

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

It's necessary for the first time:

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

Build with Cython and generate package with poetry:

poetry run python setup.py
poetry build
poetry publish
poetry run python setup.py clean

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.6.0

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.6.0
    - 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.6.0.tar.gz (1.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.6.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coderider_codereview-0.6.0.tar.gz
  • Upload date:
  • Size: 1.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.6.0.tar.gz
Algorithm Hash digest
SHA256 b56fb710d64b292175aa4f77b3ec218fe258c7beebbf63357b72233f0a0014bd
MD5 6ca41e324a6f6e3c59eece4784d9bd1b
BLAKE2b-256 6c4eb37dd00c0c5364e516581046fceb8d57c95c81bb0cf879a30f30d86021e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coderider_codereview-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc6d19890c83dd64905ca1cdfdf4354a46d46529a7e7ca006960948881b4bd64
MD5 56b5296ff08ac435e282a06a0dccc532
BLAKE2b-256 1c4571b895bcfd3411ca9cb06a8d8c1181e6bf00eeede718b8a06441e1f1b73e

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