Pull Request Notice

Preface

Pull Request is a way of software cooperation, which is a process of bringing code involving different functions into the trunk. During this process, the code can be discussed, reviewed, and modified.

In Pull Request, we try not to discuss the implementation of the code. The general implementation of the code and its logic should be determined in Issue. In the Pull Request, we only focus on the code format and code specification, so as to avoid wasting time caused by different opinions on implementation.

Specification

Pull Request title

Title Format: [Pull Request Type-Issue No][Module Name] Pull Request Description

The corresponding relationship between Pull Request Type and Issue Type is as follows:

Issue Type Pull Request Type Example(Suppose Issue No is 3333)
Feature Feature [Feature-3333][server] Implement xxx
Bug Fix [Fix-3333][server] Fix xxx
Improvement Improvement [Improvement-3333][alert] Improve the performance of xxx
Test Test [Test-3333][api] Add the e2e test of xxx
Sub-Task (Parent type corresponding to Sub-Task) [Feature-3333][server] Implement xxx

Issue No refers to the Issue number corresponding to the current Pull Request to be resolved, Module Name is the same as the Module Name of Issue.

Pull Request content

Please refer to the commit message section.

Pull Request Code Style

Code style is the thing you have to consider when you submit pull request for DolphinScheduler. We using Checkstyle, a development tool to help programmers write Java code that adheres to a coding standard, in CI to keep DolphinScheduler codebase in the same style. Your pull request could not be merged if your code style checker failed. You could format your code by Checkstyle in your local environment before you submit your pull request to check code style. The activation step as below:

  1. Prepare Checkstyle configuration file: You could download it manually by click here, but find it in DolphinScheduler repository would be a better way. You could find configuration file in the path style/checkstyle.xml after you clone repository from Github.

  2. Download Checkstyle plugins in Intellij IDEA: Search plugin by keyword CheckStyle-IDEA or install in this page. You could see install plugin if you do not know how to install plugin in Intellij IDEA

  3. Configure and activate Checkstyle and Intellij IDEA code-style: After completing the above steps, you could configure and activate it in your environment. You could find Checkstyle plugins in the path Preferences -> Tool -> Checkstyle. After that you could activate Checkstyles as screenshot show

checkstyle idea configuration

For now your Checkstyle plugins are setup, it would show codes and files which out of style. We highly recommend you configure Intellij IDEA code-style for auto-formatting your code in Intellij IDEA, you could find this setting in Preferences -> Editor -> Code Style -> Java and then activate it as screenshot show

code style idea configuration

  1. Format your codebase in Intellij IDEA before submit your pull request: After you done above steps, you could using Intellij IDEA shortcut Command + L(for Mac) or Ctrl+L(for Windows) to format your code. The best time to format your code is before you commit your change to your local git repository.

Question

  • How to deal with one Pull Request to many Issues scenario.

    First of all, there are fewer scenarios for one Pull Request to many Issues. The root cause is that multiple issues need to do the same thing. Usually, there are two solutions to this scenario: the first is to merge multiple issues with into the same issue, and then close the other issues; the second is multiple issues have subtle differences. In this scenario, the responsibilities of each issue can be clearly divided. The type of each issue is marked as Sub-Task, and then these sub task type issues are associated with one issue. And each Pull Request is submitted should be associated with only one issue of a sub task.