k6 icon indicating copy to clipboard operation
k6 copied to clipboard

ci: VERSION_DETAILS does not contain the latest tag

Open codebien opened this issue 1 year ago • 7 comments

During the build the new tag hasn't been picked from the git describe command, in this way the k6 version prints an older tag. It isn't a critical bug because all the important information like the date or the commit hash are correct.

The issue could be related to the GitHub checkout action that doesn't fetch for a strange reason the latest created tag.

k6 version
k6 v0.40.0 (2022-09-08T09:06:02+0000/v0.39.0-92-gdcbe2f9c, go1.18.6, linux/amd64)

Current

v0.39.0-92-gdcbe2f9c

Expected

v0.40.0-0-gdcbe2f9c

codebien avatar Sep 08 '22 13:09 codebien

Potentially relevant issues: https://github.com/actions/checkout/issues/882, https://github.com/actions/checkout/issues/701

na-- avatar Sep 08 '22 13:09 na--

Decided to dig this a little deeper and we can actually see all of the git actions that were executed by the v0.40.0 build :tada: And this seems like the reason for the problem to me: https://github.com/grafana/k6/runs/8245641202?check_suite_focus=true#step:2:620

In case that log disappears, I'll post the raw logs and a screenshot here as well: logs v0.40.0-build.log

na-- avatar Sep 09 '22 12:09 na--

The question is, why was this not a problem in previous builds and became a problem for v0.40.0? :thinking: I assume I broke something with the (now notorious) https://github.com/grafana/k6/pull/2591, but I am not sure exactly what... :confused:

na-- avatar Sep 09 '22 12:09 na--

Was this same command executed in the previous releases? Or did something change in the github-action, maybe outside the changes in our workflow?

mstoykov avatar Sep 09 '22 12:09 mstoykov

I can guess that it's broken since, for the version details, we don't pass the --tags (https://git-scm.com/docs/git-describe#Documentation/git-describe.txt---tags) like we do for the Version.

https://github.com/grafana/k6/blob/3e88e18166d90ddf5ca395a6e07b47cb221255c0/build-release.sh#L10 vs. https://github.com/grafana/k6/blob/3e88e18166d90ddf5ca395a6e07b47cb221255c0/build-release.sh#L13

olegbespalov avatar Sep 16 '22 13:09 olegbespalov

:man_facepalming: Yeah, that is probably it...

na-- avatar Sep 16 '22 13:09 na--

@olegbespalov tried it in a private repo and the lack of --tags turned out to be the problem indeed.

na-- avatar Sep 16 '22 15:09 na--