Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a49cc88
docker-composeをやめてdb,migration,tblsを個別に
inochidainini May 5, 2026
92e79cf
go tool tblsに変更
inochidainini May 5, 2026
0e017ca
Merge branch 'main' into speedUpCi
inochidainini May 6, 2026
7c5d701
環境設定にurlを追加
inochidainini May 6, 2026
dfa89f9
tblsのversionを1.56.2に
inochidainini May 7, 2026
d6e334d
Revert "tblsのversionを1.56.2に"
inochidainini May 7, 2026
1feb1a9
mariadbのヘルスチェック変更
inochidainini May 9, 2026
1ebd39f
airをdev/Dockerfileへ移動
inochidainini May 10, 2026
5073d22
Merge remote-tracking branch 'origin' into speedUpCi
inochidainini May 10, 2026
be02b5d
ローカルのtblsのバージョンをciと一致させた
inochidainini May 11, 2026
b3f9ec6
設定ファイルにtbls.yamlを指定
inochidainini May 22, 2026
d10e9f4
Merge branch 'main' into speedUpCi
inochidainini May 22, 2026
a6c6071
tblsを依存関係に追加しなおし
inochidainini May 22, 2026
c8778a6
tbls実行し直し
inochidainini May 22, 2026
cbc66b1
Merge branch 'main' into speedUpCi
inochidainini Jun 12, 2026
4542176
デバッグ用ci
inochidainini Jun 12, 2026
23c6390
追加し忘れ
inochidainini Jun 12, 2026
ef17ad7
追加し忘れ
inochidainini Jun 12, 2026
674620e
merge main
inochidainini Jun 18, 2026
0884363
デバッグ用
inochidainini Jun 18, 2026
7cf1405
デバッグ用diff表示
inochidainini Jun 18, 2026
9357f40
Merge branch 'main' into speedUpCi
inochidainini Jul 10, 2026
6e9c6f8
tbls更新し忘れ
inochidainini Jul 11, 2026
1e9c89d
citest1
inochidainini Jul 11, 2026
eaad0f5
Bump docker/login-action from 4.2.0 to 4.4.0
dependabot[bot] Jul 10, 2026
6fb43de
feature: handlerのGetFeedbackConfigを実装した
w4mally Jul 13, 2026
0b2c136
fix: mock生成用のコメントが抜けていた
w4mally Jul 13, 2026
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
44 changes: 42 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,57 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}

tbls:
services:
mariadb:
image: mariadb:10.6.4
env:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: trap_collection
TZ: Asia/Tokyo
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10

Comment on lines 159 to +175

@coderabbitai coderabbitai Bot May 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Health-check --health-retries 1000 is excessively high — a DB startup failure would block for ~16 minutes.

At --health-interval 1s × 1000 retries, the job won't give up for roughly 16 minutes if the container never becomes healthy. The migrate-lint job uses --health-retries 10 (with --health-interval 10s and a --health-start-period). Bringing tbls in line prevents silent stalls.

🐛 Proposed fix — align with migrate-lint health-check tuning
       options: >-
         --health-cmd "mysqladmin ping -h 127.0.0.1 -ppass"
-        --health-interval 1s
-        --health-timeout 5m
-        --health-retries 1000
+        --health-interval 10s
+        --health-start-period 10s
+        --health-timeout 5s
+        --health-retries 10
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tbls:
services:
mariadb:
image: mariadb:10.6.4
env:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: trap_collection
TZ: Asia/Tokyo
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -ppass"
--health-interval 1s
--health-timeout 5m
--health-retries 1000
tbls:
services:
mariadb:
image: mariadb:10.6.4
env:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: trap_collection
TZ: Asia/Tokyo
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml around lines 159 - 174, The tbls mariadb service
health-check is set to an excessively high retry count; in the mariadb service
options block (service name "mariadb" under "tbls") replace "--health-retries
1000" with a realistic value such as "--health-retries 10" and align the timing
with migrate-lint by changing "--health-interval 1s" to "--health-interval 10s"
and adding a "--health-start-period 30s" (or similar start-period) so the job
fails fast on real failures instead of waiting ~16 minutes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

妥当な指摘だと思うので対応をお願いします

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mathsuky ご確認ありがとうございます! tbls ジョブの health-check パラメータを migrate-lint ジョブに合わせて修正します。

  • .github/workflows/ci.yamltbls ジョブの mariadb サービスの health-check オプションを migrate-lint ジョブと同様の設定に変更する

Failed to handle agent chat message. Please try again.


name: tbls
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod

- name: Install Atlas
run: |
curl -sSf https://atlasgo.sh | sh -s -- --community --yes

- name: Run migration
run: |
until mysqladmin ping -h 127.0.0.1 -ppass --silent; do
echo "Waiting for database to be healthy..."
sleep 1
done

atlas migrate apply \
--config file://atlas.ci.hcl \
--env ci
shell: bash

- name: Run tbls
run: docker compose -f docker/tbls/compose.yaml up --build --abort-on-container-exit
run: |
TBLS_DSN=mariadb://root:pass@127.0.0.1:3306/trap_collection \
go tool tbls doc --rm-dist -c .tbls.yml

- name: Check diff
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "tbls diff detected. Please generate and commit the new docs. (task tbls)"

exit 1
fi
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/deploy-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Log in to GitHub Docker Registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: traPtitech
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Login to GitHub Container Registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: traptitech
Expand Down
5 changes: 5 additions & 0 deletions atlas.ci.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ env "local" {

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

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

lint {
git {
Expand Down
6 changes: 4 additions & 2 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ RUN go mod download

ENV GOFLAGS -buildvcs=false

ENTRYPOINT ["go", "tool", "air"]
CMD ["-c", ".air.toml"]
COPY --from=cosmtrek/air:v1.63.0 /go/bin/air /usr/local/bin/air

ENTRYPOINT ["air"]
CMD ["-c", ".air.toml"]
2 changes: 1 addition & 1 deletion docker/tbls/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
file: ../base/compose.yaml
service: mariadb
tbls:
image: k1low/tbls:v1.56.2@sha256:2baf3561720f7bf3580374ea55a6f410801c3e2bfdb8449392bd9f41cc198ff0
image: k1low/tbls:v1.94.5
environment:
TBLS_DSN: mariadb://root:pass@mariadb:3306/trap_collection
volumes:
Expand Down
104 changes: 52 additions & 52 deletions docs/db_schema/access_tokens.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions docs/db_schema/admins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/db_schema/atlas_schema_revisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ CREATE TABLE `atlas_schema_revisions` (
| Name | Type | Definition |
| ---- | ---- | ---------- |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (version) |
| partial_hashes | CHECK | CHECK (json_valid(`partial_hashes`)) |

## Indexes

Expand Down
Loading
Loading