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

feat(bpdm-gate): Extend error states #985

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1b5e887
feat: Adding extend error states
kunyao-cofinity-x Jul 2, 2024
9600d6a
feat: Adding logic to TaskResolutionService handling conditions
kunyao-cofinity-x Jul 2, 2024
cb2a888
fix: providing alternative address to orchestrator
nicoprow Jul 3, 2024
b02caa5
docs(CHANGLEOG): update changelog for version 6.0.2 changes
nicoprow Jul 3, 2024
daaafc5
Merge pull request #987 from eclipse-tractusx/fix/gate-task-alt-add
nicoprow Jul 5, 2024
d8901ee
fix(gate): sending business partner data to the golden record service…
nicoprow Jul 5, 2024
1f15ba8
Merge pull request #988 from eclipse-tractusx/fix/gate/input-ready
nicoprow Jul 5, 2024
e4cc1be
fix(gate): sharing states sometimes taking the wrong task id from the…
nicoprow Jul 5, 2024
77e40e8
build(dep): increase tomcat-embed-core dependency version
nicoprow Jul 8, 2024
a0a289a
Merge pull request #992 from eclipse-tractusx/build/tomcat-core
nicoprow Jul 8, 2024
5ea8c20
Merge pull request #989 from eclipse-tractusx/fix/gate/wrong-task-ids
SujitMBRDI Jul 8, 2024
da24adf
feat(bpdm-gate): updated upload partner process to only process site …
SujitMBRDI Jun 27, 2024
201db14
Merge pull request #980 from SujitMBRDI/feat/update_partner_upload_en…
SujitMBRDI Jul 8, 2024
069c5c0
ci(Linting): check version increment only if the chart version is a r…
nicoprow Jul 9, 2024
f6fe478
Merge pull request #995 from eclipse-tractusx/ci/lint-on-release
nicoprow Jul 9, 2024
041f856
ci(Release Chart): fix check for Chart release version
nicoprow Jul 10, 2024
cff1eb6
Merge pull request #997 from eclipse-tractusx/ci/chart-release-check-fix
nicoprow Jul 10, 2024
95de3fe
feat(Charts): add value to delay the startup of BPDM application cont…
nicoprow Jul 10, 2024
b2e0a9f
feat(bpdm-gate): Extend error states
kunyao-cofinity-x Jul 10, 2024
6299ee8
Merge pull request #998 from eclipse-tractusx/feat/chart/uptime-delay
nicoprow Jul 11, 2024
0febf9f
feat(Orchestrator): add persistence layer
nicoprow Jul 9, 2024
879381a
Merge pull request #990 from eclipse-tractusx/feat/orch-persistence-jpa
SujitMBRDI Jul 11, 2024
86c2581
feat: add gate record ID for tasks to identify tasks for the same gat…
nicoprow Jul 8, 2024
8af4933
Merge pull request #991 from eclipse-tractusx/feat/orch-record-id
nicoprow Jul 12, 2024
e344002
build(version): increase BPDM app version to 6.1.0 and charts version…
nicoprow Jul 15, 2024
bedcf07
Merge pull request #999 from eclipse-tractusx/build/version/6.1.0
nicoprow Jul 15, 2024
cb624c8
feat(bpdm-gate): Extend error code with description
kunyao-cofinity-x Jul 15, 2024
fa24b9c
feat: Adding extend error states
kunyao-cofinity-x Jul 2, 2024
0311826
feat: Adding logic to TaskResolutionService handling conditions
kunyao-cofinity-x Jul 2, 2024
2e2b7ab
feat(bpdm-gate): Extend error states
kunyao-cofinity-x Jul 10, 2024
a86e382
feat(bpdm-gate): Extend error code with description
kunyao-cofinity-x Jul 15, 2024
ff2863d
feat(bpdm-gate): Extend error code with description. Extend error cod…
kunyao-cofinity-x Jul 16, 2024
e514159
Revert "feat(bpdm-gate): Extend error code with description. Extend e…
kunyao-cofinity-x Jul 16, 2024
879d878
feat(bpdm-gate): Extend error code with description. Extend error cod…
kunyao-cofinity-x Jul 16, 2024
3fdff66
Merge branch 'feat/Extend-error-states' of github.com:kunyao-cofinity…
kunyao-cofinity-x Jul 16, 2024
ac3cc8a
# This is a combination of 8 commits.
kunyao-cofinity-x Jul 2, 2024
80d20bb
feat(bpdm-gate): resolve changes
kunyao-cofinity-x Jul 18, 2024
04e5cd9
parent 80d20bb61bfb171360d3312781a70a7b5783fe70
kunyao-cofinity-x Jul 18, 2024
a0394c8
Merge branch 'feat/Extend-error-states' of github.com:kunyao-cofinity…
kunyao-cofinity-x Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ enum class BusinessPartnerSharingError : ErrorCode {
SharingTimeout,
BpnNotInPool,
MissingTaskID,
NaturalPersonError,
BpnErrorMissingParent,
BpnErrorNotFound,
BpnErrorTooManyOptions,
MandatoryFieldValidationFailed,
BlacklistCountryPresent,
InvalidSpecialCharacters,
MandatoryFieldMissing,
BpnlChanged,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not an error code but a comment or success state which we currently do not support in the orchestrator

UnclearEntity,
UnknownSpecialCharacters,
MatchBasedOnProvidedNameOrIdentifier
Copy link
Contributor

Choose a reason for hiding this comment

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

Also success state here

Copy link
Author

Choose a reason for hiding this comment

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

re-added the error codes based on the discussion

}

enum class ChangeLogOutputError : ErrorCode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,67 @@ class TaskResolutionService(
BusinessPartnerSharingError.SharingProcessError,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.NaturalPersonError -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.NaturalPersonError,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.BpnErrorMissingParent -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.BpnErrorMissingParent,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.BpnErrorNotFound -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.BpnErrorNotFound,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.BpnErrorTooManyOptions -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.BpnErrorTooManyOptions,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.MandatoryFieldValidationFailed -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.MandatoryFieldValidationFailed,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.BlacklistCountryPresent -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.BlacklistCountryPresent,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.InvalidSpecialCharacters -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.InvalidSpecialCharacters,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.MandatoryFieldMissing -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.MandatoryFieldMissing,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.BpnlChanged -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.BpnlChanged,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.UnclearEntity -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.UnclearEntity,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.UnknownSpecialCharacters -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.UnknownSpecialCharacters,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
)
ResultState.MatchBasedOnProvidedNameOrIdentifier -> RequestCreationResult.error(
sharingState,
BusinessPartnerSharingError.MatchBasedOnProvidedNameOrIdentifier,
if (task.processingState.errors.isNotEmpty()) task.processingState.errors.joinToString(" // ") { it.description }.take(255) else null
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks unnecessarily verbose. Currently, the Gate's sharing state only has up to one error it can display. I would propose to use the generic SharingProcessError type if there are several errors, just like it is currently done. And if there is only one error we can save the more specific error here.

For this I would then use a when-clause mapping from Task error type to Gate error and then map to a RequestCreationResult afterwards.

Proposal somethind like this

fun handleError(...) : RequestCreatinResult{
 if(errors.size == 1){
   when(taskErrorType){
       UnkownSpecialCharacters -> GateErrorType.UnknownSpecialCharacters
       ...
   }.map{ gatErrorType -> RequestCreationResult.erro(...)   }
 }else{
  RequestCreationResult.error(...) like before
 }
}

)

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,17 @@ package org.eclipse.tractusx.orchestrator.api.model
enum class ResultState {
Pending,
Success,
Error
Error,
NaturalPersonError,
BpnErrorMissingParent,
BpnErrorNotFound,
BpnErrorTooManyOptions,
MandatoryFieldValidationFailed,
BlacklistCountryPresent,
InvalidSpecialCharacters,
MandatoryFieldMissing,
BpnlChanged,
UnclearEntity,
UnknownSpecialCharacters,
MatchBasedOnProvidedNameOrIdentifier
Copy link
Contributor

Choose a reason for hiding this comment

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

Result state indicate a high-level distinction between success, error and in-progress. This is not the place to put specific error types. For this, you can use the TaskErrorType in the same package

}