Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 1, 2025

This PR migrates the on_call_staging_test workflow from using standalone Docker commands to Docker Compose, providing better integration with the existing containerized development environment while addressing CI-specific concerns.

Changes Made

Docker Compose Integration

  • Added a new staging service to docker-compose.yml that:
    • Builds from the _site directory context using the staging Dockerfile
    • Exposes the staging site on port 8080 as required
    • Includes health checks for reliable service readiness detection

CI-Specific Configuration Isolation

  • Created docker-compose.ci.yml override file to isolate GitHub Actions cache configuration
  • Removed cache settings from main docker-compose.yml to prevent issues during local development
  • Workflow uses both compose files (-f docker-compose.yml -f docker-compose.ci.yml) for CI-specific behavior

Staging Dockerfile Updates

  • Updated .github/scripts/staging/Dockerfile to work with the _site build context
  • Fixed Apache configuration to use default.conf with correct ServerRoot path for the httpd:2.4.64 image
  • Maintained curl installation for health check functionality

Workflow Improvements

  • Replaced manual timeout loop with docker compose --wait flag for cleaner health check handling
  • Simplified the "Run as service and test" step to use Docker Compose consistently
  • Added proper preparation step to copy Apache configuration into the build context
  • Implemented robust error handling to ensure the service stops regardless of test outcome
  • Maintained the same curl-based testing but removed redirect following to match original behavior

Benefits

  • Cleaner Architecture: Uses Docker Compose consistently across the project
  • Better Integration: Leverages existing containerization patterns
  • Improved Reliability: Health checks with --wait ensure service readiness before testing
  • Development Friendly: Cache configuration isolated to CI environment only
  • Maintainability: Consolidates container management in docker-compose.yml

The staging test maintains identical functionality while being more aligned with the project's Docker Compose-based development workflow and avoiding potential local development conflicts.

Fixes #228.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] on call staging test should use docker compose Migrate on_call_staging_test workflow to use Docker Compose Aug 1, 2025
@Copilot Copilot AI requested a review from dannystaple August 1, 2025 16:36
Comment on lines 112 to 115
cache_from:
- type=gha
cache_to:
- type=gha,mode=max
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this behave at the desk? It might only want to do this in the workflow run context - could it be specified there instead as a parameter/env var for the docker compose up command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the GitHub Actions cache configuration to a separate docker-compose.ci.yml override file. This isolates the CI-specific cache settings from the main compose file, preventing any issues during local development. The workflow now uses both files with -f docker-compose.yml -f docker-compose.ci.yml. Commit: 44deee4

…nfig to CI override

Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Aug 1, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.04s
✅ BASH bash-exec 1 0 0 0.0s
✅ BASH shellcheck 1 0 0 0.06s
⚠️ BASH shfmt 1 1 0 0.0s
❌ C cppcheck 8 8 0 0.31s
❌ CPP cppcheck 8 8 0 0.22s
✅ JSON npm-package-json-lint yes no no 0.44s
✅ JSON v8r 12 0 0 6.52s
❌ MARKDOWN markdown-link-check 736 212 0 45.2s
✅ REPOSITORY gitleaks yes no no 13.43s
✅ REPOSITORY git_diff yes no no 0.77s
✅ REPOSITORY grype yes no no 35.95s
✅ REPOSITORY secretlint yes no no 42.45s
✅ REPOSITORY syft yes no no 1.5s
✅ REPOSITORY trivy-sbom yes no no 3.56s
✅ REPOSITORY trufflehog yes no no 4.59s
✅ XML xmllint 1 0 0 198.03s
✅ YAML v8r 13 0 0 6.57s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@Copilot Copilot AI changed the title Migrate on_call_staging_test workflow to use Docker Compose Migrate on_call_staging_test workflow to use Docker Compose with improved CI integration Aug 1, 2025
@Copilot Copilot AI requested a review from dannystaple August 1, 2025 17:40
Copilot finished work on behalf of dannystaple August 1, 2025 17:40
@dannystaple dannystaple marked this pull request as ready for review August 1, 2025 22:15
@dannystaple dannystaple merged commit 8c6751a into master Aug 1, 2025
4 checks passed
@dannystaple dannystaple deleted the copilot/fix-228 branch August 1, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

on call staging test should use docker compose

2 participants