opentelemetry-collector-releases icon indicating copy to clipboard operation
opentelemetry-collector-releases copied to clipboard

Move package testing to this repository

Open mx-psi opened this issue 8 months ago • 6 comments

We have some package tests on opentelemetry-collector-contrib that should instead live here, since this is where we produce the packages and we do not have a mechanism to keep track of changes to the package scripts or systemd service definitions.

See open-telemetry/opentelemetry-collector-contrib/pull/29286 for context

mx-psi avatar Dec 14 '23 11:12 mx-psi

hey @mx-psi , has this been resolved yet, and would you like for me to give it a go with your guidance of course ?

Enzujp avatar Mar 13 '24 06:03 Enzujp

@Enzujp this has not been resolved. It's probably a bit harder than #498, but I am happy to help if you have specific questions :)

mx-psi avatar Mar 13 '24 11:03 mx-psi

Hii @mx-psi , @ so I've gone through conversations from https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/29286 and, through the buildscripts dir . Moving package testing to this repository would require making edits to almost all individual files within buildscripts since most of its configurations are set to the opentelemetry-collector-contrib repo. Am I right ?

Enzujp avatar Mar 26 '24 19:03 Enzujp

@Enzujp yes, you are right! And in general: this may not be a trivial task, these tests have not been modified for a long time and a long has changed since

mx-psi avatar Mar 27 '24 16:03 mx-psi

I'm trying out solutions to automate the release notes, should be done soon; and then I'd come back and we can map out doing this together?. :)

Enzujp avatar Mar 27 '24 17:03 Enzujp

@Enzujp Sure! I am out until next week, but feel free to Slack me on the CNCF Slack (you can find my name on my profile :))

mx-psi avatar Mar 27 '24 17:03 mx-psi

I think the way to go here would be to basically remove most if not all of the content in https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/buildscripts/packaging/fpm and move just the test script over to the releases repo. All other files already exist in the -releases repo since the linux service packages are already built there anyways. Then, a snapshot release could be built using the already existing makefile targets over in the -releases repo to build the packages that need to be tested.

@mx-psi WDYT? I'd give this a shot if it makes sense to you.

mowies avatar Jul 18 '24 09:07 mowies

Then, a snapshot release could be built using the already existing makefile targets over in the -releases repo to build the packages that need to be tested.

Sounds good to me. I would prefer this to be a new workflow, triggered only when the goreleaser files are changed, and tested only on cherry-picked combinations.

jpkrohling avatar Jul 18 '24 10:07 jpkrohling

This makes sense to me, and agreed on the new workflow triggered by goreleaser files changed

mx-psi avatar Jul 18 '24 10:07 mx-psi

Sounds good to me. I would prefer this to be a new workflow, triggered only when the goreleaser files are changed, and tested only on cherry-picked combinations.

Sure then let's start with the most commonly used one, which is probably Linux amd64? New workflow sounds good, but I guess it should also trigger on change for any of the service unit files (e.g. also pre/post install scripts etc.).

mowies avatar Jul 18 '24 10:07 mowies

I'll get to it then 🚀

mowies avatar Jul 18 '24 11:07 mowies

@jpkrohling I looked into it a bit more and found out that the package tests could nicely fit into the current ci-goreleaser workflows. They already trigger on the right changes and build a snapshot release. We would just need to upload the packages to test as artifacts and then trigger the package test workflow right after and use the artifacts there.

So the https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.github/workflows/base-ci-goreleaser.yaml workflow would get a step at the end (in pseudocode):

if: goos is linux and goarch is amd64
uses: actions/upload-artifact
with: the-correct-rpm/deb/apk-files-to-upload

and then the package-test workflow would be called after e.g. https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.github/workflows/ci-goreleaser-core.yaml#L34 and use the artifact for testing

mowies avatar Jul 18 '24 12:07 mowies

Sounds good to me.

jpkrohling avatar Jul 18 '24 12:07 jpkrohling

PR is ready for review 🚀

mowies avatar Jul 24 '24 14:07 mowies