Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pref:完善研发商店组件配置文件参数校验 #11269 #11287

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Kzhou991
Copy link
Collaborator

@Kzhou991 Kzhou991 commented Dec 5, 2024

No description provided.

throw ErrorCodeException(
errorCode = StoreMessageCode.USER_ATOM_OUTPUT_NUM_IS_TOO_MANY,
params = arrayOf(maxOutputNum.toString())
errorCode = StoreMessageCode.USER_ATOM_INPUT_NUM_IS_TOO_MANY,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

错误码怎么一刀切了,原来输出变量个数超了也用输出变量的错误码

@@ -109,6 +109,8 @@
2120935=When the queryProjectComponentFlag, installed, or updateFlag parameters are not empty, the projectCode parameter must be non-empty
2120936=store: Unreleased versions are not allowed to be removed from the shelves
2120937=store: Code library deletion failed, failure reason: {0}

2120043=store: In the plugin configuration file [task.json], the field {0} contains the subfield {1}, which currently only supports {2}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

错误码描述要排列规律,别乱放

)
}
return GetAtomConfigResult("0", arrayOf(""), taskDataMap, atomEnvRequests)

dataMap.values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码看起来只是校验支持的输出类型吧,其他情况根本无需执行吧,建议单独抽出来

private fun <T : Any> validateTaskJsonField(
inputGroupMap: Map<String, Any>,
fieldName: String,
expectedType: KClass<T>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个方法参数你加一个是否必填字段看起来更清晰,必填才需要校验是否非空

)
}
// pref:完善研发商店组件配置文件参数校验 #11269
val supportedLanguages = setOf(JAVA, PYTHON, GOLANG, NODEJS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个和输出变量目前只支持三种类型的逻辑类似,统一封装一个公共方法,别各写各的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants