Skip to content

fix(discover-services): tolerate a .dockerignore with no allow-list lines#45

Merged
blairham merged 1 commit into
mainfrom
fix/discover-services-dockerignore-grep-guard
Jul 6, 2026
Merged

fix(discover-services): tolerate a .dockerignore with no allow-list lines#45
blairham merged 1 commit into
mainfrom
fix/discover-services-dockerignore-grep-guard

Conversation

@blairham

@blairham blairham commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

discover-services aborts the detect job for any repo whose .dockerignore has no ! (negation) allow-list lines. In the push-path matrix detection:

includes=$(grep '^!' .dockerignore | sed '')

grep '^!' on a file with no matches exits 1; under set -e + set -o pipefail the whole job aborts before any service is emitted, surfacing as a bare Process completed with exit code 1 with no diagnostic.

data-hub hit this on its stevedore cutover — its .dockerignore has zero ! lines, so every push to main fails in detect even though the service config is valid.

Fix

Guard the substitution with || true — the same idiom already applied to the SIGPIPE-prone tag grep a 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

…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>
@blairham
blairham merged commit 86897c5 into main Jul 6, 2026
2 checks passed
@blairham
blairham deleted the fix/discover-services-dockerignore-grep-guard branch July 6, 2026 15:46
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