Skip to content

fix: update default error code to 500 - #2129

Merged
utsabc merged 4 commits into
release/v1.27.0from
fix.response-code
May 9, 2023
Merged

utsabc merged 4 commits into
release/v1.27.0from
fix.response-code

Conversation

@utsabc

@utsabc utsabc commented May 7, 2023 •

Copy link
Copy Markdown
Contributor

Update the default error code to 500

The intention of this PR is to address the default error code returned by transformer to server is retryable if not specifically set by developer. This helps to treat any system error by transformer as internal server error from server and prevent event loss

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@utsabc
utsabc requested a review from a team as a code owner May 7, 2023 13:11
@codecov

codecov Bot commented May 7, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (a0f9ae9) 87.89% compared to head (4abf65a) 87.93%.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           release/v1.27.0    #2129      +/-   ##
===================================================
+ Coverage            87.89%   87.93%   +0.03%     
===================================================
  Files                  509      510       +1     
  Lines                25783    25802      +19     
  Branches              6383     6389       +6     
===================================================
+ Hits                 22663    22689      +26     
+ Misses                2787     2781       -6     
+ Partials               333      332       -1     
Impacted Files Coverage Δ
src/v0/util/index.js 85.33% <100.00%> (ø)

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@utsabc
utsabc requested a review from a team May 7, 2023 13:20
@utsabc
utsabc requested review from lvrach and sivashanmukh as code owners May 7, 2023 13:20
Comment thread package.json Resolved
Comment thread src/v0/util/index.js
* @returns {Number}
*/
const getErrorStatusCode = (error, defaultStatusCode = 400) => {
const getErrorStatusCode = (error, defaultStatusCode = 500) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's create a constant for the default status code and use it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will address this later once the other PR is merged

@saikumarrs saikumarrs May 10, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's hardly a two-minute job.
Nevertheless, please create a new task card or add this to the scope of any open tasks. Resolve this conversation after.
CC @krishna2020

@utsabc
utsabc changed the base branch from develop to release/v1.27.0 May 9, 2023 16:18
@sonarqubecloud

sonarqubecloud Bot commented May 9, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@utsabc
utsabc merged commit 81a83d9 into release/v1.27.0 May 9, 2023
@chandumlg
chandumlg deleted the fix.response-code branch May 9, 2023 16:28
saikumarrs added a commit that referenced this pull request May 10, 2023
* chore(cicd): replace local with gha cache in build steps (#2128)

* chore(cicd): replace local with gha cache in build steps

* fix: add missing file

* fix: remove redundant parts in workflow files

* chore: empty commit to trigger actions

* chore: upgrade checkout action version to latest

* chore: turnoff lint rule

* fix: snyk issues fix (#2136)

* fix: package.json & package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-XML2JS-5414874

* fix: upgrade @aws-sdk/client-s3 from 3.295.0 to 3.306.0

Snyk has created this PR to upgrade @aws-sdk/client-s3 from 3.295.0 to 3.306.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-s3

See this project in Snyk:
https://app.snyk.io/org/rudder-integrations/project/a862a698-0e7a-46bd-8897-5dda3e28b3c6?utm_source=github&utm_medium=referral&page=upgrade-pr

* chore: upgrading aws-sdk/lib-storage version

---------

Co-authored-by: snyk-bot <[email protected]>

* feat: braze merge users (#2135)

* feat: braze merge users (#2135)

* chore: fix sending secrets to reusable workflows (#2147)

* feat: onboard new source formsort (#2120)

* formsort: onboarding new source

* feat: onboard formsort source

* update formsort file structure

* chore: comments addressed

---------

Co-authored-by: Saurav Lal <[email protected]>
Co-authored-by: Saurav Lal <[email protected]>
Co-authored-by: Mihir Bhalala <[email protected]>

* fix: undefined errors in braze, firehose, gaoc (#2139)

* fix: undefined errors in braze, firehose, gaoc

* fix: address comments

* fix: add retryable error support

* fix: 429 and event as a string, address comments

* fix: products is an array check before iterating

* chore: add tests, use native isArray

* chore: fix cases

* feat(ga4): common page call information(page, url, title) support in track call (#2141)

* chore(release): 1.27.0

* fix: update default error code to 500 (#2129)

* fix: update default error code to 500

* fix: update test cases

* chore: fix package.json

* fix: check event properties without making them to lower case (#2150)

---------

Co-authored-by: Sai Kumar Battinoju <[email protected]>
Co-authored-by: saikumarrs <[email protected]>
Co-authored-by: shrouti1507 <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: AASHISH MALIK <[email protected]>
Co-authored-by: Anant Jain <[email protected]>
Co-authored-by: Saurav Lal <[email protected]>
Co-authored-by: Saurav Lal <[email protected]>
Co-authored-by: Mihir Bhalala <[email protected]>
Co-authored-by: Yashasvi Bajpai <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Utsab Chowdhury <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
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.

3 participants