Repository navigation
Add exclude-files input to build-to-draft-release - #192
Merged
Merged
Conversation
Lets a repository keep *.factory.yaml auto-discovery while skipping configs it builds separately, instead of abandoning discovery and hard-coding every device path. Patterns are globs matched against the whole repository-relative path, so *.minimal.factory.yaml drops device/device.minimal.factory.yaml without naming the directory. Mutually exclusive with groups.
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 does this implement/fix?
Adds an optional
exclude-filesinput tobuild-to-draft-release.ymlso a repository can keep*.factory.yamlauto-discovery while skipping configs it builds separately, instead of abandoning discovery and hard-coding every device path (which then silently rots whenever a device is added).Entries are newline-separated glob patterns matched against the whole repository-relative path, with
*spanning/, so a single*.minimal.factory.yamlexcludesdevice/device.minimal.factory.yamlwithout naming the directory. The filter applies uniformly to both an explicitly-passedfileslist and the auto-discovered list, every exclusion is logged, and an exclusion that empties the list fails with a distinct error (Every file was excluded ...) separate from the existing "No *.factory.yaml files found". It is mutually exclusive withgroups, which already lists each group's files explicitly; combining them is rejected at resolve time.The motivating case is a repository with a variant config (e.g. a
*.minimal.factory.yaml) that must not reach the main draft build or the release, which today forces the caller to drop discovery and enumerate every device path.Testing
ci-draft-release.ymlnow adds a second factory fixture (tests/ci-draft-excluded.factory.yaml) and passesexclude-files: "*-excluded.factory.yaml"to the discovery smoke build. Both configs are discovered, and the run asserts the excluded one is not built while the other still is; the existing "unexpected top-level entry" guard makes a broken exclusion fail CI, so the test is not vacuous. Validated locally withyamllint .,actionlint+shellcheck(no new findings), and a harness that runs the extracted resolve script against realistic nested and top-level paths covering the empty, exact-path, glob, no-match, everything-excluded, and groups-conflict branches.This is a backwards-compatible addition (optional, empty default). Consumers will need a new release tag to adopt it.