Skip to content

Conversation

yuto0226
Copy link
Member

@yuto0226 yuto0226 commented Oct 8, 2025

No description provided.

@yuto0226 yuto0226 added the enhancement New feature or request label Oct 8, 2025
@yuto0226
Copy link
Member Author

yuto0226 commented Oct 8, 2025

@Jerry080401 存取 GET /openapi.json 會回 500,導致整個 smoke-test 失敗。
可能是有些 model 有 forward references 或 circular import 讓 Pydantic 產生錯誤

@Stanley1106 Stanley1106 requested a review from Copilot October 8, 2025 16:32
Copy link

@Copilot Copilot AI left a 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 comprehensive Docker Image CI workflow that builds and tests the application stack using Docker Compose. The changes introduce automated testing of both frontend and backend services with health checks and smoke tests.

  • Adds a GitHub Actions workflow for building and testing Docker images
  • Enhances Docker Compose configuration with health check dependencies
  • Updates the frontend Dockerfile to include curl for health checks

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/docker-build.yml Adds comprehensive CI workflow with build, health checks, and smoke tests
docker-compose.yml Updates service dependencies to use health check conditions and adds frontend health check
frontend/Dockerfile Installs curl package for health check functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

echo "Waiting for services to become ready..."
docker compose -f docker-compose.yml ps
# Wait for backend health endpoint with retries
MAX_RETRIES=30
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Magic numbers should be made configurable or documented. Consider defining these as environment variables or adding comments explaining the chosen values (60 seconds total wait time).

Suggested change
MAX_RETRIES=30
MAX_RETRIES=30
# Wait 2 seconds between retries; total wait time is MAX_RETRIES * SLEEP = 60 seconds

Copilot uses AI. Check for mistakes.

Comment on lines +85 to +86
docker compose -f docker-compose.yml exec -T backend sh -c "curl -sS -o /dev/null -w '%{http_code}' http://nginx:80 || true" || true
docker compose -f docker-compose.yml exec -T backend sh -c "curl -sS -o /dev/null -w '%{http_code}' http://backend:8000/health || true" || true
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Duplicated docker compose exec pattern. Consider extracting this into a shell function to reduce code repetition and improve maintainability.

Copilot uses AI. Check for mistakes.

echo "Smoke tests passed"

- name: Tear down compose
if: always()
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Using 'always()' condition may mask failures in previous steps. Consider using 'if: failure()' or 'if: cancelled()' to only run cleanup when needed.

Suggested change
if: always()
if: failure() || cancelled()

Copilot uses AI. Check for mistakes.

@yuto0226 yuto0226 merged commit f5327e1 into main Oct 10, 2025
1 check failed
@yuto0226 yuto0226 deleted the yuto/chore/ci branch October 10, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants