Code review ensures production code meets quality standards before deployment. Enable mandatory review to require approval before publishing tasks to production.
Function introduction
Enable mandatory code review to prevent task failures from non-compliant code and avoid wasting computing resources. When enabled, reviewers validate code quality before it reaches production.
If mandatory code review is disabled: You can manually initiate reviews when submitting nodes. Nodes can be published regardless of review status.
If mandatory code review is enabled: When you submit a node, you must select a qualified reviewer to perform code review and ensure code quality.
If approved, you can publish the node.
If rejected, you must revise the code based on feedback and resubmit for review. You can only publish after approval.
Limitations
Requires DataWorks Professional Edition or higher. For more information, see DataWorks editions.
Only Alibaba Cloud accounts, Workspace Administrators, and RAM users with
AliyunDataWorksFullAccesscan enable or disable code review. For more information, see Users, roles, and permissions.Code review is not supported for special node types (loop, traverse) or non-Python resource files.
(Optional) Administrator: Enable mandatory code review
A workspace administrator can enable mandatory code review for a workspace on the Data Studio settings page.
When disabled, reviews can still be initiated but won't block publishing.
Code review is not triggered when deleting nodes.
Go to the Security Settings and Others page
Go to the Workspaces page in the DataWorks console. In the top navigation bar, select a desired region. Find the desired workspace and choose in the Actions column.
Go to the Data Studio settings page.
Click the
icon in the lower-left corner and select Data Studio Settings.On the DataStudio settings page, click the Security Settings and Others tab.
Enable code review
On the Security Settings and Others tab, enable Force to review code.
Code review features are only available in DataWorks Professional Edition and above.
Parameter | Description |
Force to review code | Requires code review before publishing tasks to production. |
Code reviewers | Specifies the users who can review the code in the workspace.
Note
|
Baseline scopes for code review | Specify which nodes require review when submitted. You can specify which nodes require mandatory code review based on the priority of the baseline to which they belong. The logic is as follows:
Note Selecting non-baseline tasks means that all new nodes created in the workspace require approval. |
DingTalk group robot webhook | Enter a custom DingTalk chatbot webhook URL to receive review status notifications. For more information, see Configure a custom chatbot. Note For the security settings of the DingTalk group chatbot, you must configure keywords, and the keywords must include |
@everyone for code review? | When enabled, |
Review initiator: Initiate a code review
Submitting a node triggers code review. Select a reviewer to generate the review request. When mandatory review is enabled, publishing is blocked until approval.
Initiating a new review automatically invalidates any in-progress review.
Deleting nodes does not trigger code review.
Publish the task.
Click the
icon to save the node, and click the
icon to open the publishing page.Click Start Deployment to Production Environment. With mandatory review enabled, publishing is blocked until approval.
Submit for review.
Click Submit for Code Review. Select a reviewer and describe your changes.
Configuration Item
Description
Code Reviewer
Select one or more reviewers from the configured list.
Change Description
Describe your changes.
Click Confirm to submit.
Reviewer: Process a review request
Reviewers can view and process requests under .
Go to the code review page.
In the left navigation pane of Data Studio, click the
icon to access your review queue under .Review and take action.
View request details and available actions.
In the code review list page: Quickly Approve, Reject, Discard, Reopen, or Share requests.
In the code review detail page:
Compare code and schedule changes against production to decide on approval.
Available actions:
: Approve.
: Reject.
: Discard.
: Reopen.Comment.
Discard: Cancels the review and allows immediate publishing.
Reopen: Restarts a discarded review.
After completion, initiators can view results and manage requests.
Review initiator: View results
View your review results under .
Go to the code review page.
In the left navigation pane of Data Studio, click the
icon to access your review queue under .Check review status.
View details and take action as needed.
In the code review list page: View results and Discard, Reopen, or Share requests.
NoteAfter discarding, resubmit for review or reopen the request to continue publishing.
In the code review detail page: Click a request to open details and decide whether to reopen or discard.
If rejected, revise your code based on feedback and resubmit. You can only publish after approval.
More operations
After approval, publish your task to production. If rejected, revise based on feedback and resubmit.