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

Feature/3316 error handler orchestrator #3327

Conversation

Machi3mfl
Copy link
Member

Hi Team, This PR added:

common/constants.ts Outdated Show resolved Hide resolved
common/constants.ts Outdated Show resolved Hide resolved
common/utils/logger/logger-service.ts Outdated Show resolved Hide resolved
common/utils/logger/logger-service.ts Outdated Show resolved Hide resolved
@gabiwassan gabiwassan marked this pull request as ready for review June 2, 2021 19:48
@gabiwassan gabiwassan requested a review from frankeros June 2, 2021 19:48
@Machi3mfl Machi3mfl changed the title Feature/3316 error handler orchestator Feature/3316 error handler orchestrator Jun 2, 2021
@gabiwassan gabiwassan requested a review from a team June 3, 2021 18:29
common/constants.ts Outdated Show resolved Hide resolved
public/react-services/logger-service.test.tsx Outdated Show resolved Hide resolved
public/react-services/logger-service.test.tsx Outdated Show resolved Hide resolved
public/react-services/logger-service.tsx Outdated Show resolved Hide resolved
public/react-services/logger-service.tsx Outdated Show resolved Hide resolved
common/constants.ts Outdated Show resolved Hide resolved
@@ -48,6 +48,7 @@
"js2xmlparser": "^3.0.0",
"json2csv": "^4.1.2",
"jwt-decode": "^2.2.0",
"loglevel": "^1.7.1",
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a dependency for this? Will we use some advanced feature that the package offers and we don't want to develop?

Comment on lines 18 to 28
export const errorOrchestratorFactory = (severity: UIErrorSeverity): ErrorOrchestrator => {
switch (severity) {
case UIErrorSeverities.UI:
return new ErrorOrchestratorUI();
case UIErrorSeverities.BUSINESS:
return new ErrorOrchestratorBusiness();
case UIErrorSeverities.CRITICAL:
return new ErrorOrchestratorCritical();
default:
break;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have multiple constructors of loggers depending on severity? Could this be a property/param and use a logger?

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea is that they are independent, that they can be used individually, and thus by extending ErrorOrchestratorBase, they can scale better.
But it is open to suggestions obviously 😃

@gabiwassan gabiwassan merged commit 7fdbe56 into feature/3262-client-side-logging Jun 7, 2021
@gabiwassan gabiwassan deleted the feature/3316-error-handler-orchestator branch June 7, 2021 19:23
gabiwassan added a commit that referenced this pull request Jun 14, 2021
* Feature/3316 error handler orchestrator (#3327)

* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* First attempt LoggerService

* Merged error boundary, integrated loggerService.

* changed logger name, create logger-service test file

* Updated CHANGELOG

* Moved to react-services, changed name, traslates comments

* feat(errorBoundary): Removed old integration

* refactor(loggerService): Changed class for function methods.

* test(logger-service): Added basic unit test to logger-service

* refactor(logger-service): Applied new implementation of error-orchestrator service.

* feature(logger-service): PR comments and some refactors.

Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>

* Added ErrorBoundary HOC and component. (#3321)

* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* feature(errorBoundary): Some refactors

* feat(errorBoundary): PR comments and rollback agent-preview

* doc(changelog): Update changelog

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Refactor props, pr comments.

* feat(errorBoundary): Added unit test for error boundary.

* feat(errorBoundary): Separated error boundary component of hoc

* doc(error-boundary): Fixed and added licenses blocks.

* feature(logger-service): PR comments

* feature(logger-orchestrator): Refactors on management of severity.

* feature(logger-orchestrator): Refactor on wz-blank-screen component.

* feature(logger-orchestrator): Separated prompt component from error-boundary.

* feature(logger-orchestrator): Typo.

* test(error-boundary): Update snapshots.

* test(error-boundary): Update snapshots

* fix(logger-orchestrator): PR comments and refactors, fix unit tests.

* test(error-orchestrator-base): Added simple unit test. Fixed licence block.

* test(error-orchestrator-base): Added simple unit test to ErrorOrchestratorCritical

* test(error-orchestrator-ui): Added simple unit test to ErrorOrchestratorUi

* Create new backend service (#3324)

* Add endpoint

* Create new backend service

* Add changelog

* Renamed constants

* Added interfaces, created new controller and renamed

* Created ui-logged, to prevent logger superclass

* Added types, fixed responses types

* Added new route file to ui-logs, changed method put to post, added in index,ts

* Added test files, we must create all unit tests to those new features

* Fixed if condition

* Rename tests files, created endpoints test

* Changed controller name ui-logs, removed duplicated export

* Fixed file comments

* Applied prettier formater

* Added new base class base-logger

* Remove wrong constants and fix errors

* test(ui-logger-controller): Added simple unit test.

* test(ui-logs-controller): Fix params.

* Added test to ui-logs controller

* Renamed test files

* test(logs-controller): Added mock to function checkFileExist + prettier.

* Solve comments

* Add copyright and remove unused import

Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>

* bugfix(error-orchestrator): Added some improvements and fixes.

* test(ui-logs-controller): Updated unit test.

* fix(error-orchestrator): PR comments

* fix(error-orchestrator): PR comments + prettier.

Co-authored-by: Maximiliano Ibarra <maximilianoaibarra@gmail.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
Co-authored-by: Pablo Martínez <pablo.martinez@wazuh.com>
gabiwassan added a commit that referenced this pull request Jun 14, 2021
* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* First attempt LoggerService

* Merged error boundary, integrated loggerService.

* changed logger name, create logger-service test file

* Updated CHANGELOG

* Moved to react-services, changed name, traslates comments

* feat(errorBoundary): Removed old integration

* refactor(loggerService): Changed class for function methods.

* test(logger-service): Added basic unit test to logger-service

* refactor(logger-service): Applied new implementation of error-orchestrator service.

* feature(logger-service): PR comments and some refactors.

Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
gabiwassan added a commit that referenced this pull request Jun 15, 2021
* Feature/3316 error handler orchestrator (#3327)

* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* First attempt LoggerService

* Merged error boundary, integrated loggerService.

* changed logger name, create logger-service test file

* Updated CHANGELOG

* Moved to react-services, changed name, traslates comments

* feat(errorBoundary): Removed old integration

* refactor(loggerService): Changed class for function methods.

* test(logger-service): Added basic unit test to logger-service

* refactor(logger-service): Applied new implementation of error-orchestrator service.

* feature(logger-service): PR comments and some refactors.

Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>

* Added ErrorBoundary HOC and component. (#3321)

* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* feature(errorBoundary): Some refactors

* feat(errorBoundary): PR comments and rollback agent-preview

* doc(changelog): Update changelog

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Refactor props, pr comments.

* feat(errorBoundary): Added unit test for error boundary.

* feat(errorBoundary): Separated error boundary component of hoc

* doc(error-boundary): Fixed and added licenses blocks.

* feature(logger-service): PR comments

* feature(logger-orchestrator): Refactors on management of severity.

* feature(logger-orchestrator): Refactor on wz-blank-screen component.

* feature(logger-orchestrator): Separated prompt component from error-boundary.

* feature(logger-orchestrator): Typo.

* test(error-boundary): Update snapshots.

* test(error-boundary): Update snapshots

* fix(logger-orchestrator): PR comments and refactors, fix unit tests.

* test(error-orchestrator-base): Added simple unit test. Fixed licence block.

* test(error-orchestrator-base): Added simple unit test to ErrorOrchestratorCritical

* test(error-orchestrator-ui): Added simple unit test to ErrorOrchestratorUi

* Create new backend service (#3324)

* Add endpoint

* Create new backend service

* Add changelog

* Renamed constants

* Added interfaces, created new controller and renamed

* Created ui-logged, to prevent logger superclass

* Added types, fixed responses types

* Added new route file to ui-logs, changed method put to post, added in index,ts

* Added test files, we must create all unit tests to those new features

* Fixed if condition

* Rename tests files, created endpoints test

* Changed controller name ui-logs, removed duplicated export

* Fixed file comments

* Applied prettier formater

* Added new base class base-logger

* Remove wrong constants and fix errors

* test(ui-logger-controller): Added simple unit test.

* test(ui-logs-controller): Fix params.

* Added test to ui-logs controller

* Renamed test files

* test(logs-controller): Added mock to function checkFileExist + prettier.

* Solve comments

* Add copyright and remove unused import

Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>

* bugfix(error-orchestrator): Added some improvements and fixes.

* test(ui-logs-controller): Updated unit test.

* Settings

* Added hoc

* Before rebase

* rebase 4.3-7.10

* Feature/3316 error handler orchestrator (#3327)

* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* First attempt LoggerService

* Merged error boundary, integrated loggerService.

* changed logger name, create logger-service test file

* Updated CHANGELOG

* Moved to react-services, changed name, traslates comments

* feat(errorBoundary): Removed old integration

* refactor(loggerService): Changed class for function methods.

* test(logger-service): Added basic unit test to logger-service

* refactor(logger-service): Applied new implementation of error-orchestrator service.

* feature(logger-service): PR comments and some refactors.

Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>

* Final implementations

* Fix errors and apply prettier

* Added changelog

Co-authored-by: Maximiliano Ibarra <maximilianoaibarra@gmail.com>
Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants