Skip to content

Conversation

@ikura-hamu
Copy link
Member

@ikura-hamu ikura-hamu commented Nov 6, 2025

User description

  • 🩹 CIでatlasのcommunity editionを使うように変更
  • 🔧 CI用のatlasの設定ファイルを追加
  • 📝 ドキュメントの更新
  • 🔥 taskからマイグレーションの Lint タスクを削除

PR Type

Enhancement, Documentation


Description

  • CIでAtlas Community導入しLint実行

  • Atlas設定を新規追加し環境分離

  • TaskのLintタスクを削除

  • ドキュメントをCommunity前提に更新


Diagram Walkthrough

flowchart LR
  A["GitHub Actions CI"] -- "Community版をインストール" --> B["atlas.ci.hcl 参照"]
  B["atlas.ci.hcl 参照"] -- "env ciでLint" --> C["migrations の検査"]
  D["Taskfile群"] -- "migrate:lint を削除" --> E["CLI直接利用へ"]
  F["docs/migration.md"] -- "Community利用方法を追記" --> E
Loading

File Walkthrough

Relevant files
Configuration changes
atlas.ci.hcl
Atlas用CI/ローカル設定ファイルの新規追加                                                                 

atlas.ci.hcl

  • Atlas Lintの共通設定を追加
  • env "local" と "ci" を定義
  • dev接続とmigrationsディレクトリを設定
  • Gitベース比較をorigin/mainに固定
+29/-0   
Enhancement
ci.yaml
CIでAtlas Community導入とLint実行方法更新                                                   

.github/workflows/ci.yaml

  • Setup AtlasをCommunity版インストールに変更
  • atlas migrate lintで設定ファイルを参照
  • env ciを指定してLint実行
+5/-3     
Miscellaneous
Taskfile.yml
ルートTaskfileの整備とLintタスク削除                                                                 

Taskfile.yml

  • 文字列クオートをシングルへ統一
  • migrate:lintタスクを削除
  • 各descのクオートを更新
+4/-9     
Taskfile_unix.yml
Unix用TaskfileからLintタスク削除                                                                 

task/Taskfile_unix.yml

  • migrate:lintタスクを削除
  • 他タスクは現状維持
+0/-5     
Taskfile_windows.yml
Windows用Taskfileの整備とLint削除                                                             

task/Taskfile_windows.yml

  • versionクオートをシングルへ
  • migrate:lintタスクを削除
+1/-6     
Documentation
migration.md
マイグレーションLint手順をCommunity前提に更新                                                       

docs/migration.md

  • Community版が必要である旨を追記
  • CIでCommunity版使用を明記
  • ローカルLintコマンド例を更新
+3/-1     

@ikura-hamu ikura-hamu requested a review from a team as a code owner November 6, 2025 13:13
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Migrate lint ✅

Lint output

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

Lintコマンドで設定ファイルを指定していますが、atlasバイナリ取得方法をアクションからcurlに変更したことでPATHや実行権限、バージョン固定が不十分な可能性があります。CIでatlasが確実に利用できるか、失敗時の挙動を確認してください。

- name: Setup Atlas community edition
  run: |
    curl -sSf https://atlasgo.sh | sh -s -- --community --yes
  shell: bash

- name: Atlas Lint
  run: |
    set +e

    LINT_OUTPUT="$(atlas migrate lint --config file://atlas.ci.hcl --env ci 2>&1)"
    LINT_EXIT_CODE=$?
Typo

コマンド例がaltasになっており誤記です。atlasに修正してください。

altas migrate lint --config file://atlas.ci.hcl --env local

</details>

<details><summary><a href='https://github.com/traPtitech/trap-collection-server/pull/1425/files#diff-de2180789a146863a742d94971771278c54cef622575b6f525090973cbdd7692R7-R28'><strong>Config Consistency</strong></a>

local環境はMariaDBコンテナ、CIはMySQLに接続しています。両者で方言差によるLint結果の不一致が起きないか確認してください(特に型・DDL差異)。
</summary>

```hcl
env "local" {
  dev = "docker://mariadb/10.7/trap_collection"

  migration {
    dir = "file://migrations"
  }

  lint {
    git {
      base = "origin/main"
    }
  }
}

env "ci" {
  dev = "mysql://root:pass@localhost:3306/trap_collection"

  lint {
    git {
      base = "origin/main"
    }
  }

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Migrate lint ✅

Lint output

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.89%. Comparing base (49f54d1) to head (cf143c4).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1425   +/-   ##
=======================================
  Coverage   52.89%   52.89%           
=======================================
  Files         136      136           
  Lines       10003    10003           
=======================================
  Hits         5291     5291           
  Misses       4398     4398           
  Partials      314      314           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ikura-hamu ikura-hamu merged commit 659e232 into main Nov 6, 2025
11 checks passed
@ikura-hamu ikura-hamu deleted the conf/atlas_community branch November 6, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants