-
Notifications
You must be signed in to change notification settings - Fork 2
Add GitHub Actions workflow for testing published images #236
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
Conversation
- Add workflow_dispatch workflow to test images from published repositories - Supports configurable branch, package repository, tags, and architectures - Tests images for both arm and x86 architectures - Runs cluster tests against published images - Demo version ready for future enhancements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a GitHub Actions workflow for testing published Docker images from container repositories. The workflow enables manual verification of published images across multiple tags and architectures before deployment.
Key Changes:
- New workflow
test-published-images.ymlwith manual trigger support for testing published images - Image testing across configurable tags and architectures (arm/arm64 and x86/amd64)
- Integration with existing cluster test infrastructure using local registry
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Run cluster tests | ||
| echo "Running cluster tests for ${LOCAL_IMAGE}..." | ||
| if ! CONTROL_PLANE_VERSION="${tag}" \ | ||
| make docker-swarm-init && \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker-swarm-init target is called after Docker Swarm has already been initialized in the 'Initialize Docker Swarm' step (line 56-57). This may cause an error or unexpected behavior if the Makefile target expects an uninitialized swarm. Consider removing this redundant initialization or restructuring the workflow to initialize swarm only once.
| make docker-swarm-init && \ |
| if ! CONTROL_PLANE_VERSION="${tag}" \ | ||
| make docker-swarm-init && \ | ||
| make test-cluster-ci \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test execution combines multiple commands with && which makes it difficult to determine which specific step failed (swarm init vs. actual tests). Consider separating these into distinct steps with individual error checking for clearer failure diagnostics.
| if ! CONTROL_PLANE_VERSION="${tag}" \ | |
| make docker-swarm-init && \ | |
| make test-cluster-ci \ | |
| if ! CONTROL_PLANE_VERSION="${tag}" make docker-swarm-init; then | |
| echo "ERROR: Swarm initialization failed for tag=${tag}, arch=${arch}" | |
| OVERALL_SUCCESS=false | |
| elif ! make test-cluster-ci \ |
…flow - Pin all GitHub Actions to full-length commit SHAs for security - actions/checkout@34e1148 - actions/setup-go@40f1582 - docker/setup-buildx-action@8d2750c - Remove redundant docker-swarm-init call in test execution loop - Improve error diagnostics with explicit exit code capture and reporting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| docker swarm init || true | ||
|
|
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using || true silently suppresses errors. If the swarm is already initialized, this is fine, but if initialization fails for other reasons (e.g., network issues), the error will be hidden. Consider checking if swarm is already active before attempting to initialize, or at minimum log why initialization was skipped.
| docker swarm init || true | |
| # Check if Docker Swarm is already active | |
| if docker info --format '{{.Swarm.LocalNodeState}}' 2>/dev/null | grep -qi '^active$'; then | |
| echo "Docker Swarm is already active; skipping initialization." | |
| exit 0 | |
| fi | |
| echo "Docker Swarm is not active; attempting to initialize..." | |
| if ! docker swarm init; then | |
| echo "ERROR: Docker Swarm initialization failed." >&2 | |
| exit 1 | |
| fi |
| docker service create --name registry --publish published=5000,target=5000 registry:2 || \ | ||
| docker service update --force registry || true |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error handling pattern is unclear. If service creation fails, attempting to update it may not be the correct recovery path. Consider checking if the service already exists first, then create or update accordingly, rather than relying on command failures.
| docker service create --name registry --publish published=5000,target=5000 registry:2 || \ | |
| docker service update --force registry || true | |
| if docker service ls --format '{{.Name}}' | grep -q '^registry$'; then | |
| echo "Registry service already exists, updating..." | |
| docker service update --force registry | |
| else | |
| echo "Creating registry service..." | |
| docker service create --name registry --publish published=5000,target=5000 registry:2 | |
| fi |
- Check Docker Swarm state before attempting initialization - Properly handle and report errors instead of silently suppressing them - Check if registry service exists before create/update operations - Add clear logging for better debugging and transparency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Run cluster tests | ||
| echo "Running cluster tests for ${LOCAL_IMAGE}..." | ||
| set +e # Don't exit on error, we'll handle it | ||
| CONTROL_PLANE_VERSION="${tag}" \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name 'CONTROL_PLANE_VERSION' is misleading since it's being set to a Docker image tag value. Consider renaming to 'IMAGE_VERSION' or 'TEST_VERSION' to clarify its purpose.
| CONTROL_PLANE_VERSION="${tag}" \ | |
| IMAGE_VERSION="${tag}" \ |
Summary
Adds a GitHub Actions workflow that can be manually triggered to test published Docker images from container repositories. The workflow supports testing multiple image tags and architectures (arm/x86) by pulling images, verifying them, and running cluster tests against them.
Changes
test-published-images.ymlworkflow withworkflow_dispatchtriggerTesting
Manual testing can be performed by:
main(or any branch)pgedge-postgres-internal(or your repository name)latest,v0.6.2(comma-separated)arm,x86(comma-separated)The workflow will:
ghcr.io/pgedge/{package_repository}:{tag}for each architecturemake test-cluster-ciwith the published imagesChecklist
Notes for Reviewers
ghcr.io/pgedge/{package_repository}:{tag}) may need adjustment based on actual repository structure