这是能够编译的,修改了很多内容,业务模型使用的bk的,目前的状态是经供参考
This commit is contained in:
parent
76ce3d1e2e
commit
800c441aa5
259
.idea/CopilotChatHistory.xml
generated
259
.idea/CopilotChatHistory.xml
generated
File diff suppressed because one or more lines are too long
72
.idea/compiler.xml
generated
72
.idea/compiler.xml
generated
@ -3,6 +3,11 @@
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for ops-pro" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
@ -13,72 +18,81 @@
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
</processorPath>
|
||||
<module name="ci-scm-repository" />
|
||||
<module name="pipeline-ci-process-api" />
|
||||
<module name="spring-boot-starter-protection" />
|
||||
<module name="module-ci-environment" />
|
||||
<module name="spring-boot-starter-monitor" />
|
||||
<module name="module-system-biz" />
|
||||
<module name="ci-quality" />
|
||||
<module name="common-pipeline" />
|
||||
<module name="module-system-api" />
|
||||
<module name="spring-boot-starter-mq" />
|
||||
<module name="module-ci-quality" />
|
||||
<module name="spring-boot-starter-mongo" />
|
||||
<module name="module-ci-market" />
|
||||
<module name="commons" />
|
||||
<module name="ci-log" />
|
||||
<module name="module-ci-common-pipeline" />
|
||||
<module name="spring-boot-starter-plugin" />
|
||||
<module name="ci-market" />
|
||||
<module name="ops-server" />
|
||||
<module name="spring-boot-starter-biz-data-permission" />
|
||||
<module name="spring-boot-starter-mybatis" />
|
||||
<module name="ci-event" />
|
||||
<module name="ci-ticket" />
|
||||
<module name="module-ci-process-api" />
|
||||
<module name="module-ci-project" />
|
||||
<module name="module-infra-api" />
|
||||
<module name="module-ci-worker" />
|
||||
<module name="spring-boot-starter-test" />
|
||||
<module name="spring-boot-starter-websocket" />
|
||||
<module name="system-plugin-example-web" />
|
||||
<module name="ci-worker" />
|
||||
<module name="spring-boot-starter-biz-ip" />
|
||||
<module name="module-infra-biz" />
|
||||
<module name="module-ci-log" />
|
||||
<module name="spring-boot-starter-job" />
|
||||
<module name="ci-project" />
|
||||
<module name="common-api" />
|
||||
<module name="ci-environment" />
|
||||
<module name="module-ci-event" />
|
||||
<module name="module-ci-repository" />
|
||||
<module name="spring-boot-starter-web" />
|
||||
<module name="module-ci-common" />
|
||||
<module name="spring-boot-starter-excel" />
|
||||
<module name="spring-boot-starter-biz-tenant" />
|
||||
<module name="module-ci-ticket" />
|
||||
<module name="spring-boot-starter-redis" />
|
||||
<module name="spring-boot-starter-security" />
|
||||
</profile>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="ci-common" target="17" />
|
||||
<module name="ci-common-pipeline" target="17" />
|
||||
<module name="ci-common-public" target="17" />
|
||||
<module name="common-pipeline" target="17" />
|
||||
<module name="common-public" target="17" />
|
||||
<module name="module-ci-commons" target="17" />
|
||||
<module name="module-ci-process" target="17" />
|
||||
<module name="pipeline-ci-api" target="17" />
|
||||
<module name="pipeline-ci-common" target="17" />
|
||||
<module name="pipeline-ci-process-api" target="17" />
|
||||
<module name="pipline-ci-common" target="17" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="app-plugins" options="-parameters" />
|
||||
<module name="ci-commons" options="-parameters" />
|
||||
<module name="ci-environment" options="-parameters" />
|
||||
<module name="ci-event" options="-parameters" />
|
||||
<module name="ci-log" options="-parameters" />
|
||||
<module name="ci-market" options="-parameters" />
|
||||
<module name="ci-process" options="-parameters" />
|
||||
<module name="ci-project" options="-parameters" />
|
||||
<module name="ci-quality" options="-parameters" />
|
||||
<module name="ci-scm-repository" options="-parameters" />
|
||||
<module name="ci-ticket" options="-parameters" />
|
||||
<module name="ci-worker" options="-parameters" />
|
||||
<module name="common-api" options="-parameters" />
|
||||
<module name="ci-common" options="-parameters" />
|
||||
<module name="ci-common-pipeline" options="-parameters" />
|
||||
<module name="ci-common-public" options="-parameters" />
|
||||
<module name="common-pipeline" options="-parameters" />
|
||||
<module name="common-public" options="-parameters" />
|
||||
<module name="commons" options="-parameters" />
|
||||
<module name="framework" options="-parameters" />
|
||||
<module name="module-ci-common" options="-parameters" />
|
||||
<module name="module-ci-common-pipeline" options="-parameters" />
|
||||
<module name="module-ci-commons" options="-parameters" />
|
||||
<module name="module-ci-environment" options="-parameters" />
|
||||
<module name="module-ci-event" options="-parameters" />
|
||||
<module name="module-ci-log" options="-parameters" />
|
||||
<module name="module-ci-market" options="-parameters" />
|
||||
<module name="module-ci-process" options="-parameters" />
|
||||
<module name="module-ci-process-api" options="-parameters" />
|
||||
<module name="module-ci-project" options="-parameters" />
|
||||
<module name="module-ci-quality" options="-parameters" />
|
||||
<module name="module-ci-repository" options="-parameters" />
|
||||
<module name="module-ci-ticket" options="-parameters" />
|
||||
<module name="module-ci-worker" options="-parameters" />
|
||||
<module name="module-infra-api" options="-parameters" />
|
||||
<module name="module-infra-biz" options="-parameters" />
|
||||
<module name="module-system-api" options="-parameters" />
|
||||
|
72
.idea/encodings.xml
generated
72
.idea/encodings.xml
generated
@ -39,38 +39,46 @@
|
||||
<file url="file://$PROJECT_DIR$/framework/spring-boot-starter-websocket/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/framework/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/framework/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/common-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/common-api/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/common-pipeline/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/common-pipeline/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/pipeline-ci-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/pipline-ci-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-commons/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-environment/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-environment/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-event/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-event/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-log/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-log/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-market/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-market/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-process/pipeline-ci-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-process/pipeline-ci-common/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-process/pipeline-ci-process-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-process/pipeline-ci-process-api/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-process/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-process/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-project/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-project/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-quality/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-quality/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-scm-repository/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-scm-repository/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-ticket/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-ticket/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-worker/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/ci-worker/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-common-pipeline/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-common-pipeline/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-common/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/ci-common-pipeline/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/ci-common-pipeline/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/ci-common-public/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/ci-common-public/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/ci-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/ci-common/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/pipeline-ci-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/pipline-ci-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-commons/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-environment/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-environment/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-event/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-event/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-log/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-log/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-market/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-market/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process-api/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process/pipeline-ci-common/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process/pipeline-ci-common/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process/pipeline-ci-process-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process/pipeline-ci-process-api/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-process/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-project/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-project/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-quality/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-quality/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-repository/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-repository/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-ticket/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-ticket/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-worker/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-ci-worker/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-infra-api/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-infra-api/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/modules/module-infra-biz/src/main/java" charset="UTF-8" />
|
||||
|
63
.idea/inspectionProfiles/Project_Default.xml
generated
63
.idea/inspectionProfiles/Project_Default.xml
generated
@ -1,5 +1,68 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidCallStaticSimpleDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidCommentBehindStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidComplexCondition" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidConcurrentCompetitionRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidDoubleOrFloatEqualCompare" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidManuallyCreateThread" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidMissUseOfMathRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidNegationOperator" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidNewDateGetTime" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidPatternCompileInMethod" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidReturnInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidStartWithDollarAndUnderLineNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidUseTimer" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaBigDecimalAvoidDoubleConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaBooleanPropertyShouldNotStartWithIs" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassCastExceptionWithSubListToArrayList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassCastExceptionWithToArray" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassMustHaveAuthor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassNamingShouldBeCamel" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCollectionInitShouldAssignCapacity" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCommentsMustBeJavadocFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaConcurrentExceptionWithModifyOriginSubList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaConstantFieldShouldBeUpperCase" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCountDownShouldInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaDontModifyInForeachCircle" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaEnumConstantsMustHaveComment" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaExceptionClassShouldEndWithException" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaIbatisMethodQueryForList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaLockShouldWithTryFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaLowerCamelCaseVariableNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaMethodReturnWrapperType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaMethodTooLong" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPackageNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoMustOverrideToString" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoMustUsePrimitiveField" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoNoDefaultValue" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaRemoveCommentedCode" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaServiceOrDaoClassShouldEndWithImpl" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSneakyThrowsWithoutExceptionType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaStringConcat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSwitchExpression" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSwitchStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaTestClassShouldEndWithTestNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadLocalShouldRemove" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadPoolCreation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadShouldSetName" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaTransactionMustHaveRollback" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUndefineMagicConstant" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUnsupportedExceptionWithModifyAsList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseQuietReferenceNotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseRightCaseForDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
22
.idea/misc.xml
generated
22
.idea/misc.xml
generated
@ -27,9 +27,9 @@
|
||||
<option name="excludeFilter" value="" />
|
||||
</component>
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$/modules/ci-commons/pipeline-ci-common" />
|
||||
<file type="web" url="file://$PROJECT_DIR$/modules/ci-process/ci-process-api" />
|
||||
<file type="web" url="file://$PROJECT_DIR$/modules/ci-process/ci-process-base" />
|
||||
<file type="web" url="file://$PROJECT_DIR$/modules/module-ci-commons/pipeline-ci-common" />
|
||||
<file type="web" url="file://$PROJECT_DIR$/modules/module-ci-process/ci-process-api" />
|
||||
<file type="web" url="file://$PROJECT_DIR$/modules/module-ci-process/ci-process-base" />
|
||||
</component>
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
@ -42,16 +42,32 @@
|
||||
<option value="$PROJECT_DIR$/modules/ci-commons/pipeline-ci-api/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/ci-commons/common-api/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/ci-commons/common-pipeline/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/common-public/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/common-pipeline/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-environment/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-worker/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/ci-common-public/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/ci-common-pipeline/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="ignoredFiles">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$/modules/ci-commons/pipeline-ci-api/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/ci-commons/pipline-ci-common/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/ci-common-pipeline/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/ci-common-public/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/ci-common/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-commons/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-process/pipeline-ci-process-api/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/modules/module-ci-process/pom.xml" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK" />
|
||||
<component name="SuppressKotlinCodeStyleNotification">
|
||||
<option name="disableForAll" value="true" />
|
||||
</component>
|
||||
<component name="SuppressionsComponent">
|
||||
<option name="suppComments" value="[]" />
|
||||
</component>
|
||||
|
91
dependencies/.flattened-pom.xml
vendored
91
dependencies/.flattened-pom.xml
vendored
@ -19,6 +19,7 @@
|
||||
<mybatis.version>3.5.16</mybatis.version>
|
||||
<opentracing.version>0.33.0</opentracing.version>
|
||||
<caffeine.version>2.9.3</caffeine.version>
|
||||
<json.version>20250107</json.version>
|
||||
<kingbase.jdbc.version>8.6.0</kingbase.jdbc.version>
|
||||
<commons-compress.version>1.27.1</commons-compress.version>
|
||||
<rocketmq-spring.version>2.3.1</rocketmq-spring.version>
|
||||
@ -68,6 +69,7 @@
|
||||
<commons-net.version>3.11.1</commons-net.version>
|
||||
<jimureport.version>1.7.8</jimureport.version>
|
||||
<easyexcel.verion>4.0.3</easyexcel.verion>
|
||||
<json.schema.validator.veresion>1.5.6</json.schema.validator.veresion>
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<easy-trans.version>3.0.6</easy-trans.version>
|
||||
<dm8.jdbc.version>8.1.3.140</dm8.jdbc.version>
|
||||
@ -194,48 +196,68 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-commons</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-event</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-common-pipeline</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-log</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-market</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-environment</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-process</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-event</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-project</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-log</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-quality</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-market</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-ticket</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-scm-repository</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-project</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-quality</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-ticket</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-repository</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-worker</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -244,8 +266,8 @@
|
||||
<version>${bizlog-sdk.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -300,12 +322,12 @@
|
||||
<version>${easy-trans.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -325,8 +347,8 @@
|
||||
<version>${redisson.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -336,8 +358,8 @@
|
||||
<version>${lock4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -377,8 +399,8 @@
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-admin-server-cloud</artifactId>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-server-cloud</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -398,12 +420,12 @@
|
||||
<version>${spring.boot.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>asm</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -477,6 +499,16 @@
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.networknt</groupId>
|
||||
<artifactId>json-schema-validator</artifactId>
|
||||
<version>${json.schema.validator.veresion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>${json.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
@ -523,8 +555,8 @@
|
||||
<version>${pf4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@ -578,11 +610,6 @@
|
||||
<artifactId>winp</artifactId>
|
||||
<version>${winp.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jenkins-ci</groupId>
|
||||
<artifactId>version-number</artifactId>
|
||||
<version>${version-number.version}}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
|
86
dependencies/pom.xml
vendored
86
dependencies/pom.xml
vendored
@ -59,6 +59,8 @@
|
||||
<easyexcel.verion>4.0.3</easyexcel.verion>
|
||||
<velocity.version>2.4</velocity.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<json.schema.validator.veresion>1.5.6</json.schema.validator.veresion>
|
||||
<json.version>20250107</json.version>
|
||||
<guava.version>33.3.1-jre</guava.version>
|
||||
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
|
||||
<commons-net.version>3.11.1</commons-net.version>
|
||||
@ -79,7 +81,7 @@
|
||||
<winp.version>1.28</winp.version>
|
||||
<version-number.version>1.12</version-number.version>
|
||||
<reflections.version>0.10.2</reflections.version>
|
||||
<!-- <commons-compress.version>1.21</commons-compress.version>-->
|
||||
<!-- <commons-compress.version>1.21</commons-compress.version>-->
|
||||
<commons-exec.version>1.4.0</commons-exec.version>
|
||||
<dd-plist.version>1.28</dd-plist.version>
|
||||
<apk-parser.version>2.6.10</apk-parser.version>
|
||||
@ -216,58 +218,83 @@
|
||||
<artifactId>module-system-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!--pipeline-dependency-->
|
||||
<!--ci-pipeline-dependency-->
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-commons</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-event</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-common-pipeline</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-log</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-market</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-environment</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-process</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-event</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-project</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-log</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-quality</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-market</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-ticket</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-scm-repository</artifactId>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-project</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-quality</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-ticket</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-repository</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-worker</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
@ -545,6 +572,17 @@
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.networknt</groupId>
|
||||
<artifactId>json-schema-validator</artifactId>
|
||||
<version>${json.schema.validator.veresion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>${json.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
@ -667,12 +705,6 @@
|
||||
<artifactId>winp</artifactId>
|
||||
<version>${winp.version}</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.jenkins-ci/version-number -->
|
||||
<dependency>
|
||||
<groupId>org.jenkins-ci</groupId>
|
||||
<artifactId>version-number</artifactId>
|
||||
<version>${version-number.version}}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 外部依赖 -->
|
||||
<dependency>
|
||||
@ -721,8 +753,6 @@
|
||||
<groupId>io.github.resilience4j</groupId>
|
||||
<artifactId>resilience4j-circuitbreaker</artifactId>
|
||||
<version>${resilience4j-circuitbreaker.version}</version>
|
||||
<!--
|
||||
<version></version>-->
|
||||
</dependency>
|
||||
<!-- devops ci- worker end-->
|
||||
</dependencies>
|
||||
|
@ -110,6 +110,7 @@
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
@ -144,11 +145,6 @@
|
||||
<artifactId>okhttp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>transmittable-thread-local</artifactId>
|
||||
@ -169,7 +165,6 @@
|
||||
<artifactId>bcprov-jdk18on</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -61,6 +61,10 @@ public class DateUtils {
|
||||
return LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
}
|
||||
|
||||
public static long LocalDateTimeToMilli(LocalDateTime localDateTime) {
|
||||
return localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||
}
|
||||
|
||||
public static Date addTime(Duration duration) {
|
||||
return new Date(System.currentTimeMillis() + duration.toMillis());
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.core.json.JsonReadFeature;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
@ -31,8 +32,14 @@ public class JsonUtils extends JSONUtil {
|
||||
static {
|
||||
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); // 忽略 null 值
|
||||
objectMapper.registerModules(new JavaTimeModule()); // 解决 LocalDateTime 的序列化
|
||||
objectMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
|
||||
objectMapper.configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(), true);
|
||||
/*遇到错误不抛出异常*/
|
||||
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, true);
|
||||
// 忽略 null 值
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
// 解决 LocalDateTime 的序列化
|
||||
objectMapper.registerModules(new JavaTimeModule());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ import java.util.Set;
|
||||
* <p>TODO</p>
|
||||
*
|
||||
* @author mian-bin
|
||||
* @Description YamlUtils
|
||||
* @Description YamlUtils , 这个是基础的yaml工具,非流水线的
|
||||
* @date 2025/1/10 15:22
|
||||
*/
|
||||
public class YamlUtils {
|
||||
|
@ -67,18 +67,6 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
|
@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-commons</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>common-api</artifactId>
|
||||
|
||||
<version>${revision}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>common-api</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1 +0,0 @@
|
||||
spring.application.name=common-api
|
@ -1,13 +0,0 @@
|
||||
package cd.casic.ci.common.api;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class CommonApiApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
33
modules/ci-commons/common-pipeline/.gitignore
vendored
33
modules/ci-commons/common-pipeline/.gitignore
vendored
@ -1,33 +0,0 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-commons</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>common-pipeline</artifactId>
|
||||
<version>${revision}</version>
|
||||
<name>common-pipeline</name>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>common-api</artifactId>
|
||||
<version>2.0.0-jdk17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.common.pipeline.type
|
||||
* @Project:ops-pro
|
||||
* @name:package-info
|
||||
* @Date:2025/03/27 10:44
|
||||
* @Filename:package-info
|
||||
* @description:Todo
|
||||
*/
|
||||
package cd.casic.ci.common.pipeline.type;
|
@ -1,38 +0,0 @@
|
||||
package cd.casic.ci.common.pipeline.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.common.pipeline.utils
|
||||
* @Project:ops-pro
|
||||
* @name:TransferUtil
|
||||
* @Date:2025/03/26 16:09
|
||||
* @Filename:TransferUtil
|
||||
* @description:Todo
|
||||
*/
|
||||
public class TransferUtil {
|
||||
public static Map<String, Object> simplifyParams(JSONObject defaultValue, Map<String, Object> input) {
|
||||
return input.entrySet().stream()
|
||||
.filter(entry -> {
|
||||
var inputValue = entry.getValue();
|
||||
if (defaultValue.containsKey(entry.getKey())) {
|
||||
return !new JSONObject(entry.getKey(), defaultValue.get(entry.getKey())).similar(new JSONObject(entry.getKey(), inputValue));
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
}
|
||||
|
||||
public static Map<String, Object> mixParams(JSONObject defaultValue, Map<String, Object> input) {
|
||||
var out = input != null ? new HashMap<>(input) : new HashMap<>();
|
||||
if (defaultValue != null) {
|
||||
defaultValue.toMap().forEach((k, v) -> out.putIfAbsent(k, v));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
spring.application.name=common-pipeline
|
@ -1,13 +0,0 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class CommonPipelineApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-commons</artifactId>
|
||||
<version>${revision}</version>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>common-api</module>
|
||||
<module>common-pipeline</module>
|
||||
</modules>
|
||||
|
||||
<description>
|
||||
流水线process、流水线engine、流水线work、资源管理层、环境管理、agent、构建调度、项目管理、代码库、凭证、扩展Plugin、日志、流水线外设需要的commons
|
||||
</description>
|
||||
</project>
|
@ -1,23 +0,0 @@
|
||||
package cd.casic.ci.event.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.event.enums
|
||||
* @Project:ops-pro
|
||||
* @name:ActionType
|
||||
* @Date:2025/03/25 9:51
|
||||
* @Filename:ActionType
|
||||
* @description:Todo
|
||||
*/
|
||||
@Getter
|
||||
public enum ActionType {
|
||||
RETRY, // 重试
|
||||
START, // 开始
|
||||
REFRESH, // 刷新ElementAdditionalOptions
|
||||
END, // 强制结束当前节点,会导致当前构建容器结束
|
||||
SKIP, // 跳过-不执行
|
||||
TERMINATE, // 终止
|
||||
ARCHIVE; // 归档
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-process</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>pipeline-ci-process-api</artifactId>
|
||||
|
||||
<name>pipeline-ci-process-api</name>
|
||||
<description>pipeline-ci-process-api</description>
|
||||
|
||||
<version>${revision}</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>commons-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>commons-pipeline</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-event</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1,53 +0,0 @@
|
||||
package cd.casic.ci.process.api.process.pojo.trigger;
|
||||
|
||||
import cd.casic.ci.log.scm.enums.ScmType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger
|
||||
* @Project:ops-pro
|
||||
* @name:PipelineTriggerType
|
||||
* @Date:2025/03/24 17:27
|
||||
* @Filename:PipelineTriggerType
|
||||
* @description:Todo
|
||||
*/
|
||||
public enum PipelineTriggerType {
|
||||
@Schema(title = "SVN 代码库")
|
||||
CODE_SVN,
|
||||
@Schema(title = "GIT 代码库")
|
||||
CODE_GIT,
|
||||
@Schema(title = "Gitlab 代码库")
|
||||
CODE_GITLAB,
|
||||
@Schema(title = "Github 代码库")
|
||||
GITHUB,
|
||||
@Schema(title = "TGIT 代码库")
|
||||
CODE_TGIT,
|
||||
@Schema(title = "P4 代码库")
|
||||
CODE_P4,
|
||||
@Schema(title = "手动触发")
|
||||
MANUAL,
|
||||
@Schema(title = "定时触发")
|
||||
TIME_TRIGGER,
|
||||
@Schema(title = "服务触发")
|
||||
OPENAPI,
|
||||
@Schema(title = "流水线触发")
|
||||
PIPELINE,
|
||||
@Schema(title = "远程触发")
|
||||
REMOTE;
|
||||
|
||||
public static List<IdValue> toMap(ScmType scmType, String userId) {
|
||||
// 实现逻辑
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ScmType toScmType(String triggerType) {
|
||||
// 实现逻辑
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean webhookTrigger(String triggerType) {
|
||||
// 实现逻辑
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,183 +0,0 @@
|
||||
package cd.casic.ci.process.api.process.utils;
|
||||
|
||||
import cd.casic.ci.process.api.process.constant.ProcessMessageCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.process.api.process.utils
|
||||
* @Project:ops-pro
|
||||
* @name:DependOnUtils
|
||||
* @Date:2025/03/27 14:39
|
||||
* @Filename:DependOnUtils
|
||||
* @description:Todo
|
||||
*/
|
||||
@Slf4j
|
||||
public class DependOnUtils {
|
||||
|
||||
private static final Pattern REGEX = Pattern.compile("[,;]");
|
||||
|
||||
public static void checkRepeatedJobId(Stage stage) {
|
||||
Set<String> jobIdSet = new HashSet<>();
|
||||
for (Container c : stage.getContainers()) {
|
||||
String jobId = c.getJobId();
|
||||
if (jobId == null || jobId.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (jobIdSet.contains(jobId)) {
|
||||
String jobName = getContainerName(stage, c, jobId);
|
||||
throw new ErrorCodeException(
|
||||
Response.Status.CONFLICT.getStatusCode(),
|
||||
ProcessMessageCode.ERROR_PIPELINE_JOBID_EXIST,
|
||||
new String[]{jobName, jobId},
|
||||
jobName + " 的jobId(" + jobId + ")已存在"
|
||||
);
|
||||
}
|
||||
jobIdSet.add(jobId);
|
||||
}
|
||||
removeNonexistentJob(stage, jobIdSet);
|
||||
}
|
||||
|
||||
private static void removeNonexistentJob(Stage stage, Set<String> jobIdSet) {
|
||||
for (Container c : stage.getContainers()) {
|
||||
JobControlOption jobControlOption = null;
|
||||
if (c instanceof VMBuildContainer) {
|
||||
jobControlOption = ((VMBuildContainer) c).getJobControlOption();
|
||||
} else if (c instanceof NormalContainer) {
|
||||
jobControlOption = ((NormalContainer) c).getJobControlOption();
|
||||
}
|
||||
if (jobControlOption == null) {
|
||||
continue;
|
||||
}
|
||||
if (jobControlOption.getDependOnType() != DependOnType.ID || jobControlOption.getDependOnId() == null || jobControlOption.getDependOnId().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
List<String> existJobIds = jobControlOption.getDependOnId().stream()
|
||||
.filter(jobIdSet::contains)
|
||||
.toList();
|
||||
jobControlOption.setDependOnId(existJobIds);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initDependOn(Stage stage, Map<String, String> params) {
|
||||
Map<String, Container> allJobId2JobMap = new HashMap<>();
|
||||
for (Container c : stage.getContainers()) {
|
||||
String jobId = c.getJobId();
|
||||
if (jobId == null || jobId.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
allJobId2JobMap.put(jobId, c);
|
||||
}
|
||||
if (allJobId2JobMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, List<String>> cycleCheckJobMap = new HashMap<>();
|
||||
for (Container c : stage.getContainers()) {
|
||||
JobControlOption jobControlOption = null;
|
||||
if (c instanceof VMBuildContainer) {
|
||||
jobControlOption = ((VMBuildContainer) c).getJobControlOption();
|
||||
} else if (c instanceof NormalContainer) {
|
||||
jobControlOption = ((NormalContainer) c).getJobControlOption();
|
||||
}
|
||||
if (jobControlOption == null) {
|
||||
continue;
|
||||
}
|
||||
List<String> dependOnJobIds = getDependOnJobIds(new DependOnConfig(
|
||||
jobControlOption.getDependOnType(),
|
||||
jobControlOption.getDependOnId(),
|
||||
jobControlOption.getDependOnName()
|
||||
), params);
|
||||
if (dependOnJobIds.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (c.getJobId() != null) {
|
||||
cycleCheckJobMap.put(c.getJobId(), dependOnJobIds);
|
||||
}
|
||||
Map<String, String> containerId2JobIds = new HashMap<>();
|
||||
for (String dependOnJobId : dependOnJobIds) {
|
||||
Container dependOnJob = allJobId2JobMap.get(dependOnJobId);
|
||||
if (dependOnJob == null) {
|
||||
continue;
|
||||
}
|
||||
containerId2JobIds.put(dependOnJob.getId(), dependOnJobId);
|
||||
}
|
||||
if (!containerId2JobIds.isEmpty()) {
|
||||
jobControlOption.setDependOnContainerId2JobIds(containerId2JobIds);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Integer> visited = new HashMap<>();
|
||||
for (String jobId : cycleCheckJobMap.keySet()) {
|
||||
dsf(jobId, cycleCheckJobMap, visited, stage, allJobId2JobMap);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean enableDependOn(Container container) {
|
||||
JobControlOption jobControlOption = null;
|
||||
if (container instanceof VMBuildContainer) {
|
||||
jobControlOption = ((VMBuildContainer) container).getJobControlOption();
|
||||
} else if (container instanceof NormalContainer) {
|
||||
jobControlOption = ((NormalContainer) container).getJobControlOption();
|
||||
}
|
||||
if (jobControlOption == null) {
|
||||
return false;
|
||||
}
|
||||
return switch (jobControlOption.getDependOnType()) {
|
||||
case ID -> jobControlOption.getDependOnId() != null && !jobControlOption.getDependOnId().isEmpty();
|
||||
case NAME -> jobControlOption.getDependOnName() != null && !jobControlOption.getDependOnName().isEmpty();
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
private static List<String> getDependOnJobIds(DependOnConfig dependOnConfig, Map<String, String> params) {
|
||||
return switch (dependOnConfig.getDependOnType()) {
|
||||
case ID -> dependOnConfig.getDependOnId() != null ? dependOnConfig.getDependOnId() : Collections.emptyList();
|
||||
case NAME -> {
|
||||
if (dependOnConfig.getDependOnName() == null || dependOnConfig.getDependOnName().isEmpty()) {
|
||||
yield Collections.emptyList();
|
||||
} else {
|
||||
String[] dependONames = dependOnConfig.getDependOnName().split(REGEX);
|
||||
List<String> result = new ArrayList<>();
|
||||
for (String name : dependONames) {
|
||||
result.add(EnvUtils.parseEnv(name, params));
|
||||
}
|
||||
yield result;
|
||||
}
|
||||
}
|
||||
default -> Collections.emptyList();
|
||||
};
|
||||
}
|
||||
|
||||
private static void dsf(String jobId, Map<String, List<String>> dependOnMap, Map<String, Integer> visited, Stage stage, Map<String, Container> allJobId2JobMap) {
|
||||
if (visited.getOrDefault(jobId, 0) == 1) {
|
||||
String jobName = getContainerName(stage, allJobId2JobMap.get(jobId), jobId);
|
||||
String dependJobName = getContainerName(stage, allJobId2JobMap.get(dependOnJobId), dependOnJobId);
|
||||
throw new ErrorCodeException(
|
||||
ProcessMessageCode.ERROR_PIPELINE_DEPENDON_CYCLE,
|
||||
new String[]{jobName, dependJobName}
|
||||
);
|
||||
}
|
||||
if (visited.getOrDefault(jobId, 0) == 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
visited.put(jobId, 1);
|
||||
List<String> dependOnJobIds = dependOnMap.getOrDefault(jobId, Collections.emptyList());
|
||||
for (String dependOnJobId : dependOnJobIds) {
|
||||
dsf(dependOnJobId, dependOnMap, visited, stage, allJobId2JobMap);
|
||||
}
|
||||
visited.put(jobId, 2);
|
||||
}
|
||||
|
||||
private static String getContainerName(Stage stage, Container container, String jobId) {
|
||||
if (container == null) {
|
||||
return jobId;
|
||||
}
|
||||
String namePrefix = stage.getName() != null ? stage.getName().replaceFirst("stage-", "") : "";
|
||||
return namePrefix + "-" + container.getId();
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
spring.application.name=pipeline-ci-process-api
|
@ -1,13 +0,0 @@
|
||||
package cd.casic.ci.process.api;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class PipelineCiProcessApiApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-process</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
<modules>
|
||||
<module>pipeline-ci-process-api</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-commons</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-event</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-project</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-quality</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-scm-repository</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.ci</groupId>
|
||||
<artifactId>ci-ticket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
24
modules/module-ci-common-pipeline/pom.xml
Normal file
24
modules/module-ci-common-pipeline/pom.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>module-ci-common-pipeline</artifactId>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1,5 +1,7 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -1,5 +1,9 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.matrix.DispatchInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.common.pipeline
|
@ -1,9 +1,9 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.matrix.DispatchInfo;
|
||||
import com.fasterxml.jackson.databind.jsontype.NamedType;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
@ -36,7 +36,5 @@ public class DispatchSubInfoRegisterLoader {
|
||||
log.info("[REGISTER_DISPATCH]|{} for {}", entry.getValue(), entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
JsonUtil.registerModule(infoSubModule);
|
||||
}
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.type.DispatchType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.common.pipeline
|
@ -1,9 +1,9 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.type.DispatchType;
|
||||
import com.fasterxml.jackson.databind.jsontype.NamedType;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
@ -36,7 +36,5 @@ public class DispatchSubTypeRegisterLoader {
|
||||
log.info("[REGISTER_DISPATCH]|{} for {}", entry.getValue(), entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
JsonUtil.registerModule(typeSubModule);
|
||||
}
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.pojo.element.Element;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.common.pipeline
|
@ -1,10 +1,10 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.pojo.element.Element;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.jsontype.NamedType;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
@ -41,10 +41,6 @@ public class ElementSubTypeRegisterLoader {
|
||||
log.info("[REGISTER_MODEL_ELEMENT]|{} for {}", entry.getValue(), entry.getKey());
|
||||
}
|
||||
}
|
||||
JsonUtil.registerModule(elementSubModule);
|
||||
if (objectMapper != null) {
|
||||
objectMapper.registerModule(elementSubModule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,14 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import cd.casic.ci.common.functions.ExpressionOutput;
|
||||
import cd.casic.ci.common.functions.IFunctionInfo;
|
||||
import cd.casic.ci.common.pojo.NamedValueInfo;
|
||||
import cd.casic.ci.common.pipeline.dialect.IPipelineDialect;
|
||||
import cd.casic.ci.common.pipeline.utils.ObjectReplaceEnvVarUtil;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.networknt.schema.ExecutionContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -15,8 +23,8 @@ import java.util.regex.Pattern;
|
||||
* @Filename:EnvReplacementParser
|
||||
* @description:Todo
|
||||
*/
|
||||
@Slf4j
|
||||
public class EnvReplacementParser {
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(EnvReplacementParser.class);
|
||||
private static final Pattern expressionPattern = Pattern.compile("\\$[{]{2}([^$^{}]+)[}]{2}");
|
||||
|
||||
public static String parse(Object value, Map<String, String> contextMap, Boolean onlyExpression,
|
||||
@ -36,19 +44,22 @@ public class EnvReplacementParser {
|
||||
public static String parse(Object value, Boolean onlyExpression, ExprReplacementOptions options) {
|
||||
if (value == null) return "";
|
||||
if (onlyExpression == null || !onlyExpression) {
|
||||
return JsonUtil.toJson(ObjectReplaceEnvVarUtil.replaceEnvVar(value, options.contextMap), false);
|
||||
return JSONUtil.toJsonStr(ObjectReplaceEnvVarUtil.replaceEnvVar(value, options.getContextMap()));
|
||||
} else {
|
||||
return JsonUtil.toJson(ExprReplacementUtil.replaceEnvVar(value, options), false);
|
||||
//return JsonUtil.toJson(ExprReplacementUtil.replaceEnvVar(value, options), false);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Pair<ExecutionContext, List<NamedValueInfo>> getCustomExecutionContextByMap(Map<String, String> variables,
|
||||
List<RuntimeNamedValue> extendNamedValueMap) {
|
||||
return ExprReplacementUtil.getCustomExecutionContextByMap(variables, extendNamedValueMap);
|
||||
}
|
||||
// public static Pair<ExecutionContext, List<NamedValueInfo>> getCustomExecutionContextByMap(Map<String, String> variables,
|
||||
// List<RuntimeNamedValue> extendNamedValueMap) {
|
||||
// return ExprReplacementUtil.getCustomExecutionContextByMap(variables, extendNamedValueMap);
|
||||
// }
|
||||
|
||||
public static boolean containsExpressions(String value) {
|
||||
if (value == null) return false;
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
return expressionPattern.matcher(value).find();
|
||||
}
|
||||
}
|
@ -1,6 +1,12 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.functions.ExpressionOutput;
|
||||
import cd.casic.ci.common.functions.IFunctionInfo;
|
||||
import cd.casic.ci.common.pojo.NamedValueInfo;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import com.networknt.schema.ExecutionContext;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@ -16,6 +22,7 @@ import java.util.Map;
|
||||
* @description:Todo
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Schema(title = "表达式替换参数")
|
||||
public class ExprReplacementOptions {
|
||||
|
||||
@ -31,4 +38,11 @@ public class ExprReplacementOptions {
|
||||
private Iterable<IFunctionInfo> functions;
|
||||
|
||||
private ExpressionOutput output;
|
||||
|
||||
public ExprReplacementOptions(Map<String, String> contextMap, Pair<ExecutionContext, List<NamedValueInfo>> contextPair, Iterable<IFunctionInfo> functions, ExpressionOutput output) {
|
||||
this.contextMap = contextMap;
|
||||
this.contextPair = contextPair;
|
||||
this.functions = functions;
|
||||
this.output = output;
|
||||
}
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.container.Stage;
|
||||
import cd.casic.ci.common.pipeline.pojo.event.PipelineCallbackEvent;
|
||||
import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost;
|
||||
import cd.casic.ci.common.pipeline.pojo.transfer.Resources;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -28,7 +32,8 @@ public class Model implements IModelTemplate {
|
||||
private List<Stage> stages;
|
||||
|
||||
@Schema(title = "标签", required = false)
|
||||
@Deprecated("以PipelineGroupService和流水线设置版本中为准")
|
||||
@Deprecated
|
||||
//"以PipelineGroupService和流水线设置版本中为准"
|
||||
private List<String> labels;
|
||||
|
||||
@Schema(title = "是否从模板中实例化出来的", required = false)
|
@ -1,6 +1,7 @@
|
||||
package cd.casic.ci.common.pipeline;
|
||||
|
||||
import cd.casic.ci.common.pipeline.pojo.PipelineModelAndSetting;
|
||||
import cd.casic.ci.common.pipeline.pojo.transfer.PreviewResponse;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(title = "流水线模型-普通任务容器")
|
||||
public class NormalContainer extends Container {
|
||||
public static final String CLASS_TYPE = "normal";
|
||||
public static final String classType = "normal";
|
||||
|
||||
private Boolean enableSkip = false;
|
||||
|
||||
@ -34,7 +34,7 @@ public class NormalContainer extends Container {
|
||||
|
||||
@Override
|
||||
public String getClassType() {
|
||||
return CLASS_TYPE;
|
||||
return classType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -79,7 +79,7 @@ public class NormalContainer extends Container {
|
||||
|
||||
@Override
|
||||
public void setContainerEnable(boolean enable) {
|
||||
jobControlOption = jobControlOption != null ? jobControlOption.copy(enable) : new JobControlOption(enable);
|
||||
jobControlOption = jobControlOption != null ? jobControlOption.setEnable(enable) : new JobControlOption().setEnable(enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -92,4 +92,34 @@ public class NormalContainer extends Container {
|
||||
}
|
||||
super.transformCompatibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRef() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getVariables() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemplate(String template) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRef(String ref) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariables(Map<String, String> variables) {
|
||||
|
||||
}
|
||||
}
|
@ -105,6 +105,10 @@ public class Stage implements IModelTemplate {
|
||||
return stageControlOption != null ? stageControlOption.getEnable() : true;
|
||||
}
|
||||
|
||||
public boolean isFinally() {
|
||||
return finallyStage != null && finallyStage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplate() {
|
||||
return null;
|
||||
@ -119,4 +123,19 @@ public class Stage implements IModelTemplate {
|
||||
public Map<String, String> getVariables() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemplate(String template) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRef(String ref) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariables(Map<String, String> variables) {
|
||||
|
||||
}
|
||||
}
|
@ -124,4 +124,19 @@ public class TriggerContainer extends Container {
|
||||
public Map<String, String> getVariables() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemplate(String template) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRef(String ref) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariables(Map<String, String> variables) {
|
||||
|
||||
}
|
||||
}
|
@ -188,4 +188,19 @@ public class VMBuildContainer extends Container {
|
||||
public Map<String, String> getVariables() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemplate(String template) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRef(String ref) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariables(Map<String, String> variables) {
|
||||
|
||||
}
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package cd.casic.ci.common.pipeline.enums;
|
||||
|
||||
import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeLine;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
* @Package:cd.casic.ci.common.pipeline.enums
|
@ -100,11 +100,6 @@ public enum BuildStatus {
|
||||
return this == QUEUE_TIMEOUT || this == EXEC_TIMEOUT || this == HEARTBEAT_TIMEOUT;
|
||||
}
|
||||
|
||||
public String getI18n(String language) {
|
||||
// Assuming MessageUtil is available in Java
|
||||
return MessageUtil.getMessageByLocale("buildStatus." + statusName, language);
|
||||
}
|
||||
|
||||
public static BuildStatus parse(String statusName) {
|
||||
try {
|
||||
return statusName == null ? UNKNOWN : BuildStatus.valueOf(statusName);
|
@ -0,0 +1,33 @@
|
||||
package cd.casic.ci.common.pipeline.enums;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname CallBackEvent
|
||||
* @Description TODO
|
||||
* @Date 2025/4/2 9:48
|
||||
*/ // 定义回调事件的枚举类
|
||||
public enum CallBackEvent {
|
||||
DELETE_PIPELINE, /*流水线删除*/
|
||||
CREATE_PIPELINE, /*流水线创建*/
|
||||
UPDATE_PIPELINE, /*流水线更新,包括model和setting。*/
|
||||
STREAM_ENABLED, /*stream ci 开启/关闭*/
|
||||
RESTORE_PIPELINE, /*流水线恢复*/
|
||||
|
||||
BUILD_QUEUE, /*构建排队,包含并发超限时排队、并发组排队。*/
|
||||
BUILD_START, /*构建开始,不包含并发超限时排队、并发组排队。*/
|
||||
BUILD_END, /*构建结束*/
|
||||
BUILD_STAGE_START, /*stage开始*/
|
||||
BUILD_STAGE_END, /*stage结束*/
|
||||
BUILD_JOB_QUEUE, /*job排队,包含互斥组排队、构建机复用互斥排队、最大job并发排队。*/
|
||||
BUILD_JOB_START, /*job开始,不包含BUILD_JOB_QUEUE。如果job SKIP或没有可执行的插件,就不会有该事件。*/
|
||||
BUILD_JOB_END, /*job结束,job SKIP或没有可执行的插件时会有该事件。*/
|
||||
BUILD_AGENT_START, /*构建机启动,现在仅包含第三方构建机*/
|
||||
BUILD_TASK_START, /*插件开始*/
|
||||
BUILD_TASK_END, /*插件结束*/
|
||||
BUILD_TASK_PAUSE, /*插件前置暂停*/
|
||||
|
||||
PROJECT_CREATE, /*项目创建*/
|
||||
PROJECT_UPDATE, /*项目更新*/
|
||||
PROJECT_ENABLE, /*项目启用*/
|
||||
PROJECT_DISABLE /*项目禁用*/
|
||||
}
|
@ -16,6 +16,7 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum CharsetType {
|
||||
DEFAULT,
|
||||
GB2312,
|
||||
UTF_8,
|
||||
GBK;
|
||||
}
|
@ -2,10 +2,15 @@ package cd.casic.ci.common.pipeline.enums;
|
||||
|
||||
import cd.casic.ci.common.pipeline.pojo.element.trigger.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
@ -48,7 +53,8 @@ public enum StartType {
|
||||
case "PIPELINE" -> PIPELINE.name();
|
||||
default -> "";
|
||||
};
|
||||
return name.isBlank() ? name : MessageUtil.getMessageByLocale("START_TYPE_" + name, language, params);
|
||||
|
||||
return name.isBlank() ? name : MessageFormat.format("START_TYPE_" + name, language, params);
|
||||
}
|
||||
|
||||
public static StartType toStartType(String type) {
|
||||
@ -86,4 +92,11 @@ public enum StartType {
|
||||
default -> RemoteTriggerElement.classType;
|
||||
};
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
static class IdValue {
|
||||
private String id;
|
||||
private String value;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import cd.casic.ci.common.pipeline.dialect.IPipelineDialect;
|
||||
import cd.casic.ci.common.pipeline.pojo.element.Element;
|
||||
import cd.casic.ci.common.pipeline.pojo.element.atom.BeforeDeleteParam;
|
||||
import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting;
|
||||
import cd.casic.framework.commons.exception.ServerException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -26,7 +27,7 @@ public interface ModelCheckPlugin {
|
||||
* @param userId 操作人
|
||||
* @param oauthUser 当前流水线权限代持人
|
||||
* @param pipelineDialect 流水线方言,只有新增/编辑流水线或模版时才需要传入
|
||||
* @throws ErrorCodeException 检查失败或异常
|
||||
* @throws ServerException 检查失败或异常
|
||||
*/
|
||||
int checkModelIntegrity(
|
||||
Model model,
|
||||
@ -36,14 +37,14 @@ public interface ModelCheckPlugin {
|
||||
String oauthUser,
|
||||
IPipelineDialect pipelineDialect,
|
||||
String pipelineId
|
||||
) throws ErrorCodeException;
|
||||
) throws ServerException;
|
||||
|
||||
/**
|
||||
* 检查[setting]配置的完整性
|
||||
*
|
||||
* @throws ErrorCodeException 检查失败或异常
|
||||
* @throws ServerException 检查失败或异常
|
||||
*/
|
||||
void checkSettingIntegrity(PipelineSetting setting, String projectId) throws ErrorCodeException;
|
||||
void checkSettingIntegrity(PipelineSetting setting, String projectId) throws ServerException;
|
||||
|
||||
/**
|
||||
* 清理Model--不删除里面的Element内的逻辑
|
||||
@ -67,17 +68,17 @@ public interface ModelCheckPlugin {
|
||||
* 检查[container]下的[element]插件的超时配置是否合法。
|
||||
* 如果使用了变量,则从变量表[contextMap]进行替换,如果值不符合,则抛出异常[ErrorCodeException]
|
||||
*/
|
||||
void checkElementTimeoutVar(Container container, Element element, Map<String, String> contextMap) throws ErrorCodeException;
|
||||
void checkElementTimeoutVar(Container container, Element element, Map<String, String> contextMap) throws ServerException;
|
||||
|
||||
/**
|
||||
* 检查[container]下互斥组配置是否合法,
|
||||
* 如果使用了变量,则从变量表[contextMap]进行替换,如果值不符合,则抛出异常[ErrorCodeException]
|
||||
*/
|
||||
void checkMutexGroup(Container container, Map<String, String> contextMap) throws ErrorCodeException;
|
||||
void checkMutexGroup(Container container, Map<String, String> contextMap) throws ServerException;
|
||||
|
||||
/**
|
||||
* 检查是否是[finallyStage]Stage的Job[container]下[JobControlOption]配置是否合法。
|
||||
* 如果使用了变量,则从变量表[contextMap]进行替换,如果值不符合,则抛出异常[ErrorCodeException]
|
||||
*/
|
||||
void checkJobCondition(Container container, boolean finallyStage, Map<String, String> contextMap) throws ErrorCodeException;
|
||||
void checkJobCondition(Container container, boolean finallyStage, Map<String, String> contextMap) throws ServerException;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cd.casic.ci.common.pipeline.matrix;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname DispatchInfo
|
||||
* @Description TODO
|
||||
* @Date 2025/3/29 15:35
|
||||
*/
|
||||
@Data
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
include = JsonTypeInfo.As.PROPERTY,
|
||||
property = "dispatchInfo",
|
||||
visible = false
|
||||
)
|
||||
@JsonSubTypes.Type(value = SampleDispatchInfo.class, name = "SAMPLE")
|
||||
public abstract class DispatchInfo {
|
||||
protected String name;
|
||||
|
||||
public DispatchInfo(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package cd.casic.ci.common.pipeline.matrix;
|
||||
import cd.casic.ci.common.utils.YamlUtil;
|
||||
import cd.casic.ci.common.pipeline.utils.MatrixContextUtils;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname MatrixConfig
|
||||
* @Description TODO
|
||||
* @Date 2025/3/29 15:46
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(title = "矩阵的分裂计算配置")
|
||||
public class MatrixConfig {
|
||||
@Schema(title = "分裂策略", required = true)
|
||||
private Map<String, List<String>> strategy;
|
||||
@Schema(title = "额外的参数组合", required = true)
|
||||
private List<Map<String, String>> include;
|
||||
@Schema(title = "排除的参数组合", required = false)
|
||||
private List<Map<String, String>> exclude;
|
||||
|
||||
public static final String MATRIX_CONTEXT_KEY_PREFIX = "matrix.";
|
||||
|
||||
/**
|
||||
* 根据[strategy], [include], [exclude]矩阵参数计算最终参数组合列表
|
||||
*/
|
||||
public List<Map<String, String>> getAllCombinations() {
|
||||
List<Map<String, String>> combinations = new ArrayList<>();
|
||||
Pair<List<String>, List<Map<String, String>>> result = calculateContextMatrix(strategy);
|
||||
List<String> keyList = result.getKey();
|
||||
List<Map<String, String>> strategyCase = result.getValue();
|
||||
combinations.addAll(strategyCase);
|
||||
|
||||
// 将额外添加的参数在匹配的组合内进行追加
|
||||
List<Map<String, String>> caseToAdd = new ArrayList<>();
|
||||
if (include != null) {
|
||||
for (Map<String, String> includeCase : include) {
|
||||
// 如果strategy为空,直接添加include
|
||||
if (strategyCase.isEmpty()) {
|
||||
caseToAdd.add(new HashMap<>(includeCase));
|
||||
}
|
||||
// 筛选出所有与矩阵匹配的key
|
||||
List<String> matchKey = new ArrayList<>();
|
||||
for (String key : includeCase.keySet()) {
|
||||
if (keyList.contains(key)) {
|
||||
matchKey.add(key);
|
||||
}
|
||||
}
|
||||
// 如果没有匹配的key则直接丢弃
|
||||
if (matchKey.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
boolean expanded = false;
|
||||
List<Map<String, String>> caseToAddTmp = new ArrayList<>();
|
||||
for (Map<String, String> var : combinations) {
|
||||
if (keyValueMatch(var, includeCase, matchKey)) {
|
||||
// 将全匹配的额外参数直接追加到匹配的组合
|
||||
var.putAll(includeCase);
|
||||
expanded = true;
|
||||
} else {
|
||||
// 不能全匹配的额外参数作为一个新组合加入
|
||||
caseToAddTmp.add(new HashMap<>(includeCase));
|
||||
}
|
||||
}
|
||||
if (!expanded) {
|
||||
caseToAdd.addAll(caseToAddTmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
combinations.addAll(caseToAdd);
|
||||
// 计算strategy和include后,再进行组合排除
|
||||
if (exclude != null) {
|
||||
combinations.removeAll(exclude);
|
||||
}
|
||||
|
||||
List<Map<String, String>> finalResult = new ArrayList<>();
|
||||
for (Map<String, String> contextCase : combinations) {
|
||||
// 临时方案:支持解析value中的一级对象访问
|
||||
Map<String, String> resultCase = new HashMap<>();
|
||||
for (Map.Entry<String, String> entry : contextCase.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
resultCase.put(MATRIX_CONTEXT_KEY_PREFIX + key, value);
|
||||
try {
|
||||
Map<String, Object> map = YamlUtil.to(value, new com.fasterxml.jackson.core.type.TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (map != null) {
|
||||
for (Map.Entry<String, Object> pairEntry : map.entrySet()) {
|
||||
String pair = pairEntry.getKey();
|
||||
String[] split = pair.split("=");
|
||||
if (split.length == 2) {
|
||||
resultCase.put(MATRIX_CONTEXT_KEY_PREFIX + key + "." + split[0], split[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 忽略解析异常
|
||||
}
|
||||
}
|
||||
finalResult.add(resultCase);
|
||||
}
|
||||
// 去重
|
||||
List<Map<String, String>> distinctResult = new ArrayList<>();
|
||||
for (Map<String, String> map : finalResult) {
|
||||
if (!distinctResult.contains(map)) {
|
||||
distinctResult.add(map);
|
||||
}
|
||||
}
|
||||
return distinctResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据[strategyMap]矩阵生成所有参数组合列表
|
||||
*/
|
||||
private Pair<List<String>, List<Map<String, String>>> calculateContextMatrix(Map<String, List<String>> strategyMap) {
|
||||
if (strategyMap == null || strategyMap.isEmpty()) {
|
||||
return new Pair<>(Collections.emptyList(), Collections.emptyList());
|
||||
}
|
||||
List<Map<String, String>> caseList = new ArrayList<>();
|
||||
List<String> keyList = new ArrayList<>(strategyMap.keySet());
|
||||
ArrayList<List<String>> valueLists = new ArrayList<>(strategyMap.values());
|
||||
MatrixContextUtils.loopCartesianProduct(valueLists).forEach(valueList -> {
|
||||
Map<String, String> var = new HashMap<>();
|
||||
for (int i = 0; i < keyList.size(); i++) {
|
||||
var.put(keyList.get(i), valueList.get(i).toString());
|
||||
}
|
||||
caseList.add(var);
|
||||
});
|
||||
return new Pair<>(keyList, caseList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对比[case]和[includeCase]中所有匹配key[matchKey]的值是否相同
|
||||
* 出现任意不同的情况则不是全匹配
|
||||
*/
|
||||
private boolean keyValueMatch(Map<String, String> var, Map<String, String> includeCase, List<String> matchKey) {
|
||||
for (String key : matchKey) {
|
||||
if (!Objects.equals(var.get(key), includeCase.get(key))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cd.casic.ci.common.pipeline.matrix;
|
||||
|
||||
import cd.casic.ci.common.pipeline.enums.VMBaseOS;
|
||||
import cd.casic.ci.common.pipeline.type.DispatchType;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname SampleDispatchInfo
|
||||
* @Description TODO
|
||||
* @Date 2025/3/29 15:44
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SampleDispatchInfo extends DispatchInfo {
|
||||
private final DispatchType dispatchType;
|
||||
private final VMBaseOS baseOS;
|
||||
private final Map<String, String> buildEnv;
|
||||
|
||||
public SampleDispatchInfo(String name, DispatchType dispatchType, VMBaseOS baseOS, java.util.Map<String, String> buildEnv) {
|
||||
super(name);
|
||||
this.dispatchType = dispatchType;
|
||||
this.baseOS = baseOS;
|
||||
this.buildEnv = buildEnv;
|
||||
}
|
||||
}
|
@ -4,7 +4,10 @@ import cd.casic.ci.common.pipeline.NameAndValue;
|
||||
import cd.casic.ci.common.pipeline.enums.DependOnType;
|
||||
import cd.casic.ci.common.pipeline.enums.JobRunCondition;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -19,47 +22,45 @@ import java.util.Map;
|
||||
* @description:Todo
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "job流程控制模型")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class JobControlOption {
|
||||
@Schema(title = "是否启用Job", required = false)
|
||||
private Boolean enable = true; // 是否启用Job
|
||||
|
||||
private Boolean enable = true;
|
||||
@Schema(title = "Job准备环境的超时时间 分钟Minutes", required = false)
|
||||
private Integer prepareTimeout; // Job准备环境的超时时间 分钟Minutes
|
||||
|
||||
private Integer prepareTimeout;
|
||||
@Schema(title = "Job执行的超时时间 分钟Minutes", required = false)
|
||||
private Integer timeout = 900; // Job执行的超时时间 分钟Minutes
|
||||
|
||||
private Integer timeout = 900;
|
||||
@Schema(title = "新的Job执行的超时时间,支持变量 分钟Minutes,出错则取timeout的值", required = false)
|
||||
private String timeoutVar; // Job执行的超时时间 分钟Minutes
|
||||
|
||||
private String timeoutVar;
|
||||
@Schema(title = "运行条件", required = false)
|
||||
private JobRunCondition runCondition = JobRunCondition.STAGE_RUNNING; // 运行条件
|
||||
|
||||
private JobRunCondition runCondition = JobRunCondition.STAGE_RUNNING;
|
||||
@Schema(title = "自定义变量", required = false)
|
||||
private List<NameAndValue> customVariables = List.of(); // 自定义变量
|
||||
|
||||
private List<NameAndValue> customVariables = List.of();
|
||||
@Schema(title = "自定义条件", required = false)
|
||||
private String customCondition; // 自定义条件
|
||||
|
||||
private String customCondition;
|
||||
@Schema(title = "job依赖", required = false)
|
||||
private DependOnType dependOnType; // job依赖
|
||||
|
||||
private DependOnType dependOnType;
|
||||
@Schema(title = "需要过滤不存在的job,定义为var类型", required = false)
|
||||
private List<String> dependOnId; // 需要过滤不存在的job,定义为var类型
|
||||
|
||||
private List<String> dependOnId;
|
||||
@Schema(title = "job依赖名称", required = false)
|
||||
private String dependOnName;
|
||||
|
||||
@Schema(title = "containerId与jobId映射,depend on运行时使用的是containerId", required = false)
|
||||
private Map<String, String> dependOnContainerId2JobIds; // containerId与jobId映射,depend on运行时使用的是containerId
|
||||
|
||||
private Map<String, String> dependOnContainerId2JobIds;
|
||||
@Schema(title = "是否失败继续", required = false)
|
||||
private Boolean continueWhenFailed = false; // 失败继续
|
||||
|
||||
private Boolean continueWhenFailed = false;
|
||||
@Schema(title = "第三方构建机集群-单节点并发限制")
|
||||
private Integer singleNodeConcurrency;
|
||||
|
||||
@Schema(title = "第三方构建机集群-所有节点并发限制")
|
||||
private Integer allNodeConcurrency;
|
||||
|
||||
public JobControlOption(boolean enable, Integer maxRunningMinutes, String s, JobRunCondition jobRunCondition, List<NameAndValue> conditions) {
|
||||
this.enable = enable;
|
||||
this.prepareTimeout = maxRunningMinutes;
|
||||
this.runCondition = jobRunCondition;
|
||||
this.customVariables = conditions;
|
||||
|
||||
}
|
||||
}
|
@ -1,14 +1,12 @@
|
||||
package cd.casic.ci.common.pipeline.option;
|
||||
|
||||
import cd.casic.ci.common.pipeline.matrix.DispatchInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author:mianbin
|
||||
@ -24,7 +22,7 @@ import java.util.stream.Collectors;
|
||||
public class MatrixControlOption {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Pattern MATRIX_JSON_KEY_PATTERN = Pattern.compile("^(fromJSON\\()([^(^)]+)[\\)]\$");
|
||||
private static final Pattern MATRIX_JSON_KEY_PATTERN = Pattern.compile("^(fromJSON\\()([^)]+)\\)$");
|
||||
private static final Logger logger = LoggerFactory.getLogger(MatrixControlOption.class);
|
||||
private static final int MATRIX_CASE_MAX_COUNT = 256;
|
||||
|
@ -2,6 +2,7 @@ package cd.casic.ci.common.pipeline.option;
|
||||
|
||||
import cd.casic.ci.common.pipeline.NameAndValue;
|
||||
import cd.casic.ci.common.pipeline.enums.StageRunCondition;
|
||||
import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -32,26 +33,32 @@ public class StageControlOption {
|
||||
private String customCondition; // 自定义条件
|
||||
|
||||
@Schema(title = "是否人工触发", required = false)
|
||||
@Deprecated("被StagePauseCheck.manualTrigger代替")
|
||||
@Deprecated
|
||||
//"被StagePauseCheck.manualTrigger代替"
|
||||
private Boolean manualTrigger = false;
|
||||
|
||||
@Schema(title = "可触发用户,支持引用变量", required = false)
|
||||
@Deprecated("被StagePauseCheck.reviewGroups代替")
|
||||
@Deprecated
|
||||
//"被StagePauseCheck.reviewGroups代替"
|
||||
private List<String> triggerUsers; // 可触发用户,支持引用变量
|
||||
|
||||
@Schema(title = "已通过审核", required = false)
|
||||
@Deprecated("被StagePauseCheck.status代替")
|
||||
@Deprecated
|
||||
//"被StagePauseCheck.status代替"
|
||||
private Boolean triggered; // 已通过审核
|
||||
|
||||
@Schema(title = "等待审核的超时时间", required = false)
|
||||
@Deprecated("被StagePauseCheck.timeout代替")
|
||||
@Deprecated
|
||||
//"被StagePauseCheck.timeout代替"
|
||||
private Integer timeout; // 等待审核的超时时间
|
||||
|
||||
@Schema(title = "审核变量", required = false)
|
||||
@Deprecated("被StagePauseCheck.reviewParams代替")
|
||||
@Deprecated
|
||||
//"被StagePauseCheck.reviewParams代替"
|
||||
private List<ManualReviewParam> reviewParams; // 审核变量
|
||||
|
||||
@Schema(title = "审核说明", required = false)
|
||||
@Deprecated("被StagePauseCheck.reviewDesc代替")
|
||||
@Deprecated
|
||||
//"被StagePauseCheck.reviewDesc代替"
|
||||
private String reviewDesc; // 审核说明
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cd.casic.ci.common.pipeline.pojo;
|
||||
|
||||
import cd.casic.ci.common.pipeline.type.BuildType;
|
||||
import cn.hutool.http.useragent.OS;
|
||||
import lombok.Data;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user