Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Feature(ci): Build image on pr for testing

Open nawramm opened this issue 2 years ago • 6 comments

Description:

Currently, the CI process does not include building a Docker image when a pull request is opened. This feature request aims to enhance the CI pipeline by automatically building a Docker image associated with the pull request.

Proposed Solution:

Create a workflow that builds a Docker image based on the pull request code. This will allow contributors and maintainers to test changes in an environment that closely mirrors the production setup.

Benefits:

  • Improved testing coverage: Docker image builds can catch issues specific to the image version early in the development process.
  • Streamlined testing for contributors: Contributors can easily verify their changes by testing the container before merging.

Additional Information:

I am willing to contribute to the implementation of this feature and can allocate time later this week to work on it. If there are specific requirements or suggestions for the implementation, please provide them, and I'll do my best to assist.

nawramm avatar Dec 18 '23 11:12 nawramm

I have been meaning to setup something which will build all 3 docker containers and start them with a basic docker compose healthcheck like

healthcheck: test: ["CMD-SHELL", "/bin/bash set -o pipefail; curl --insecure --silent -m 2 http://localhost:8080/ | grep 'Stirling-PDF' || exit 1"] interval: 60s timeout: 10s retries: 3 start_period: 40s

And run it twice, once with AUTH once without...

But never got around to it.. i 100% see the benefit of this and would appreciate the help!

Frooodle avatar Dec 18 '23 14:12 Frooodle

". This will allow contributors and maintainers to test changes in an environment that closely mirrors the production setup."

Is plan to upload a tag like s-pdf:PR-10 ? I have never thought of pushing a docker image as part of PR..

Frooodle avatar Dec 18 '23 14:12 Frooodle

While the basic health checks would help when it comes to things like #531, what comes to mind is PRs which introduce new features or extend existing ones. Pushing an image to a registry can provide maintainers and contributors with a convenient way to test the feature.

It could be perhaps pushed on a need basis, determined by specific a label to the PR . This way, image upload would be selectively triggered for PRs that may require additional testing.

nawramm avatar Dec 19 '23 12:12 nawramm

I think this serves two purposes We can have one to test the PRs and not to push

And another to push for manual testing And have it controlled by flags?

Frooodle avatar Dec 19 '23 12:12 Frooodle

But I wouldn't want to overload github actions and ideally Devs can test locally

Frooodle avatar Dec 19 '23 12:12 Frooodle

I'd rather provide a script for Devs to use which will build everything locally or something

I guess as long as Devs don't abuse it, it should be fine

Frooodle avatar Dec 19 '23 12:12 Frooodle