dd-trace-java
dd-trace-java copied to clipboard
Update lib-injection docker image tags
What Does This Do
Adds vMAJOR and vMAJOR.MINOR lib-injection images (in addition to vMAJOR.MINOR.PATCH and latest)
Motivation
We want to enable customers to be able to pin to a major version. We were also incorrectly tagging images as latest when they weren't (only would have happened on hotfixes, so hasn't actually occurred).
We are following (this doc's suggestions), but in summary:
- Prerelease versions are not tagged
- Every non-prerelease release gets the
vMajor.Minor.Patchversion tag2.5.0getsv2.5.02.2.3getsv2.2.31.2.1getsv1.2.1
- Every non-prerelease release gets the
vMajor.Minorversion tag initially (which assumes we never "go back" in release values)2.5.0getsv2.52.2.3getsv2.21.2.1getsv1.2
- Some releases get the
vMajorversion tag. Only releases for which this is the highest version in the major get the tag.2.5.0getsv2(if there's no higher2.x.xrelease)1.2.1getsv1(if there's no higher1.x.xrelease)
- Some releases get the latest tag. Only releases for which this is the highest version ever get the tag.
2.5.0getslatestif it's the highest release so far1.2.1will not getlatestif there's already2.x.xreleases
The logic is now more complicated and requires knowing the state of the git repository. The script shown here mirrors the one added for .NET.
Note we're taking advantage of the Datadog/public-images support for passing multiple csv values in the
IMG_DESTINATIONSvariable. You can see an example of this used in "the wild" here.
Additional Notes
The generation stage is quite verbose about printing out all the variables, but overall this is obviously very hard to test so I set up a dummy GitHub repository and GitLab YAML, which just echoes the values it receives, to confirm they're sent across to the child pipeline correctly.
If it is safe to do so, we can test this by reverting the revert "TESTING" commit
I don't know how backporting or the extra -rc commit tags work, so hopefully someone else could pick that up 😅