GitHub CODEOWNERSファイル

CODEOWNERS というファイルを github で設定しているとコードの変更範囲に応じてレビュワーを自動設定してくれたりするようになる。

で、このファイルパターンどんなの使えるの?って調べた。

About code owners - GitHub Docs

A CODEOWNERS file uses a pattern that follows most of the same rules used in gitignore files, with some exceptions.

gitignoreファイルと同等のファイルパターンが使えるようだ。

例外パターンとしては下記の引用の通り。

Syntax exceptions There are some syntax rules for gitignore files that do not work in CODEOWNERS files:

  • Escaping a pattern starting with # using \ so it is treated as a pattern and not a comment
  • Using ! to negate a pattern
  • Using [ ] to define a character range

[Rails Migration]Mysql2::Error: Cannot add foreign key constraint

Rails のマイグレーションやってて下記のようなエラーに遭った。

Column `xxx_id` on table `yyy` does not match column `id` on `zzz`, which has type `bigint(20)`. To resolve this issue, change the type of the `xxx_id` column on `yyy` to be :bigint. (For example `t.bigint :xxx_id`).
Original message: Mysql2::Error: Cannot add foreign key constraint

migration version 6.0 が指定されている場合、 references指定で作成される型が bigint から int 型に変更されていました。これの影響で型の不一致が発生していました。

Rails 7でテーブルカラムの型不一致による外部キー追加エラーが発生した場合の解決方法 - Qiita

特にDBの互換性とか気にしなくてもいいプロジェクトだったので、Migration のバージョンを 6.1 に変更して解決させた。