Skip to content

Commit ba22f33

Browse files
authored
Merge branch 'dev' into Fix-17817-2
2 parents 1394620 + 7c12329 commit ba22f33

62 files changed

Lines changed: 160 additions & 2905 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ jobs:
136136
runs-on: ubuntu-latest
137137
timeout-minutes: 20
138138
strategy:
139-
fail-fast: false
140139
matrix:
141140
version: ["3.1.9", "3.2.0", "3.3.1"]
142141
case:

.github/workflows/unit-test.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ jobs:
4949
not-ignore:
5050
- '!(docs/**)'
5151
52+
sanity-check:
53+
name: Sanity Check
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v6
57+
with:
58+
submodules: true
59+
- name: Sanity Check
60+
uses: ./.github/actions/sanity-check
61+
with:
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
5264
generate-matrix:
5365
name: Generate Module Matrix
5466
runs-on: ubuntu-latest
@@ -84,11 +96,10 @@ jobs:
8496
8597
unit-test:
8698
name: Unit-Test (${{ matrix.module }} | Java ${{ matrix.java }})
87-
needs: [ paths-filter, generate-matrix ]
99+
needs: [ paths-filter, generate-matrix, sanity-check ]
88100
if: ${{ (needs.paths-filter.outputs.not-ignore == 'true') || (github.event_name == 'push') }}
89101
runs-on: ubuntu-latest
90102
strategy:
91-
fail-fast: false
92103
matrix:
93104
java: [ '8', '11' ]
94105
module: ${{ fromJSON(needs.generate-matrix.outputs.matrix).module }}
@@ -101,11 +112,6 @@ jobs:
101112
- name: Collect Workflow Metrics
102113
uses: ./.github/actions/actions-workflow-metrics
103114

104-
- name: Sanity Check
105-
uses: ./.github/actions/sanity-check
106-
with:
107-
token: ${{ secrets.GITHUB_TOKEN }}
108-
109115
- name: Set up JDK ${{ matrix.java }}
110116
uses: actions/setup-java@v5
111117
with:
@@ -264,7 +270,7 @@ jobs:
264270
name: Unit Test
265271
runs-on: ubuntu-latest
266272
timeout-minutes: 5
267-
needs: [ unit-test, paths-filter, sonar ]
273+
needs: [ unit-test, paths-filter, sonar, sanity-check ]
268274
if: always()
269275
steps:
270276
- name: Status
@@ -273,6 +279,10 @@ jobs:
273279
echo "Skip Unit Test!"
274280
exit 0
275281
fi
282+
if [[ ${{ needs.sanity-check.result }} != 'success' ]]; then
283+
echo "Sanity Check Failed!"
284+
exit -1
285+
fi
276286
if [[ ${{ needs.unit-test.result }} != 'success' ]]; then
277287
echo "Unit Test Failed!"
278288
exit -1

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-aliyunVoice/src/main/java/org/apache/dolphinscheduler/plugin/alert/voice/VoiceAlertConstants.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ public class VoiceAlertConstants {
4343
* tts Code
4444
*/
4545
static final String TTS_CODE = "$t('ttsCode')";
46-
/**
47-
* tts Param
48-
*/
49-
static final String TTS_PARAM = "ttsParam";
50-
5146
/**
5247
* address
5348
*/

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-api/src/main/java/org/apache/dolphinscheduler/alert/api/AlertInputTips.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public enum AlertInputTips {
3131
URL("input request URL", "请输入请求的URL"),
3232
HEADER("input request headers as JSON format", "请输入JSON格式的请求头"),
3333
JSON_BODY("input request body as JSON format", "请输入JSON格式的请求体"),
34-
FIELD_NAME("input alert msg field name", "请输入告警信息的内容字段名称"),
35-
HTTP_METHOD("input request type POST or GET", "请输入HTTP请求类型POST或GET"),
3634
CUSTOMIZED_PARAMS("the custom parameters passed when calling scripts", "请输入调用脚本时传入的自定义参数"),
3735
SCRIPT_PATH("the absolute script path under alert-server, and make sure access rights",
3836
"请输入alert-server机器的脚本的绝对路径,并确保文件有权接入"),

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public final class MailParamsConstants {
2525
public static final String PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "$t('receiverCcs')";
2626
public static final String NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "receiverCcs";
2727

28-
public static final String NAME_MAIL_PROTOCOL = "mail.protocol";
29-
3028
public static final String MAIL_SMTP_HOST = "mail.smtp.host";
3129
public static final String NAME_MAIL_SMTP_HOST = "serverHost";
3230

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class MailUtilsTest {
4444

4545
@BeforeAll
4646
public static void initEmailConfig() {
47-
emailConfig.put(MailParamsConstants.NAME_MAIL_PROTOCOL, "smtp");
47+
emailConfig.put("mail.protocol", "smtp");
4848
emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_HOST, "xxx.xxx.com");
4949
emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_PORT, "25");
5050
emailConfig.put(MailParamsConstants.NAME_MAIL_SENDER, "xxx1.xxx.com");

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertConstants.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ public final class HttpAlertConstants {
3838

3939
public static final String NAME_BODY_PARAMS = "bodyParams";
4040

41-
public static final String CONTENT_FIELD = "$t('contentField')";
42-
43-
public static final String NAME_CONTENT_FIELD = "contentField";
44-
4541
public static final String REQUEST_TYPE = "$t('requestType')";
4642

4743
public static final String NAME_REQUEST_TYPE = "requestType";

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertConstants.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ public final class WeChatAlertConstants {
3333

3434
static final String WE_CHAT_CONTENT_KEY = "content";
3535

36-
static final String WE_CHAT_MESSAGE_TYPE_TEXT = "text";
37-
3836
static final Integer WE_CHAT_MESSAGE_SAFE_PUBLICITY = 0;
3937

40-
static final Integer WE_CHAT_MESSAGE_SAFE_PRIVACY = 1;
41-
4238
static final Integer WE_CHAT_ENABLE_ID_TRANS = 0;
4339

4440
static final Integer WE_CHAT_DUPLICATE_CHECK_INTERVAL_ZERO = 0;

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public Result<Boolean> connectDataSource(@Parameter(hidden = true) @RequestAttri
225225
*
226226
* @param loginUser login user
227227
* @param id data source id
228-
* @return connect result code
228+
* @return A Result wrapping {@code true} if the connection is successful; otherwise, throws an exception.
229229
*/
230230
@Operation(summary = "connectionTest", description = "CONNECT_DATA_SOURCE_TEST_NOTES")
231231
@Parameters({
@@ -236,7 +236,7 @@ public Result<Boolean> connectDataSource(@Parameter(hidden = true) @RequestAttri
236236
@ApiException(CONNECTION_TEST_FAILURE)
237237
public Result<Boolean> connectionTest(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
238238
@PathVariable("id") int id) {
239-
dataSourceService.connectionTest(id);
239+
dataSourceService.connectionTest(loginUser, id);
240240
return Result.success(true);
241241
}
242242

@@ -337,6 +337,14 @@ public Result<Object> getKerberosStartupState(@Parameter(hidden = true) @Request
337337
return success(Status.SUCCESS.getMsg(), CommonUtils.getKerberosStartupState());
338338
}
339339

340+
/**
341+
* Retrieves the list of tables within a specific database of a data source.
342+
*
343+
* @param loginUser the current logged-in user (injected from session)
344+
* @param datasourceId the unique identifier of the data source
345+
* @param database the name of the database to query
346+
* @return a list of table names/options accessible to the user
347+
*/
340348
@Operation(summary = "tables", description = "GET_DATASOURCE_TABLES_NOTES")
341349
@Parameters({
342350
@Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1")),
@@ -345,37 +353,56 @@ public Result<Object> getKerberosStartupState(@Parameter(hidden = true) @Request
345353
@GetMapping(value = "/tables")
346354
@ResponseStatus(HttpStatus.OK)
347355
@ApiException(GET_DATASOURCE_TABLES_ERROR)
348-
public Result<Object> getTables(@RequestParam("datasourceId") Integer datasourceId,
349-
@RequestParam(value = "database") String database) {
350-
List<ParamsOptions> options = dataSourceService.getTables(datasourceId, database);
356+
public Result<Object> getTables(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
357+
@RequestParam("datasourceId") Integer datasourceId,
358+
@RequestParam("database") String database) {
359+
List<ParamsOptions> options = dataSourceService.getTables(loginUser, datasourceId, database);
351360
return Result.success(options);
352361
}
353362

363+
/**
364+
* Retrieves the column details (schema) for a specific table.
365+
*
366+
* @param loginUser the current logged-in user (injected from session)
367+
* @param datasourceId the unique identifier of the data source
368+
* @param database the name of the database containing the table
369+
* @param tableName the name of the table to query columns for
370+
* @return a list of column definitions (name, type, etc.) for the specified table
371+
*/
354372
@Operation(summary = "tableColumns", description = "GET_DATASOURCE_TABLE_COLUMNS_NOTES")
355373
@Parameters({
356374
@Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1")),
357-
@Parameter(name = "tableName", description = "TABLE_NAME", required = true, schema = @Schema(implementation = String.class, example = "test")),
358-
@Parameter(name = "database", description = "DATABASE", required = true, schema = @Schema(implementation = String.class, example = "test"))
375+
@Parameter(name = "database", description = "DATABASE", required = true, schema = @Schema(implementation = String.class, example = "test")),
376+
@Parameter(name = "tableName", description = "TABLE_NAME", required = true, schema = @Schema(implementation = String.class, example = "test"))
359377
})
360378
@GetMapping(value = "/tableColumns")
361379
@ResponseStatus(HttpStatus.OK)
362380
@ApiException(GET_DATASOURCE_TABLE_COLUMNS_ERROR)
363-
public Result<Object> getTableColumns(@RequestParam("datasourceId") Integer datasourceId,
364-
@RequestParam("tableName") String tableName,
365-
@RequestParam(value = "database") String database) {
366-
List<ParamsOptions> options = dataSourceService.getTableColumns(datasourceId, database, tableName);
381+
public Result<Object> getTableColumns(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
382+
@RequestParam("datasourceId") Integer datasourceId,
383+
@RequestParam("database") String database,
384+
@RequestParam("tableName") String tableName) {
385+
List<ParamsOptions> options = dataSourceService.getTableColumns(loginUser, datasourceId, database, tableName);
367386
return Result.success(options);
368387
}
369388

389+
/**
390+
* Retrieves the list of databases available in a specific data source.
391+
*
392+
* @param loginUser the current logged-in user (injected from session)
393+
* @param datasourceId the unique identifier of the data source
394+
* @return a list of database names/options accessible to the user
395+
*/
370396
@Operation(summary = "databases", description = "GET_DATASOURCE_DATABASE_NOTES")
371397
@Parameters({
372398
@Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1"))
373399
})
374400
@GetMapping(value = "/databases")
375401
@ResponseStatus(HttpStatus.OK)
376402
@ApiException(GET_DATASOURCE_DATABASES_ERROR)
377-
public Result<Object> getDatabases(@RequestParam("datasourceId") Integer datasourceId) {
378-
List<ParamsOptions> options = dataSourceService.getDatabases(datasourceId);
403+
public Result<Object> getDatabases(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
404+
@RequestParam("datasourceId") Integer datasourceId) {
405+
List<ParamsOptions> options = dataSourceService.getDatabases(loginUser, datasourceId);
379406
return Result.success(options);
380407
}
381408
}

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/DefineUserDto.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)