Repository navigation
feat!: define one service name rule and remove all - #382
Merged
Merged
Conversation
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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR Does
service 名の判定を 1 か所にまとめ、使われていない
allと、それに依存していたcandidatesの出力と root の計算を消します。What Needs to Change
apps/a.bが service として検出されて読めないラベルが付き、resolver は黙って読み飛ばすので、何も deploy されずエラーも出ない。allという語が特別扱いされている。deploy:allのラベルは使われたことがなく、allというディレクトリがあると全 service が対象になってしまう。candidatesの出力と root の計算が残っている。What Changes for Users
[a-zA-Z0-9_-]+だけになり、合わないディレクトリは service として扱いません。a.bは検出されてラベルが付き、services-detectedにnullが入る。allは普通の名前になります。deploy:allとtargets allは全 service を対象にする。allという名前の service だけを対象にする。label-resolverのcandidatesの出力はなくなります。serviceを渡すとcandidatesが出る。targetsとhas-targetsだけが出る。config-manager testは、正しくない名前をエラーにします。targetsと同じメッセージで exit 1 になる。excludeのserviceの条件にも、同じ規則を適用します。What to Review Closely
What Was Decided
a.bのようなディレクトリの変更に、deploy が走らないことに気づきにくい。What Else Is Affected
Documents
Systems & Operations
candidatesの唯一の利用者だった release の設定チェックは、先に消しました(feat!: remove the release config check .github#44)。How It Was Verified
cd action-scripts && bundle exec rspec→693 examples, 0 failuresservices-detected=[null,"api"]services-detected=["api"]config-manager testの出力は、変更前後で 46 通りすべて一致しました。Related Issues and PRs
🤖 Generated with Claude Code
https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG