fix(discover-services): tolerate a .dockerignore with no allow-list lines#45
Merged
Merged
Conversation
…ines The push-path matrix detection builds an allow-list from the repo's `.dockerignore` via `grep '^!' .dockerignore | sed …`. When a repo ships a `.dockerignore` that has no `!` (negation) lines, grep exits 1; under `set -e` + `set -o pipefail` that aborts the whole detect job before any service is emitted — the release fails with a bare "exit code 1" and no diagnostic. data-hub hit this on its stevedore cutover (its .dockerignore has zero `!` lines). Guard the substitution with `|| true`, the same idiom already used for the SIGPIPE-prone tag grep just below. An empty allow-list is a valid state and is handled downstream. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
discover-servicesaborts thedetectjob for any repo whose.dockerignorehas no!(negation) allow-list lines. In the push-path matrix detection:includes=$(grep '^!' .dockerignore | sed '…')grep '^!'on a file with no matches exits 1; underset -e+set -o pipefailthe whole job aborts before any service is emitted, surfacing as a bareProcess completed with exit code 1with no diagnostic.data-hub hit this on its stevedore cutover — its
.dockerignorehas zero!lines, so every push tomainfails indetecteven though the service config is valid.Fix
Guard the substitution with
|| true— the same idiom already applied to the SIGPIPE-prone taggrepa few lines below. An empty allow-list is a legitimate state and is handled downstream (includes="").Blast radius
Shared composite action → all callers. Behavior is unchanged for repos that already have
!lines (grep exits 0); it only stops the spurious abort for repos without them.🤖 Generated with Claude Code