Skip to content

mise.toml の TERRAFORM_DIR が typo(repository → repositories)で tf:* タスクが動かない #1619

Description

@tqer39

背景

PR #1618(Issue #1617)の作業中に発見した既存バグ。

`mise.toml` の `TERRAFORM_DIR` 環境変数が `terraform/src/repository`(単数形)になっているが、実際のディレクトリは `terraform/src/repositories`(複数形)。

[env]
TERRAFORM_DIR = \"terraform/src/repository\"  # ← typo

影響

以下の mise タスクが全て失敗する:

  • `mise run tf:validate`
  • `mise run tf:init`
  • `mise run tf:plan`
  • `mise run tf:apply`
  • `mise run tf:clean`

実行例

$ mise run tf:validate
[tf:validate] WARN task directory does not exist: ...terraform/src/repository
[tf:validate] ERROR No such file or directory (os error 2)

補足

そもそも各リポジトリ(`terraform/src/repositories//`)はそれぞれ独立した Terraform root module なので、単一の `TERRAFORM_DIR` を指定する設計自体に再考の余地がある。

  • 引数で対象リポジトリを指定する形(`mise run tf:plan -- anime-tweet-bot`)
  • 全リポジトリをループする形

など、利用形態に応じた修正が必要。

修正案

短期: `TERRAFORM_DIR` を `terraform/src/repositories` に修正 + 引数で対象リポジトリ指定可能にする。

[tasks.\"tf:validate\"]
description = \"Validate Terraform configuration\"
dir = \"{{ config_root }}/{{ env.TERRAFORM_DIR }}/{{ arg(name='repo') }}\"
run = \"terraform validate\"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions