fix: stop silent dgoss/build workflow failures on version filters#612
Merged
Conversation
Add a shared exit_if_no_targets() guard that aborts with a non-zero exit code when the active filters resolve to zero image targets. A build or tool run that matches nothing was previously exiting 0, letting broken CI jobs pass while building/testing nothing — the same silent failure that the re.escape image-version bug surfaced. Wire the guard into build, dgoss run (and the deprecated run dgoss alias), hadolint run, and wizcli scan, right after target generation. The error echoes the active filters back to aid debugging. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Test Results1 877 tests 1 877 ✅ 8m 10s ⏱️ Results for commit b13aecf. ♻️ This comment has been updated with latest results. |
These dgoss run and run dgoss happy-path fixtures used empty target lists, which the new zero-match guard now correctly rejects with a non-zero exit. Set non-empty targets so they exercise the success path again. 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.
Fixes #611
Summary
CI workflows were silently passing during
bakery dgoss runwhile testing nothing, accompanied by warnings like:This PR fixes the root cause and adds a guard so the failure can never be silent again.
Root cause
Commit
50575febmigrated version filtering fromre.search()(which neededre.escape()on the filter) to segment-awareversion_matches(), and updated the CLI call sites — but missed thedgoss,hadolint, andwizcliplugins. They still calledre.escape(image_version), mangling2026.01.2+418.pro1into2026\.01\.2\+418\.pro1. That failed to parse and failed the fallback comparison → zero targets matched →dgoss runtested nothing and exited 0.Changes
re.escape()from theimage_versionfilter in the dgoss, hadolint, and wizcli plugins (and the now-unusedimport re), matching how the CLI commands already pass it through verbatim.exit_if_no_targets()guard (cli/common.py) that aborts with a non-zero exit code, echoing the active filters, when filters resolve to zero image targets. Wired intobuild,dgoss run(+ deprecatedrun dgoss),hadolint run, andwizcli scan.Testing
--image-versionreaches the filter unescaped.-n auto; ruff clean; verified end-to-end against thebasicresource context.🤖 Generated with Claude Code