Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

security: replace vulnerable parse-duration with CJS compatible ms library#960

Merged
aabmass merged 2 commits intogoogleapis:mainfrom
aabmass:parseduration-to-ms
Apr 9, 2025
Merged

security: replace vulnerable parse-duration with CJS compatible ms library#960
aabmass merged 2 commits intogoogleapis:mainfrom
aabmass:parseduration-to-ms

Conversation

@aabmass
Copy link
Copy Markdown
Contributor

@aabmass aabmass commented Apr 9, 2025

Fixes #953

Replace parse-duration with ms, which provides ESM and CJS builds.

BEGIN_COMMIT_OVERRIDE
fix: replace vulnerable parse-duration with CJS compatible ms library
END_COMMIT_OVERRIDE

@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: cloudprofiler Issues related to the googleapis/cloud-profiler-nodejs API. labels Apr 9, 2025
Comment thread src/profiler.ts
return undefined;
}

/**
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.

This is dead code which was missed in #402

@aabmass aabmass force-pushed the parseduration-to-ms branch 2 times, most recently from a0c7f7a to f28722c Compare April 9, 2025 03:26
Comment thread src/profiler.ts
@aabmass aabmass force-pushed the parseduration-to-ms branch from f28722c to 8ac9384 Compare April 9, 2025 14:14
@aabmass aabmass marked this pull request as ready for review April 9, 2025 14:15
@aabmass aabmass requested review from a team April 9, 2025 14:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Project coverage is 70.15%. Comparing base (c057bf1) to head (20be18e).
Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
src/profiler.ts 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
+ Coverage   69.50%   70.15%   +0.64%     
==========================================
  Files           7        7              
  Lines        1256     1243      -13     
  Branches       48       49       +1     
==========================================
- Hits          873      872       -1     
+ Misses        382      370      -12     
  Partials        1        1              

☔ 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.

Comment thread src/profiler.ts
Comment thread test/test-profiler.ts
}
);
});
describe('parseBackoffDuration', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are these tests no longer necessary?

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.

I removed the tested function which was dead code missed in #402

@aabmass aabmass enabled auto-merge (squash) April 9, 2025 14:49
Comment thread src/config.ts
@aabmass aabmass merged commit ef0f58c into googleapis:main Apr 9, 2025
16 of 17 checks passed
@aabmass aabmass deleted the parseduration-to-ms branch April 9, 2025 15:18
@aabmass
Copy link
Copy Markdown
Contributor Author

aabmass commented Apr 9, 2025

I'm not sure why codecov is complaining since there are tests covering this code which break if I introduce a bug.

@aabmass aabmass added the release-please:force-run To run release-please label Apr 9, 2025
@release-please release-please Bot removed the release-please:force-run To run release-please label Apr 9, 2025
@aabmass aabmass added the release-please:force-run To run release-please label Apr 9, 2025
@release-please release-please Bot removed the release-please:force-run To run release-please label Apr 9, 2025
@aabmass aabmass added the release-please:force-run To run release-please label Apr 9, 2025
@release-please release-please Bot removed the release-please:force-run To run release-please label Apr 9, 2025
@aabmass aabmass added the release-please:force-run To run release-please label Apr 14, 2025
@release-please release-please Bot removed the release-please:force-run To run release-please label Apr 14, 2025
@aabmass aabmass added the release-please:force-run To run release-please label Apr 14, 2025
@release-please release-please Bot removed the release-please:force-run To run release-please label Apr 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: cloudprofiler Issues related to the googleapis/cloud-profiler-nodejs API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump parse-duration to >=2.1.3

3 participants