Skip to content

feat!: define one service name rule and remove all - #382

Merged
panicboat merged 2 commits into
mainfrom
feat/unify-service-names
Oct 30, 2026
Merged

panicboat merged 2 commits into
mainfrom
feat/unify-service-names

Conversation

@panicboat

Copy link
Copy Markdown
Owner

What This PR Does

service 名の判定を 1 か所にまとめ、使われていない all と、それに依存していた candidates の出力と root の計算を消します。

What Needs to Change

  • service 名の規則が 3 か所にあり、内容が違う。
    • Reason: apps/a.b が service として検出されて読めないラベルが付き、resolver は黙って読み飛ばすので、何も deploy されずエラーも出ない。
  • all という語が特別扱いされている。
    • Reason: deploy:all のラベルは使われたことがなく、all というディレクトリがあると全 service が対象になってしまう。
  • candidates の出力と root の計算が残っている。
    • Reason: 利用者だった release の設定チェックを消したので、使われていない。

What Changes for Users

  • service 名は [a-zA-Z0-9_-]+ だけになり、合わないディレクトリは service として扱いません。
    • Before: a.b は検出されてラベルが付き、services-detected に null が入る。
    • After: ラベルも target も作らない。先頭がドットのディレクトリと同じ扱いになる。
  • all は普通の名前になります。
    • Before: deploy:all と targets all は全 service を対象にする。
    • After: all という名前の service だけを対象にする。
  • label-resolver の candidates の出力はなくなります。
    • Before: service を渡すと candidates が出る。
    • After: targets と has-targets だけが出る。
  • config-manager test は、正しくない名前をエラーにします。
    • Before: 空の結果で exit 0 になる。
    • After: targets と同じメッセージで exit 1 になる。
  • exclude の service の条件にも、同じ規則を適用します。
    • Before: 先頭がドットの値だけを拒否する。
    • After: 規則に合わない値は設定エラーになる。

What to Review Closely

  • 規則に合わないディレクトリの変更が、黙って無視されること。
    • Reason: エラーにせず、先頭がドットのディレクトリと同じ扱いにしたため。
    • Details: What Was Decided

What Was Decided

  • 規則に合わない名前は、エラーではなく service として扱わない。
    • Reason: 先頭がドットのディレクトリと挙動を揃え、関係のないディレクトリで PR を止めないため。
    • 間違っていた場合の影響: a.b のようなディレクトリの変更に、deploy が走らないことに気づきにくい。
  • ドットを許さない。
    • Reason: 今の利用者のディレクトリにドットを含むものがなく、必要になれば定義の 1 か所を変えて足せるため。
    • 間違っていた場合の影響: ドットを含む名前を使うときに定義を変える必要がある。

What Else Is Affected

Documents

  • 利用規約
  • プライバシーポリシー
  • ドキュメント

Systems & Operations

How It Was Verified

  • cd action-scripts && bundle exec rspec → 693 examples, 0 failures
  • 新しいテストは、実装の前に落ちることを確かめました。
  • 一時的な git リポジトリで、実際の dispatcher を実行しました。
    • Before: services-detected=[null,"api"]
    • After: services-detected=["api"]
  • 正しい設定での config-manager test の出力は、変更前後で 46 通りすべて一致しました。

Related Issues and PRs

🤖 Generated with Claude Code

https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG

A service name had three definitions: `{service}` captured any path
element, the scanner and change detection rejected only a leading dot, and
labels required [a-zA-Z0-9_-]+. A directory such as apps/a.b was therefore
detected as a service and labeled deploy:a.b, services-detected emitted
[null,"api"], and the resolver silently skipped the label.

Entities::Service.valid_name? is now the only definition. A name that fails
it is not a service anywhere: ChangeDetector gives it no label, the directory
scanner prunes it during descent, so it may be unreadable, and a `service`
exclude condition that fails it is a configuration error.

BREAKING CHANGE: Directories whose name does not match [a-zA-Z0-9_-]+ are no
longer services, and `service: a.b` in an exclude condition is rejected.

`all` is no longer special, because the label is unused and its only other
user is being deleted. A directory named all is an ordinary service,
deploy:all targets only that directory, and `targets all` looks up a service
named all, returning [] when there is none. DeployLabel#deploy_all? and
`services: nil` in EnumerateTargets are removed, since nothing lists every
service anymore.

The candidates output of `targets SERVICE` and the label-resolver action is
removed along with the root calculation, because that same check was their
only reader. Entities::ServiceTargets, TargetCandidate#root, and
ListedTarget#root go with them. The targets and has-targets outputs are
unchanged, and so is config-manager test for a valid configuration.

Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG
Signed-off-by: panicboat <panicboat@gmail.com>
config-manager test printed an empty result and exited 0 for a name such as
a.b, while resolver targets exited 1 for the same name. Both now apply the
service name definition and report it with one message, kept on
Entities::Service so the two cannot drift apart. A valid name with no matching
directory still exits 0 with an empty result, as it does for targets.

Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG
Signed-off-by: panicboat <panicboat@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07092b0a-eadf-4155-9595-9e64d3aa99d5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@panicboat
panicboat marked this pull request as ready for review October 30, 2026 23:49
@panicboat
panicboat merged commit 0c9e542 into main Oct 30, 2026
6 checks passed
@panicboat
panicboat deleted the feat/unify-service-names branch October 30, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant