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

Set version from runtime build info #265

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Set version from runtime build info #265

merged 2 commits into from
Jul 28, 2023

Conversation

pablochacin
Copy link
Collaborator

Description

Use runtime information when setting the disruptor version that is used to identify the version of the agent image.
This is required to support building custom k6 images that use a specific version of the disruptor:

xk6 build --with github.com/grafana/xk6-disruptor=github.com/grafana/xk6-disruptor@vx.y.z 

Fixes #263

Checklist:

  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make test) and all tests pass.
  • I have run relevant e2e test locally (make e2e-xxx for agent, disruptors, kubernetes or cluster related changes)
  • Any dependent changes have been merged and published in downstream modules

@pablochacin pablochacin requested a review from nadiamoe July 25, 2023 17:10
Copy link
Member

@nadiamoe nadiamoe left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

Seems like windows build is failing though.

@pablochacin
Copy link
Collaborator Author

Seems like windows build is failing though.

Yes, it is because the windows build tool doesn't support versions that are not strictly numeric (e.g. v0.3.5) and fails with something like v0.3.5-rc1 which I used for testing.

Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@pablochacin
Copy link
Collaborator Author

@roobre I did some more testing and realized the solution I had proposed did not really fix the issue. So I reimplemented the logic for getting the version at runtime based on how the k6 version command does it.

@pablochacin pablochacin requested a review from nadiamoe July 27, 2023 10:45
Copy link
Member

@nadiamoe nadiamoe left a comment

Choose a reason for hiding this comment

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

Interesting, so I suppose debug.ReadBuildInfo before was reading the k6 core version rather than the disruptor version, right?

lgtm

@pablochacin pablochacin merged commit 1d5cf39 into main Jul 28, 2023
@pablochacin pablochacin deleted the set-build-version branch July 28, 2023 09:52
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.

Custom builds from a release break version synchronization between extension and agent
2 participants