Updated on 2024-10-10 GMT+08:00

Creating a Task

CodeArts Check supports different code repositories. Before task creation, you should:

  • Create a project.
  • (Optional) Create a code repository by referring to CodeArts Repo User Guide > "Creating a Repo".
  • (Optional) Create a third-party code repository.

Creating a Task to Check Code from CodeArts Repo

If you select Automatically create Check task when creating a code repository in CodeArts Repo, a code check task will be created synchronously. You can view the task in the task list of CodeArts Check.

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 through a project.
  2. Click Create Task, configure parameters by referring to Table 1, and click Create Task.

    Table 1 Task parameters

    Parameter

    Description

    Mandatory

    Project

    Project that the task belongs to.

    • This parameter is set by default when you access CodeArts Check from the project entry.
    • During access through the service entry, select the project created in Creating a Project based on the site requirements.

    Yes

    Code Source

    Select Repo.

    Yes

    Name

    Customize your task name.

    Enter 1 to 128 characters: letters, digits, underscores (_), hyphens (-), and periods (.).

    Yes

    Repository

    Select the code repository to be checked.

    Yes

    Branch

    Select the code branch to be checked.

    Yes

    Language

    Select the code language to be checked.

    No

    • To modify the task name 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.

Creating a Task to Check Code from Git

  1. Access CodeArts Check through a project.
  2. Click Create Task, configure parameters by referring to Table 2, and click Create Task.

    Table 2 Task parameters

    Parameter

    Description

    Mandatory

    Project

    Project that the task belongs to.

    • This parameter is set by default when you access CodeArts Check from the project entry.
    • During access through the service entry, select the project created in Creating a Project based on the site requirements.

    Yes

    Code Source

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

    Yes

    Name

    Customize your task name.

    Enter 1 to 128 characters: letters, digits, underscores (_), hyphens (-), and periods (.).

    Yes

    Endpoint

    Select the service endpoint connected to the Git repository. If no, create one.

    Yes

    Repository

    Select the code repository to be checked.

    Yes

    Branch

    Select the code branch to be checked.

    Yes

    Language

    Select the code language to be checked.

    No

    • To modify the task name 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.

Creating a Service Endpoint

When you select any third-party repository, the Endpoint is a mandatory setting.

A service endpoint is an extension to CodeArts and supports connection to third-party services.

By default, CodeArts Check pulls code from CodeArts Repo for your build. CodeArts Build also uses service endpoints to connect to third-party repositories to obtain project source code.

  • The network may be unstable or other problems may occur when a third-party repository is used.
  • Use the code import function of CodeArts Repo for secure, stable, and efficient download and build.

Creating a Git service endpoint

  1. Click and click Create Endpoint in the drop-down list.
  2. On the displayed page, click Create Endpoint and select Git repository.
  3. In the displayed dialog box, set parameters by referring to Table 3.
    Table 3 Git service endpoint parameters

    Parameter

    Description

    Mandatory

    Service Endpoint Name

    Enter a maximum of 256 characters, including letters, digits, hyphens (-), underscores (_), periods (.), and spaces.

    Yes

    Git Repository URL

    Enter the URL of the Git repository (HTTPS address).

    Yes

    Username

    Enter the username of the Git repository.

    No

    Password or Access Token

    Enter the password used for logging in to the Git repository.

    No

  4. Click Confirm. The page for creating a task is displayed.