Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
paths:
- "terraform/**"
- ".github/workflows/terraform.yml"
push:
tags:
- "v*"
Comment on lines +8 to +10
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

pushtags: v* トリガー追加により、タグ作成/プッシュ時にもこのワークフローが実行され、Terraform Apply(github.event_name != 'pull_request')まで自動で走ります。タグは main 以外のコミットにも付けられるため、未マージのコード/設定で本番相当の Terraform Apply が走る運用事故リスクがあります。意図したデプロイ契機でない場合は、(1) Apply を workflow_dispatch 等に限定する、(2) 環境保護(Required reviewers)を通す、(3) main 上のタグに限定するための追加ガード(例: 事前に main への到達可能性を検証するステップ)などで制御してください。

Suggested change
push:
tags:
- "v*"

Copilot uses AI. Check for mistakes.
workflow_dispatch:
env:
GCP_PROJECT_NUMBER: ${{ secrets.GCP_PROJECT_NUMBER }}
Expand Down
42 changes: 21 additions & 21 deletions cmd/mcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,26 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get a list of all monsters with their details",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{
"monster_ids": map[string]interface{}{
Properties: map[string]any{
"monster_ids": map[string]any{
"type": "string",
"description": "Filter by monster ID (optional, can be a comma-separated list of IDs)",
},
"name": map[string]interface{}{
"name": map[string]any{
"type": "string",
"description": "Filter by monster name (optional, supports partial matches)",
},
"sort": map[string]interface{}{
"sort": map[string]any{
"type": "string",
"description": "Sort order for the results (optional, 'asc' for ascending, 'desc' for descending, default is 'asc')",
"enum": []string{"asc", "desc"},
},
"offset": map[string]interface{}{
"offset": map[string]any{
"type": "integer",
"description": "Offset for pagination (optional, default: 0)",
"minimum": 0,
},
"limit": map[string]interface{}{
"limit": map[string]any{
"type": "integer",
"description": "Number of items per page (optional, default: 50)",
"minimum": 1,
Expand All @@ -120,8 +120,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get detailed information about a specific monster by ID",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{
"monster_id": map[string]interface{}{
Properties: map[string]any{
"monster_id": map[string]any{
"type": "string",
"description": "The unique identifier of the monster",
},
Expand All @@ -137,22 +137,22 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Search weapons with various filters",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{
"weapon_id": map[string]interface{}{
Properties: map[string]any{
"weapon_id": map[string]any{
"type": "string",
"description": "Filter by weapon ID (optional)",
},
"name": map[string]interface{}{
"name": map[string]any{
"type": "string",
"description": "Filter by weapon name (optional)",
},
"limit": map[string]interface{}{
"limit": map[string]any{
"type": "integer",
"description": "Number of items to return (optional, default: 50)",
"minimum": 1,
"maximum": 100,
},
"offset": map[string]interface{}{
"offset": map[string]any{
"type": "integer",
"description": "Number of items to skip (optional, default: 0)",
"minimum": 0,
Expand All @@ -168,7 +168,7 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get a list of all items",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{},
Properties: map[string]any{},
},
},
Handler: m.getItems,
Expand All @@ -180,8 +180,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get detailed information about a specific item by ID",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{
"item_id": map[string]interface{}{
Properties: map[string]any{
"item_id": map[string]any{
"type": "string",
"description": "The unique identifier of the item",
},
Expand All @@ -197,8 +197,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get items that can be obtained from a specific monster",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{
"monster_id": map[string]interface{}{
Properties: map[string]any{
"monster_id": map[string]any{
"type": "string",
"description": "The unique identifier of the monster",
},
Expand All @@ -214,7 +214,7 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get a list of all skills with their level details",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{},
Properties: map[string]any{},
},
},
Handler: m.getSkills,
Expand All @@ -225,8 +225,8 @@ func (m *MCPServer) AddTools() []server.ServerTool {
Description: "Get detailed information about a specific skill by ID",
InputSchema: mcp.ToolInputSchema{
Type: "object",
Properties: map[string]interface{}{
"skill_id": map[string]interface{}{
Properties: map[string]any{
"skill_id": map[string]any{
"type": "string",
"description": "The unique identifier of the skill",
},
Expand Down
2 changes: 1 addition & 1 deletion internal/database/mysql/db_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func New(ctx context.Context) context.Context {

func connect(ctx context.Context, dialector gorm.Dialector) context.Context {
var err error
for i := 0; i < MAX_RETRY; i++ {
for i := range MAX_RETRY {
if db, err = gorm.Open(dialector, &gorm.Config{
NamingStrategy: schema.NamingStrategy{
SingularTable: false,
Expand Down
6 changes: 3 additions & 3 deletions internal/database/mysql/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ func (l *SentryLogger) LogMode(level logger.LogLevel) logger.Interface {
return &newlogger
}

func (l *SentryLogger) Info(ctx context.Context, msg string, data ...interface{}) {
func (l *SentryLogger) Info(ctx context.Context, msg string, data ...any) {
if l.logLevel >= logger.Info {
slog.Log(ctx, constant.SeverityInfo, fmt.Sprintf(msg, data...))
}
}

func (l *SentryLogger) Warn(ctx context.Context, msg string, data ...interface{}) {
func (l *SentryLogger) Warn(ctx context.Context, msg string, data ...any) {
if l.logLevel >= logger.Warn {
slog.Log(ctx, constant.SeverityWarn, fmt.Sprintf(msg, data...))
}
}

func (l *SentryLogger) Error(ctx context.Context, msg string, data ...interface{}) {
func (l *SentryLogger) Error(ctx context.Context, msg string, data ...any) {
if l.logLevel >= logger.Error {
slog.Log(ctx, constant.SeverityError, fmt.Sprintf(msg, data...))
}
Expand Down
4 changes: 2 additions & 2 deletions internal/database/mysql/testHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func migrationTestData() {
log.Fatal(err)
}
// テーブルのクリーンアップ
statements := strings.Split(string(truncateSQL), ";")
statements := strings.SplitSeq(string(truncateSQL), ";")
// テーブルのクリーンアップ
for _, stmt := range statements {
for stmt := range statements {
// 空の文を除外
if strings.TrimSpace(stmt) != "" {
if err := testDB.Exec(stmt).Error; err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutil/golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func AssertGoldenJSON(t *testing.T, goldenFile string, actual []byte) {
require.NoError(t, err)

// JSON形式に整形して比較
var expectedJSON, actualJSON interface{}
var expectedJSON, actualJSON any
err = json.Unmarshal(expected, &expectedJSON)
require.NoError(t, err)

Expand Down
Loading