-
Notifications
You must be signed in to change notification settings - Fork 201
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: sentry error object and release management #2364
Conversation
|
WalkthroughThe recent update enriches the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
PR Description updated to latest commit (659104b) |
PR Review 🔍
Code feedback:
|
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- .github/workflows/publish-workflows-service.yml (4 hunks)
- services/workflows-service/Dockerfile (2 hunks)
- services/workflows-service/src/common/utils/request-response/request.ts (1 hunks)
- services/workflows-service/src/errors.ts (1 hunks)
- services/workflows-service/src/sentry/sentry.module.ts (3 hunks)
- services/workflows-service/src/sentry/sentry.service.ts (1 hunks)
Additional comments not posted (5)
services/workflows-service/Dockerfile (1)
26-29
: The changes in the production stage mirror those in the development stage, ensuring consistency across builds. This is good practice as it maintains uniformity and traceability of builds usingSHORT_SHA
.services/workflows-service/src/common/utils/request-response/request.ts (1)
30-30
: Adding thebody
field to the metadata object can enrich logging and debugging capabilities. Ensure that sensitive data is not logged unintentionally, especially ifbody
contains user inputs or PII.Verification successful
The logging of the
body
field found in the fileend-user.controller.external.intg.test.ts
is part of an integration test. This does not pose a risk of exposing sensitive data in production environments. Therefore, the addition of thebody
field to the metadata object in the production code is verified to not unintentionally log sensitive data in production logs.
- File:
services/workflows-service/src/end-user/end-user.controller.external.intg.test.ts
- Context: Logging within integration tests, which is generally acceptable and does not impact production security.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that sensitive data is not logged in the `body` field. # Test: Search for logging calls that might include `body`. Expect: No direct logging of `body` or it's sanitized. rg --type typescript $'console.log\\(.*body.*\\)' services/workflows-service/srcLength of output: 114
Script:
#!/bin/bash # Description: Re-verify that sensitive data is not logged in the `body` field. # Correcting the previous script to search for logging calls in TypeScript files by specifying file extensions. rg 'console.log\(.*body.*\)' --glob '*.ts' services/workflows-service/srcLength of output: 193
services/workflows-service/src/sentry/sentry.service.ts (1)
24-25
: Adding detailed error information in the Sentry scope can significantly improve the debugging process. Ensure that no sensitive information is inadvertently exposed through error details.services/workflows-service/src/sentry/sentry.module.ts (1)
Line range hint
24-45
: The addition of_dist
initialized withSHORT_SHA
and its inclusion in Sentry's initialization enhances traceability of errors by linking them to specific builds. This is a valuable improvement for debugging and release management.services/workflows-service/src/errors.ts (1)
63-63
: Changing the source of errors in thegetErrors
method to the response object can help align error handling with external modifications or standards. Ensure that the response object is always properly formatted to avoid runtime errors.
https://github.com/ballerine-io/ballerine/actions/runs/9049161597 @alonp99 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- services/workflows-service/src/errors.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- services/workflows-service/src/errors.ts
PR Type
enhancement, bug_fix
Description
request.ts
for better request tracking.ValidationError
inerrors.ts
to use the response object directly, removing unnecessary properties.sentry.module.ts
to include distribution version (_dist
) in its setup.SHORT_SHA
for better traceability of builds.Changes walkthrough 📝
request.ts
Include request body in metadata object
services/workflows-service/src/common/utils/request-response/request.ts
body
to the metadata object returned bygetReqMetadataObj
.errors.ts
Refactor ValidationError to use response object directly
services/workflows-service/src/errors.ts
errors
property fromValidationError
.getErrors
to retrieve errors directly from the responseobject.
sentry.module.ts
Extend Sentry module with distribution version management
services/workflows-service/src/sentry/sentry.module.ts
_dist
property to manage distribution version.dist
in Sentry configuration setup.sentry.service.ts
Improve error logging in Sentry service
services/workflows-service/src/sentry/sentry.service.ts
error
object to Sentry scope.Dockerfile
Include SHORT_SHA in Dockerfile for build reproducibility
services/workflows-service/Dockerfile
SHORT_SHA
argument and environment variable to Dockerfile forboth development and production stages.
publish-workflows-service.yml
Update CI/CD workflows for enhanced deployment and security scanning
.github/workflows/publish-workflows-service.yml
scenarios.
Summary by CodeRabbit
New Features
Bug Fixes
getErrors
method in theValidationError
class for accurate error retrieval.Refactor
getReqMetadataObj
function to include thebody
field for improved metadata handling in requests.captureHttpException
method.Chores
SHORT_SHA
andRELEASE
arguments for better traceability.