Add oneOf schema constraints for mutually exclusive field pairs#7583
Merged
Add oneOf schema constraints for mutually exclusive field pairs#7583
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add oneOf constraints for mutually exclusive field pairs
Add oneOf schema constraints for mutually exclusive field pairs
Dec 25, 2025
pelikhan
approved these changes
Dec 25, 2025
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.
Schema validation previously only documented mutual exclusivity via
$commentannotations, with actual enforcement deferred to compile time in Go. This meant users only discovered conflicts when compiling workflows, not during editing.Changes
Event filter constraints
Added
oneOfconstraints to enforce mutual exclusivity:branchesvsbranches-ignore(push, pull_request, pull_request_target, workflow_run)pathsvspaths-ignore(push, pull_request, pull_request_target)Command trigger constraints
Extended existing
allOfconstraint to includelabelevent:slash_command/commandnow properly conflicts withlabelevent typeTesting
Added
pkg/parser/schema_oneof_test.gowith 23 test cases covering valid and invalid configurations.Example
Invalid configuration now fails at parse time with clear error:
Valid configurations continue to work:
Note: MCP
commandvscontainerconstraint already exists vianot: { allOf: [...] }pattern and requires no changes.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login(http block)/usr/bin/gh gh api user --jq .login .git .git 0/x64/bin/node l ame 64/pkg/tool/linu--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu--jq -o 04/upload_assets.js -importcfg /usr/bin/git -s -w -buildmode=exe git(http block)/usr/bin/gh gh api user --jq .login it/ref/tags/v5 -tests(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.