Build AI-Powered Code Review with Alibaba Cloud Flow and DeepSeek
This guide walks you through creating a custom Cloud Native Flow step that calls DeepSeek to automatically review code in Alibaba Cloud Codeup, covering token creation, API key setup, step publishing, pipeline configuration, and viewing AI‑generated review comments.
Overview
This guide shows how to integrate the DeepSeek large‑language model into Alibaba Cloud DevOps (Cloud Native) to provide AI‑driven code review for Codeup repositories. The solution combines Cloud Native Flow, Codeup, and the Baileian model service API.
Prerequisites
Alibaba Cloud DevOps organization with Cloud Native Flow and Codeup enabled.
Node.js installed locally.
Latest Flow‑CLI (
npm install -g @flow-step/flow-cli --registry=https://registry.npmmirror.com).
Baileian APIKey from the Alibaba Cloud Model Service.
Step 1 – Create Cloud Native organization and access token
If you do not yet have an organization, create one at devops.aliyun.com. Then generate a personal access token with read‑only code comparison and read‑write merge‑request permissions (Settings → Personal Settings → New Token).
Step 2 – Create Baileian APIKey
Log in to the Alibaba Cloud Model Service (Baileian) and create an APIKey. New users receive free token credits.
Step 3 – Create a custom Flow step that calls the LLM
Install the latest Flow‑CLI:
npm install -g @flow-step/flow-cli --registry=https://registry.npmmirror.comLog in to Flow‑CLI with the organization created earlier: flow-cli login Clone the example step repository, edit step.yaml (lines 4‑5) to append your organization ID to the step id and name, then publish the step: flow-cli step publish --auto-version After publishing, the step appears in Flow’s step management under “Organization Steps”.
Step 4 – Prepare a sample code repository
Import the sample repository https://atomgit.com/flow-example/CodeReviewSampleCode.git into Codeup.
Step 5 – Create a pipeline
In flow.aliyun.com, create a new pipeline using the “Nodejs Test & Build” template. Select the imported sample repository as the code source, enable trigger on merge‑request creation or update, and remove the default Nodejs build task (add an empty task instead).
Insert the custom step created in Step 3 into the empty task. Choose a model (e.g., deepseek-r1, deepseek-v3, qwen-max) and provide the Cloud Native token and Baileian APIKey via two private environment variables:
${YUNXIAO_TOKEN} ${BAILIAN_APIKEY}The step will call the LLM to review the diff of each merge request.
Step 6 – Create a merge request
In the sample repository, create a merge request from the dev1 branch to main. The pipeline is triggered, running unit tests, code scans, and the AI review step.
Step 7 – View AI review results
After the pipeline finishes, open the custom step logs to see the LLM’s analysis of the code diff. The review comments are written back to the Codeup merge request and appear alongside other automated checks.
References
Cloud Native API documentation: https://help.aliyun.com/zh/yunxiao/developer-reference/api-reference-standard-proprietary/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
