All Products
Search
Document Center

DataWorks:Code review

Last Updated:Mar 26, 2026

Code Review adds a human approval gate between code changes and production deployment in Data Studio. Without it, non-compliant code can reach production and fail at runtime — triggering downstream task failures and wasting compute resources. When Mandatory Code Review is enabled, a task cannot be published to the Production Environment until a designated reviewer approves the change.

How it works

Submitting a node for publishing triggers a code review. The initiator selects one or more reviewers; the system sends notifications and blocks publishing until a reviewer acts.

image

The review outcome depends on whether Mandatory Code Review is enabled:

ModeReview outcomeEffect on publishing
Mandatory Code Review disabledApproved or rejectedPublishing is not blocked — the node can be published regardless of outcome
Mandatory Code Review enabledApprovedPublishing proceeds
Mandatory Code Review enabledRejectedPublishing is blocked; the initiator must revise the code and resubmit

Prerequisites

Before you begin, make sure you have:

  • Activated DataWorks Professional Edition or higher. See DataWorks editions for edition details.

  • One of the following roles to enable or disable Code Review for a workspace:

    • Alibaba Cloud account

    • Workspace Administrator

    • RAM user with the AliyunDataWorksFullAccess permission

For more information on roles, see Overview of users, roles, and permissions.

Limitations

Code Review is not supported for:

  • Composite nodes: Loop and Traverse

  • Non-Python resource files

Enable Mandatory Code Review

A Workspace Administrator can enable Mandatory Code Review from the Data Studio settings page. When enabled, all nodes within the configured scope must pass a review before they can be published.

Note

Deleting a node does not trigger Code Review.

Step 1: Open security settings

  1. Go to the Workspaces page in the DataWorks console. In the top navigation bar, select the target region. Locate the workspace and choose Shortcuts > Data Studio in the Actions column.

  2. In the lower-left corner of the Data Studio page, click the image icon and select Data Studio Settings.

  3. On the Data Studio settings page, click the Security Settings and Others tab.

Important

If the Force to review code switch is not visible on the Security Settings and Others tab, verify that your workspace is on DataWorks Professional Edition or higher. Code Review is unavailable in lower editions.

Step 2: Configure code review settings

On the Security Settings and Others tab, enable Code Review > Force to review code and configure the following parameters.

ParameterDescription
Force to review codeRequires a code review before tasks in the workspace can be published to the Production Environment.
Code reviewersSpecifies which users can act as reviewers. Any Developer Role: the initiator selects any user with a developer role in the workspace when submitting. Specify development role users: after a code review is submitted for a node, it must be approved by a user with a specified developer role before it can be published. If multiple reviewers are configured, approval from any one reviewer is sufficient.
Baseline scopes for code reviewDetermines which nodes require a review. Configure by baseline priority: non-baseline tasks, or nodes on baselines of that level in the current workspace require approval upon submission. The higher the baseline number, the higher its priority. Selecting non-baseline tasks means all new nodes in the workspace require approval.
Code review notification methodsSends automated alerts to reviewers when a new review is assigned, and to initiators when the review status changes (approved or rejected). Supported channels: SMS, DingTalk group robot webhook, email, WeCom group webhook, Lark webhook, and generic webhook.
Note
  • Only users with a developer role in the current workspace can be selected as reviewers.

  • The generic webhook method is available only in DataWorks Enterprise Edition.

  • For DingTalk group robot security settings, configure keywords only. Keywords must include DataWorks.

  • SMS and phone alerts from Code Review count toward your alert resource usage. View usage on the Alert Resources page. See View and set alert resources.

Submit a node for code review

When you publish a node with Mandatory Code Review enabled, publishing is blocked until the review is approved. The submission process assigns a reviewer and creates a review request.

Auto-cancellation of in-progress reviews: If a node already has a review in progress, submitting a new one automatically cancels the previous review. Only the latest review applies.

Note

Deleting a node does not trigger Code Review.

  1. Save the node and navigate to the Publish page. Click the image icon to save the node, then click the image icon to open the Publish page.

  2. Start deployment. Click Start Deployment to Production Environment. Because Mandatory Code Review is enabled, publishing is blocked pending review approval.

  3. Submit for code review. Click Submit for Code Review. On the Code Review configuration panel, set the following fields and click Confirm.

    ParameterDescription
    Code ReviewerSelect one or more reviewers from the list of configured Code reviewers.
    Change DescriptionDescribe the code changes being submitted.

Process a review request

Reviewers can view and act on pending requests from the Code Review List > Reviewed by Me tab.

  1. Open the Code Review list. In the left-side navigation pane of the Data Studio page, click the image icon to open the Code Review List page. Requests assigned to you appear under Reviewed by Me.

  2. Act on the review request. From the Code Review list page, take quick action on a request: Approve, Reject, Discard, Reopen, or Share. From the Code Review details page, review code and scheduling configuration changes against the production version before deciding:

    1. On the Code Review List page, click a request to open the Code Review details page.

    2. Compare the code and scheduling configuration changes against the production version.

    3. In the Review Operations section, perform one of the following actions:

      • image Approve — unblocks publishing.

      • image Reject — blocks publishing; the initiator must revise and resubmit.

      • image Discard — cancels the review. Publishing remains blocked until the initiator submits a new review or reopens this one.

      • image Reopen — restarts a discarded review.

      • Comment — add feedback without changing the review status.

View review results

Initiators can check review outcomes and manage requests from the Code Review List > Created by Me tab.

  1. Open the Code Review list. In the left-side navigation pane, click the image icon to go to the Code Review List page, then switch to Created by Me.

  2. Manage the review request. From the Code Review list page, view the review status and perform actions: Discard, Reopen, or Share. From the Code Review details page, click a request to open the details page. From there, choose Reopen or Discard.

    Note

    If you discard the review, submit a new request or reopen the discarded one to continue the publishing process.

  3. If a review is rejected, revise the code based on the reviewer's feedback and resubmit it for review. Publishing is unblocked only after the review is approved.

What's next

After the review is approved, return to the Publish page and complete the deployment. If the review is rejected, update the code based on the reviewer's comments and submit a new review request.