All Products
Search
Document Center

Alibaba Cloud DevOps:Code review AI assistant

Last Updated:Oct 16, 2026

The Alibaba Cloud DevOps AI Assistant analyzes code changes to provide automated reviews, fix suggestions, custom rule enforcement, and intelligent conversations, reducing manual review effort and improving review efficiency.

Billing and feature enablement

AI-powered code review is a feature of the Alibaba Cloud DevOps AI Assistant, which uses a pay-as-you-go billing method.

  • Unit: Credits (AI_Credits).

  • View usage: Organization administrators can go to Admin Console > AI Usage to view the credit consumption of the AI Assistant. Click View Resource Details to view detailed credit usage records, which support filtering by time range and export. Each review consumes approximately 100 credits. The actual amount varies based on code volume and complexity, so refer to the credit records for accurate data.

  • Billing source: The Alibaba Cloud DevOps AI Assistant uses the core capabilities of STAROps (Full-Domain Intelligent O&M Platform), and billing is handled by STAROps. For specific billing rules, see STAROps Billing.

For first-time use, the organization owner must enable the AI-powered code review feature in the admin console: Admin Console > AI Assistant Management > Public AI Assistant. After it is enabled, all code repositories can use the AI-powered code review feature. Reviews incur charges. Monitor the AI credit details in Alibaba Cloud DevOps and the billing details in STAROps.

Auto-generate review titles and descriptions

  1. As a user with the Developer role or higher in a code repository, create a merge request and select the source and target branches.

  2. Click the auto-generate icon in the title or description input box to automatically generate the title or description.

After the merge request is created, you can also go to the review details page to auto-generate and update the description based on the latest changes.

AI-powered code review

Configure AI review rules

  1. As a code repository administrator, navigate to repository settings and select AI Assistant Settings.

  2. Configure the Default AI Review Settings:

    1. If you select None, AI reviews are not automatically triggered for any merge request, regardless of the target branch.

    2. If you select All, AI reviews are automatically triggered for every merge request, regardless of the target branch.

    3. You can specify branches by name. When a merge request targets one of these branches, an AI review is automatically triggered. Branch names support wildcards using glob syntax:

      • ? matches a single character, excluding /.

      • * matches multiple characters within a single path segment.

      • ** matches multiple path segments.

      • For detailed rules, see glob.

  3. Configure Custom AI Review Rules (Optional): You can define rules tailored to your team's preferences to improve review accuracy and reduce AI hallucinations.

Custom AI review rules

You can define review rules in a YAML file. The system reads the configuration from the .aliyun/code/code_review.yaml file in the source branch. These rules apply to all branches in the repository.

Supported YAML syntax

The following example shows the supported syntax. The root keyword is reviews. You can use ignores to exclude files from reviews, language to set the review language, problem_level to define the severity threshold, review_mode to set the review mode, and path_instructions to specify custom rules for certain file paths. In the BY_COMMIT review mode, the enable_review_commit_message keyword controls whether commit messages are reviewed.

reviews:
  # files that ignore to review, glob pattern
  ignores:
    - myfile.txt
    - myfolder/
    - "*.log"
    - "**/logs"
    - /debug.log
  # basic config
  language: "zh-CN" # Optional values: [zh-CN|en-US]
  problem_level: "CRITICAL" # Optional values: [BLOCKER|CRITICAL|MAJOR|MINOR] 
  review_mode: "DEFAULT" # Optional values: [DEFAULT|BY_COMMIT]
  enable_review_commit_message: true # Takes effect only when review_mode is BY_COMMIT. Optional values: [true|false]
  # instructions match specify file path
  path_instructions:
  - path: "**/*.js"
    instructions: 'Review the JavaScript code against the Alibaba JavaScript style
      guide and point out any mismatches'
  - path: "tests/**.*"
    instructions: |-
      Review the following unit test code written using the Mocha test library. Ensure that:
      - The code adheres to best practices associated with Mocha.
      - Descriptive test names are used to clearly convey the intent of each test.
  1. Ignore specific files during review.

You can exclude certain files, such as configuration or test files, from AI reviews. Use the ignores keyword to define file path patterns. These patterns support glob syntax. For detailed rules, see glob.

reviews:
  # files that ignore to review, glob pattern
  ignores:
    - myfile.txt
    - myfolder/
    - "*.log"
    - "**/logs"
    - /debug.log
  1. Set basic review configurations.

  • language parameter: Specifies the language for review comments. Supported values are zh-CN (Chinese) and en-US (English). The default is zh-CN.

  • problem_level parameter: Sets the minimum severity level for reported issues. The options, in decreasing order of severity, are BLOCKER (only blocker issues), CRITICAL (critical and above), MAJOR (major and above), and MINOR (all issues including minor suggestions). The default is CRITICAL. Setting this parameter to MINOR may generate a large number of comments.

  • review_mode parameter: Sets the review mode. Supported values are DEFAULT (default review mode) and BY_COMMIT (single-commit review mode). The default is DEFAULT.

  • enable_review_commit_message parameter: This parameter takes effect only when review_mode is set to BY_COMMIT. It determines whether to review the commit message in single-commit review mode. The default is true. When enabled, a Commit Message Suggestions section is added to the review summary, providing suggestions for each commit message.

reviews:
  # basic config
  language: "zh-CN" # Optional values: [zh-CN|en-US]
  problem_level: "CRITICAL" # Optional values: [BLOCKER|CRITICAL|MAJOR|MINOR]
  review_mode: "DEFAULT" # Optional values: [DEFAULT|BY_COMMIT] 
  enable_review_commit_message: true # Takes effect only when review_mode is BY_COMMIT. Optional values: [true|false]
  1. Define custom review rules.

To align with your team's specific coding standards, you can use the path_instructions keyword to define custom review rules for specific file paths using natural language. These path patterns support glob syntax. For detailed rules, see glob.

reviews:
  # instructions match specify file path
  path_instructions:
  - path: "**/*.js"
    instructions: 'Review the JavaScript code against the Alibaba JavaScript style
      guide and point out any mismatches'
  - path: "tests/**.*"
    instructions: |-
      Review the following unit test code written using the Mocha test library. Ensure that:
      - The code adheres to best practices associated with Mocha.
      - Descriptive test names are used to clearly convey the intent of each test.
  1. Sandbox configuration (Optional)

You can configure a sandbox to control the AI review runtime environment and enable advanced analysis capabilities. Enabling cross-file analysis may increase token consumption and processing time.

  • enable parameter: Enables or disables running AI reviews in a sandbox environment. Supported values are true and false. The default is false. This option has no effect unless a specific capability switch is also enabled.

  • enable_crossfile_analyze parameter: Enables cross-file change detection. Supported values are true and false. The default is false. This parameter is effective only when enable is true. When enabled, the AI review automatically detects breaking changes across files, such as changes in return value semantics, unhandled exceptions, or altered parameter order.

reviews:
  # Sandbox configuration (Optional)
  sandbox:
    enable: true
    enable_crossfile_analyze: true
More advanced sandbox capabilities will be available in the future.

Global code review configuration

You can configure unified code review rules at the enterprise level. All repositories automatically inherit these rules.

Configuration method: Create a code repository named yx-ai-codereview within your enterprise. In this repository, create a configuration file at .aliyun/code/code_review.yaml. The configuration format is the same as described in this section.

Merge rules:

Field type

Merge strategy

ignores

The lists are merged. The local configuration's items are listed first, followed by the global configuration's items.

path_instructions

Local rules override global rules. If a file path is matched by a local rule, any global rule for the same path is ignored.

Basic fields like language and problem_level

The local configuration completely overrides the global configuration.

FAQ:

Q1: What name is required for the global configuration repository?

A: The repository must be named yx-ai-codereview.

Q2: How do I prevent a repository from using the global configuration?

A: Create a local configuration file in the repository to override the global settings.

Use AI-powered review

Limitations

The AI review feature has the following change size limitations:

  1. Reviews are not supported for changes exceeding 1,000 modified lines.

  2. Reviews are not supported for changes affecting more than 100 files.

Trigger a review

  1. When you create a merge request, you can choose whether to immediately run an AI review. If you have configured branch rules in the Default AI Review Settings, the AI review option is automatically selected when the target branch matches a rule.

  2. On the merge request details page, users with the Developer role or higher can manually trigger a review.

  3. In a merge request comment, @mention Alibaba Cloud DevOps AI Assistant to trigger an AI review.

  • If an AI review or commenting process is already in progress, you cannot trigger a new one until the current process is complete.

  • An AI review cannot be re-triggered on the same version of the code. You must push new changes to start another review.

In the AI Review section of the right-side panel, click the Request Review button next to Alibaba Cloud DevOps AI Assistant to trigger a review.

Review results

  1. A summary of code changes, including a list of modified files and their descriptions.

The review result also includes a sequence diagram that illustrates call relationships between the components involved in the changes.

  1. Line-level issue detection and suggested fixes.

The AI Assistant adds comments directly to the code diff view, highlighting issues on specific lines and suggesting fixes. Each comment includes the severity level (for example, Critical | Bugs), a description, and a code diff with the recommended fix, such as adding a .refine() validation to the status field to restrict valid status IDs. The right-side panel shows the AI review status and the count of To Be Resolved issues. Inline review comments include Accept and False Positive buttons, which you can use to provide feedback on the AI review result.

  1. Review summary

The review report summarizes findings with a breakdown by severity level: Blocker, Critical, Major, and Minor. Below the summary, each level lists its issues with descriptions, file paths, and line numbers.

  1. Review modes: You can choose between the default review mode and the single-commit review mode. This can be specified in the review rule file using the review_mode keyword.

  • Default review mode: This mode reviews all commits in a merge request as a single, consolidated code change. It is ideal for small, atomic changes.

  • Single-commit review mode: This mode is ideal for complex merge requests with a large number of commits or extensive changes.

    • Provides a more granular review, making it easier to focus on small yet critical modifications.

    • Considers the commit message to better understand the developer's intent, leading to more relevant suggestions and fewer false positives. For example, the AI assistant might detect that the code FILE_MAX_SIZE = 1024 * 1024L (1 MB) contradicts the commit message, which specifies 1 GB. It would flag this as a Critical bug and suggest changing the code to FILE_MAX_SIZE = 1024L * 1024 * 1024 to match the intended requirement.

    • Reviews the commit message itself, providing suggestions to improve its quality and format. The tool generates a Commit Message Suggestions page that checks each commit for Format Issues (such as whether the subject line is in English and uses the imperative mood) and Content Quality (such as clarity and avoidance of redundant descriptions in the body). It then offers suggestions for improvement, like rewriting a Chinese subject line into an English imperative sentence, such as Add file meta info to file list API response.

Limitation of single-commit review mode: Compared to the default review mode, the single-commit review mode can significantly increase review time when there are many commits. In extreme cases, the processing time can be more than three times as long as that of the default review mode. Choose the mode that best balances review depth with performance for your project.

Review with project convention files

The Alibaba Cloud DevOps AI Assistant can reference project convention files in your repository to review current code changes against your team's coding standards, architectural constraints, and agreed business requirements. This makes review suggestions more relevant to your project.

Enable the feature

As a repository administrator, go to Repository Settings > AI Assistant Settings and turn Use Project Convention Files on or off. The feature is enabled by default. If you disable it, newly initiated reviews no longer load project convention files. Other review capabilities remain available.

Supported project convention files

The AI Assistant automatically looks for the following files or rule directories in the repository root, the directories containing files changed in the current review, and each ancestor directory. No additional configuration in the review rules YAML file is required. Fixed file names and directory entry names support uppercase and lowercase variants.

Type

Supported files or directories

General project conventions

AGENTS.md, CLAUDE.md, GEMINI.md

AI tool conventions

.claude/CLAUDE.md

.github/copilot-instructions.md

.cursor/BUGBOT.md

.gemini/styleguide.md

.cursorrules

.windsurfrules

.clinerules

.roorules

.claude/rules/

.windsurf/rules/

.devin/rules/

.clinerules/

.cline/rules/

.amazonq/rules/

.md files in .kiro/steering/

.instructions.md files in .github/instructions/

.mdc files in .cursor/rules/

.md and .txt files in.roo/rules/

Usage rules

  • Files do not need to be included in the current changes: Even if a project convention file does not appear in the current diff, it can be discovered and used for review as long as it exists in the code version being reviewed.

  • Apply conventions by directory scope: Root-level conventions apply to the entire repository. Conventions in a module directory apply only to that directory and its subdirectories. If applicable conventions conflict, those from a more specific directory take precedence. Path matching rules and activation conditions within the files are also used to determine their scope.

  • Use the matching code version: The AI Assistant reads project convention files from the commit being reviewed. Newly added or modified files use their content from that commit. Deleted files are no longer used as active project conventions. In single-commit review mode, the project convention file version associated with each reviewed commit is used.

AI review memory

Review memory enables teams to reuse rules, technical constraints, and repository preferences across subsequent code reviews.

Memory type

Typical content

Problems solved

Repository rules

Fixed conventions that certain packages, modules, classes, or interfaces must follow

Prevents AI-powered code review from being unaware of repository norms, reducing false positives and missed issues

Business constraints

Compatibility with legacy systems, external system fields, canary release requirements, and other contextual factors

Enables review comments to reflect real business risks rather than surface-level code analysis

Team preferences

Long-standing implementation approaches, naming conventions, and exception handling strategies adopted by the team

Reduces repeated discussions about similar preferences across different merge requests

Risk experience

Historical issues triggered by specific changes that require additional verification

Helps AI-powered code review proactively flag similar scenarios in future reviews

Enable the feature

Administrators of a repository can enable or disable review memory for the current repository by navigating to Repository Settings > AI Assistant Settings > AI Review > Review Memory.

Memory

Administrators can enable memory functionality based on team needs.

  • Enable memory: The Alibaba Cloud DevOps AI Assistant generates memories from conversations with users. The AI Assistant references active memories during code reviews, and administrators can manage memories in the management backend.

  • Disable memory: No memories are generated or used, and memory management functionality is unavailable.

Approval

Administrators can enable memory approval functionality based on team needs.

  • Enable approval: Newly generated candidate memories require administrator confirmation before becoming active.

  • Disable approval: Newly generated candidate memories become active immediately.

Generate memories

In review comments, users can proactively inform the Alibaba Cloud DevOps AI Assistant about content they want remembered:

Please remember: When [situation] occurs, pay attention to [rule or requirement].

The Alibaba Cloud DevOps AI Assistant organizes natural language into a memory suitable for retention and displays the specific Add Memory content.

At this point, memories may have two states:

  • Active: Memories take effect in the next review.

  • Pending administrator approval: Requires administrator approval before taking effect in the next review.

Use memories

During reviews, the Alibaba Cloud DevOps AI Assistant automatically references all active memories and displays the specific Referenced Memory content.

Manage memories

Administrators of a repository can navigate to Repository Settings > AI Assistant Settings > AI Review > Review Memory to manage memory content.

Multiple operations are supported:

Memory state

Meaning

Common operations

Pending confirmation

Newly generated but not yet reviewed; does not participate in subsequent reviews

Edit, approve, reject

Active

Approved or automatically activated; available for subsequent reviews

Edit, disable

Disabled

Temporarily excluded from subsequent reviews

Edit, re-enable, delete

Rejected

The administrator determined that the content is unsuitable as a memory

Retained as a final state

Deleted

Removed from manageable memories

Processed as a final state

Memory content

To ensure memories are accurate and stable, prioritize long-term effective, clearly bounded, and reusable information.

A high-quality memory should ideally contain four elements:

Element

What it should specify

Scope

Which repository, module, directory, or code type the rule applies to

Specific rule

What must be done or what must not be done

Reason

Business context, compatibility requirements, or team agreements

Next steps

How prompts should appear when specific situations are encountered during subsequent reviews