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

Update project's dependencies to latest compatible versions #111

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Jul 29, 2024

In this PR, we update the project's dependencies to their latest compatible versions. This was overdue.
As we update to a much more recent version of k6, we also take this opportunity to switch to using WebCrypto's crypto.RandomUUID in the secrets manager too.

@oleiade oleiade added the dependencies Pull requests that update a dependency file label Jul 29, 2024
@oleiade oleiade self-assigned this Jul 29, 2024
@oleiade oleiade requested a review from a team as a code owner July 29, 2024 10:10
@oleiade oleiade requested review from mstoykov, joanlopez and codebien and removed request for a team and mstoykov July 29, 2024 10:10
Copy link
Contributor

@codebien codebien left a comment

Choose a reason for hiding this comment

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

LGTM

src/internal/secrets-manager.ts Outdated Show resolved Hide resolved
@oleiade oleiade force-pushed the dependency_updates branch from d696e2c to ae53929 Compare July 29, 2024 13:00
@oleiade oleiade force-pushed the dependency_updates branch from ae53929 to c6bf07b Compare July 29, 2024 13:01

import { v4 as uuidv4 } from 'uuid'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I'm getting what's the problem with this dependency. Can we just keep it without applying the change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apologies, I should have been more explicit about this specifically 🙇🏻

So far, k6-jslib-aws relied on the uuid package to generate uuids. We were using version 3.4.0, which is quite old, but had the advantage of not relying on node's crypto.getRandomValues API. This version is now deprecated, and the newer versions (from 7.0.0, to 10.0.0) all rely on the node API exclusively (as far as I can tell), meaning we can't rely on it in a k6 context anymore.

Hence, switching to k6-utils instead. (Which coincidentally makes me realize there is a secure flag to activate to use a cryptographic random source instead)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation @oleiade, all clear now! Looks great! 👍🏻

@oleiade oleiade force-pushed the dependency_updates branch from c6bf07b to f2b00ee Compare July 29, 2024 13:24
The uuid version we use to rely upon (3.4.0) is now marked as deprecated.

Newer versions of the package rely on node APIs that are not available
in k6, and as a result, we cannot use it anymore.
@oleiade oleiade merged commit a2560c3 into main Jul 29, 2024
3 checks passed
@oleiade oleiade deleted the dependency_updates branch July 29, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants