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

mysql2 - migrate to v3 in tests #2168

Closed
blumamir opened this issue Apr 29, 2024 · 0 comments · Fixed by #2451
Closed

mysql2 - migrate to v3 in tests #2168

blumamir opened this issue Apr 29, 2024 · 0 comments · Fixed by #2451

Comments

@blumamir
Copy link
Member

renovate opened up #2095 to upgrade mysql2 package to a new version 3.

While we only use it for tests, the security warning is not a concern for us, but the tests are not compiling with the new version as a dev dependency:

> @opentelemetry/[email protected] compile
> tsc -p .

test/mysql.test.ts:145:29 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(group: string, connectionUri: string): void', gave the following error.
    Argument of type 'PoolClusterOptions' is not assignable to parameter of type 'string'.
  Overload 2 of 3, '(group: string, config: PoolOptions): void', gave the following error.
    Type 'PoolClusterOptions' has no properties in common with type 'PoolOptions'.

145     poolCluster.add('name', {
                                ~
146       port,
    ~~~~~~~~~~~
... 
150       database,
    ~~~~~~~~~~~~~~~
151     } as mysqlTypes.PoolClusterOptions);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Found 1 error.

npm ERR! Lifecycle script `compile` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: @opentelemetry/[email protected] 
npm ERR!   at location: /Users/amirblum/repos/opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-mysql2 

Not sure how tav is working properly.

In npm, seems that version 3 is the popular version, and v2 has security issues. So it does make sense to use the new version in instrumentation testing by default.

This issue closes #2095 which cannot merge, to track the task of upgrading the dev dependency to a more relevant version

tpraxl added a commit to tpraxl/opentelemetry-js-contrib that referenced this issue Sep 24, 2024
Update mysql2 dependency to latest version (@3.11.3) and fix
tests. Problems during `npm run compile` were fixed by
removing an unsafe and incorrect typecast.
tpraxl added a commit to tpraxl/opentelemetry-js-contrib that referenced this issue Sep 24, 2024
Update mysql2 dependency to latest version (@3.11.3) and fix
tests. Problems during `npm run compile` were fixed by
removing an unsafe and incorrect typecast.

Fixes open-telemetry#2168

Signed-off-by: Thomas Praxl <[email protected]>
blumamir added a commit that referenced this issue Nov 1, 2024
Signed-off-by: Thomas Praxl <[email protected]>
Co-authored-by: Marc Pichler <[email protected]>
Co-authored-by: Amir Blum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant