Skip to content

chore: replace secrets in test cases with constants - #4133

Merged
koladilip merged 10 commits into
developfrom
chore.mask-secrets-in-headers
Mar 6, 2025
Merged

koladilip merged 10 commits into
developfrom
chore.mask-secrets-in-headers

Conversation

@vinayteki95

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

  • Added a script in /test/scripts to scan through destination tests and replace with constants while placing the secrets in seperate maskedSecrets.ts files.
  • Upon running the above script, a lot of destination test cases are updated with this variables replacing hard coded secrets.

What is the related Linear task?

Resolves INT-3330

Please explain the objectives of your changes below

SonarCloud raises 5000+ security issues in transformer repo. One of the reasons for this issue is hardcoded (albeit dummy) secrets in test cases.
Although this is not a severe security concern, it gets difficult to wade all the noise and find P0 security issues which might've been raised by sonarcloud.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

No

Any new dependencies introduced with this change?

No

Any new generic utility introduced or modified. Please explain the changes.

Script to replace secrets in test files.

Any technical or performance related pointers to consider with the change?

No

@coderabbitai review


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

@vinayteki95
vinayteki95 requested a review from a team March 3, 2025 14:19

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@codecov

codecov Bot commented Mar 3, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.34%. Comparing base (cdee5e0) to head (acf5553).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4133      +/-   ##
===========================================
+ Coverage    91.21%   91.34%   +0.12%     
===========================================
  Files          631      630       -1     
  Lines        33084    33041      -43     
  Branches      7827     7809      -18     
===========================================
+ Hits         30178    30180       +2     
+ Misses        2690     2655      -35     
+ Partials       216      206      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@vinayteki95
vinayteki95 force-pushed the chore.mask-secrets-in-headers branch from f30c79e to de8d65f Compare March 3, 2025 14:40
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@koladilip
koladilip requested review from a team as code owners March 5, 2025 08:17
@koladilip

Copy link
Copy Markdown
Contributor

Quality Gate Failed Quality Gate failed

Failed conditions 0.0% Coverage on New Code (required ≥ 80%) 26.1% Duplication on New Code (required ≤ 15%)

See analysis details on SonarQube Cloud

we will delete these files mostly not needed, but will do that later

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

utsabc
utsabc previously approved these changes Mar 5, 2025
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

@sonarqubecloud

sonarqubecloud Bot commented Mar 5, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
25.0% Duplication on New Code (required ≤ 15%)

See analysis details on SonarQube Cloud

@koladilip
koladilip merged commit 2163357 into develop Mar 6, 2025
@koladilip
koladilip deleted the chore.mask-secrets-in-headers branch March 6, 2025 06:13
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.

6 participants