Skip to content

Conversation

@lianjin
Copy link
Member

@lianjin lianjin commented Sep 25, 2025


name: fix deploy workflow
about: fix deploy related workflow & Dockerfile
labels: ["fix"]

变更内容 | Changes

  1. Dockerfile: chmod logs
  2. deploy.yml: set mysql pwd env

相关 Issue | Related Issue

[KAN-25: User Service CI/CD ] (https://cerami-craft.atlassian.net/browse/KAN-25)

变更类型 | Type of Change

  • 新功能 Feature
  • 修复 Bug Fix
  • 文档 Documentation
  • 样式优化 Style
  • 重构 Refactor
  • 性能优化 Performance
  • 测试 Test
  • 构建/CI Build/CI
  • 其他 Other

检查清单 | Checklist

  • 代码已通过本地测试(含主流浏览器/终端)| Code tested locally (including major browsers/terminals)
  • 相关文档已更新(如有)| Documentation updated if needed
  • 代码风格符合项目规范 | Code style follows project conventions
  • 变更不会影响现有功能 | Changes do not break existing features
  • 已自查无敏感信息泄露 | No sensitive info is leaked

变更影响 | Impact

none

测试说明 | Test Instructions

none

其他说明 | Additional Notes

@lianjin lianjin requested review from Copilot and yzcgg September 25, 2025 07:20
Copy link

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 implements CI/CD improvements and deployment configurations for the ceramicraft-user-mservice. The changes include fixing deployment workflows, setting up proper environment variable handling, and adding comprehensive testing and security scanning capabilities.

  • Adds complete user service implementation with DAO layer and unit tests
  • Fixes Docker deployment configuration with proper MySQL environment variable handling
  • Implements comprehensive CI/CD workflows for testing, security scanning, and deployment

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/Dockerfile Creates Docker container with proper permissions and logs directory setup
server/config/config.go Fixes MySQL password environment variable name from lowercase to uppercase
server/resources/config.yml Updates MySQL host and log file path for containerized deployment
.github/workflows/deploy.yml Adds manual deployment workflow with Docker Hub integration and MySQL password environment
server/service/user_service.go Implements user service layer with create functionality
server/repository/dao/userDao.go Adds user data access object with CRUD operations
server/service/user_service_test.go Adds unit tests for user service with mock DAO
.github/workflows/pr_scan.yml Implements SonarQube and Snyk security scanning workflows
.github/workflows/zap.yml Adds ZAP security scanning for running application
.github/workflows/build.yml Creates comprehensive build and test workflow for multi-module project

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

log:
level: debug
file_path: ./logs/user-server.log
file_path: ./logs/ceramicraf-user-mserver.log
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

There's a typo in the log file name. 'ceramicraf-user-mserver.log' should be 'ceramicraft-user-mserver.log' (missing 't' in 'ceramicraft').

Suggested change
file_path: ./logs/ceramicraf-user-mserver.log
file_path: ./logs/ceramicraft-user-mserver.log

Copilot uses AI. Check for mistakes.
run: |
docker stop ceramicraft-user-mservice || true
docker rm ceramicraft-user-mservice || true
docker run -d --name ceramicraft-user-mservice --network ceramicraft-network -p 8080:8080 "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.event.inputs.version }}"
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The MYSQL_PASSWORD environment variable is missing in the rollback job's docker run command. This will cause the application to fail during rollback as it cannot connect to the database.

Suggested change
docker run -d --name ceramicraft-user-mservice --network ceramicraft-network -p 8080:8080 "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.event.inputs.version }}"
docker run -d --name ceramicraft-user-mservice --network ceramicraft-network -e MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }} -p 8080:8080 "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.event.inputs.version }}"

Copilot uses AI. Check for mistakes.
@lianjin lianjin closed this Sep 25, 2025
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.

2 participants