Updated on 2026-05-19 GMT+08:00

Creating a Task

Create tasks to check code from multiple sources, such as CodeArts Repo, GitHub, and GitCode. CodeArts Check automatically detects potential errors, security vulnerabilities, performance problems, and inconsistent code styles to maintain code quality and project stability. This section explains how to create individual or bulk check tasks from various code sources.

Prerequisites

  • You have created a project.
  • You have created a code repository by referring to CodeArts Repo User Guide > "Creating a Repository" or you have created a third-party code repository.

Constraints

  • When the task to be deleted has a code repository with multiple branches, the deletion will be successful if there are fewer than 200 branches. Otherwise, the deletion will fail.

    Note: All data in the task will be deleted and cannot be recovered.

  • The network may be unstable or other problems may occur when a third-party repository is used.

Creating a Check Task for Code from CodeArts Repo

  • If you have selected Automatically create check task when creating a code repository in CodeArts Repo, the system automatically creates a code check task based on the language in the repository and enables the corresponding rule set by default. You can view the task in the code check task list of CodeArts Check.

    Notes:

    Custom rule set: You can adjust or customize the rule set after creating a task.

    Multi-language support: If a repository stores multiple languages, CodeArts Check will create a check task for each of them.

  • If you do not select Automatically create check task when creating a code repository, perform these steps to create a task:
  1. Access CodeArts Check.
  2. Click Create Task and configure parameters by referring to Table 1.

    Table 1 Task parameters

    Parameter

    Description

    Project

    Project that the task belongs to.

    • This parameter is set by default when you access CodeArts Check through the project page.
    • When you access CodeArts Check through the service portal, select the project created in Creating a Project.

    Creation Mode

    Select a template for creating a task. When creating a task, select Blank Template.

    Code Source

    Select the source of code.

    • Select Repo to check code hosted on CodeArts Repo in the current project.

      If the main code repository and its sub-modules are in the same language, sub-modules can be checked.

    Name

    Customize your task name.

    • Letters, digits, periods (.), underscores (_), and hyphens (-) allowed.
    • 3 to 128 characters.

    Repository

    Select the code repository to be checked.

    Default Branch

    Select the code branch to be checked.

    Language

    Select the code language to be checked. For details about the languages that can be checked, see Mainstream Programming Languages.

    If the source is a CodeArts Repo repository, the languages are automatically detected from the repository. You can remove languages but not add new ones.

  3. Click Confirm. You can view the task on the task list page of CodeArts Check.

    • To modify the task name, group, and default branch, go to the task details page, choose Settings > Basic Info, and then modify the target task.
    • To delete a task, go to the task details page, choose Settings > Basic Info, and then delete the target task. Alternatively, click in the row where the target task is located, and choose Delete from the drop-down list.

      When the task to be deleted has a code repository with multiple branches, the deletion will be successful if there are fewer than 200 branches. Otherwise, the deletion will fail.

      Note: All data in the task will be deleted and cannot be recovered.

    • Click on the right of the task and choose Copy from the drop-down list. On the displayed Settings page, set task information and execute the code check task.

Creating a Check Task from a Third-Party Code Repository

  • The network may be unstable or other problems may occur when a third-party repository is used.
  • It is advised to use the code import function of CodeArts Repo for secure, stable, and efficient download and build.
  1. Access CodeArts Check.
  2. Click Create Task and configure parameters by referring to Table 2.

    Table 2 Parameters

    Parameter

    Description

    Project

    Project that the task belongs to.

    • This parameter is set by default when you access CodeArts Check through the project page.
    • When you access CodeArts Check through the service portal, select the project created in Creating a Project.

    Creation Mode

    Select a template for creating a task. When creating a task, select Blank Template.

    Code Source

    Select the source of code.

    • Select Git. For code hosted on other services, use Git to pull the code.

    Name

    Customize your task name.

    Service Endpoint

    Select the service endpoint connected to the third-party repository. If no endpoint is available, create one by referring to Creating Service Endpoints.

    Repository

    Select the code repository to be checked.

    Default Branch

    Select the code branch to be checked.

    Language

    Select the code language to be checked. For details about the languages that can be checked, see Mainstream Programming Languages.

  3. Click Confirm. You can view the task on the task list page of CodeArts Check.

    • To modify the task name, group, and default branch, go to the task details page, choose Settings > Basic Info, and then modify the target task.
    • To delete a task, go to the task details page, choose Settings > Basic Info, and then delete the target task. Alternatively, click in the row where the target task is located, and choose Delete from the drop-down list.

      When the task to be deleted has a code repository with multiple branches, the deletion will be successful if there are fewer than 200 branches. Otherwise, the deletion will fail.

      Note: All data in the task will be deleted and cannot be recovered.

    • Click on the right of the task and choose Copy from the drop-down list. On the displayed Settings page, set task information and execute the code check task.

Creating Tasks in Batches

Batch creation works only for tasks created from custom templates, with up to 10 tasks per batch.

  1. Access CodeArts Check.
  2. Click Create Task and configure parameters by referring to Table 3.

    Table 3 Batch task parameters

    Parameter

    Description

    Project

    Project that the template to be used belongs to.

    • This parameter is set by default when you access CodeArts Check through the project page.
    • When you access CodeArts Check through the service portal, select the project created in Creating a Project.

    Creation Mode

    Select Project Template or Tenant Template.

    • Project Template: Use the custom template of the current project.
    • Tenant Template: Use the custom task template of the current tenant.

    The differences between tenant templates and project templates are as follows:

    • Notifications: Tasks created from tenant templates do not inherit the recipient roles or custom members configured in the template.
    • Check scope: Tasks created from tenant templates do not inherit the ignore files configured in the template.
    • Custom environment: Tasks created from tenant templates do not inherit the private dependency repositories configured in the template.
    • Template information cannot be modified.

    Template

    Select a custom template. If no template is available, create one by referring to Creating a Custom Template.

    Code Source

    Select the source of code.

    • Select Repo to check code hosted on CodeArts Repo.
    • Select Git. For code hosted on other services, use Git to pull the code.

    Task Info

    • Project: Select the project that the task belongs to.
    • Service Endpoint: This parameter is mandatory when CodeArts Repo is not the code source. If no endpoint is available, create one by referring to Creating Service Endpoints.
    • Repository: Select the code repository used by the task.
    • Default Branch: Select the repository branch to be checked.
    • Name: Specify the name of the task. The value can contain 3 to 128 characters, including letters, digits, periods (.), underscores (_), and hyphens (-).

    Click Add to add up to 10 tasks at once.

  3. Click Confirm.

    You can view the new tasks in the task list of the corresponding project.

Creating a Custom Template

  1. Access CodeArts Check.
  2. On the task list page, choose Config Center > Template Settings.
  3. Click Create Template. In the displayed dialog box, set parameters by referring to the following table.

    Table 4 Template parameters

    Parameter

    Description

    Project

    Project that the task belongs to.

    • This parameter is set by default when you access CodeArts Check through the project page.
    • When you access CodeArts Check through the service portal, select the project created in Creating a Project.

    Code Source

    • Select Git. For code hosted on other services, use Git to pull the code.
    • Select Repo to check code hosted on CodeArts Repo.

    Name

    Customize your task name.

    • Letters, digits, periods (.), underscores (_), and hyphens (-) allowed.
    • 3 to 128 characters.

    Service Endpoint

    Select the service endpoint connected to the third-party repository. If no endpoint is available, create one by referring to Creating Service Endpoints.

    Repository

    Select the code repository to be checked.

    Default Branch

    Select the code branch to be checked.

  4. Click OK.

    You can view the template in the task template list and select the template when creating tasks based on the tenant template or project template.

Managing Tasks

CodeArts Check allows you to manage code check tasks in batches. Except for exporting task issues, other batch operations must be performed within a single project.

  1. On the task list page, select the check tasks you want to manage.
  2. In the displayed dialog box, move the selected tasks to another group, modify the task configurations, delete the tasks, and export task issues.

    • Configurations you can modify rule sets, quality gates, scheduled execution, MR check modes, directories, custom images, private repository endpoints, pre-check commands, start time of new issues, source file encoding, accurate matching of issue owners, and notifications.
    • A maximum of 50 code check tasks can be moved to a group, exported, modified, or deleted at a time.

      Exporting a task:

      1. Click the Issues tab.
      2. Choose Apply to Filtered > Export to export issues to the local PC.

      Exporting tasks in batches:

      Note: Do not export a task that is being exported. Otherwise, the export may fail.

      1. On the task list page, select the tasks you want to export (max. 50 tasks at a time). Max. 200,000 issues in a single task can be exported.
      2. In the window displayed in the lower part of the page, click Export Task Issues.
      3. In the displayed window, select the items to be exported from the drop-down list and click Export.
      4. Click View Downloads to view the export progress.
      5. After the export is complete, click Download to export the issues to the local PC.
        Figure 1 Managing tasks in batches

        By default, the check engine is not displayed in the exported task issues. If you need to view the check engine, enable the engine display by referring to Displaying the Check Engine and export the task issues again.

Related Documents