grafana / k6-jslib-aws

Javascript Library allowing to interact with AWS resources from k6 scripts
Apache License 2.0
18 stars 28 forks source link

Switch from 'build' to 'dist' #92

Closed joanlopez closed 6 months ago

joanlopez commented 6 months ago

It replaces build with dist, as suggested by @oleiade, as the latter is more popular and widely used.

It also adds a check in the main pipeline, to guarantee that the main branch always has an up-to-date and consistent build within the dist directory, which works in combination with https://github.com/grafana/k6-jslib-aws/pull/90, where a change was introduced to make enforce the Webpack version, for the sake of reproducibility.

Thanks!

joanlopez commented 6 months ago

I still think that it's better not to keep builds under the source control and keep only the releases, and one of the reasons why I pushed back on that was that it could break users' workflows. This renaming could also hypothetically do the same thing, hopefully with a straight migration.

Honestly, I don't have strong preferences either, but it's true after a quick search I realized dist is actually way more popular.

Regarding the users' workflows, I think this is just an intermediate step, and the biggest benefit I see from it is that at least it ensures consistency on the build. I hope all this will become simpler as soon as we start putting some automation in place. For instance, having the release workflow now it's one step further towards there.

In an ideal world, I'd also prefer to keep builds outside of the versioned control. In fact, I'd also prefer to re-evaluate that need in the (near?) future, and if we actually need that, explore other options (for instance, could we push the artifacts from every build somewhere usable for users? similar to latest or master tags with Docker images or NPM libraries). That of course would be breaking in some way as well, but honestly I don't care that much about how breaking is changing the output directory, while we keep the possibility for users to keep using whatever is in main to be imported and used directly, which I guess is the main goal for keeping the build version controlled, at least as soon as we don't have releases more automated and we keep new features or bug fixes not unreleased from time to time.