Fix: proceed with evaluation when selector references an unknown entity property#6136
Draft
Fix: proceed with evaluation when selector references an unknown entity property#6136
Conversation
…property When a CEL selector expression references a property that doesn't exist on an entity, the selector previously returned ErrResultUnknown which propagated as "error selecting entity: result is unknown". The fix distinguishes between two scenarios: 1. WithUnknownPaths was explicitly set (retry pattern): still returns ErrResultUnknown to signal the caller to retry with more data. 2. No explicit unknown paths: the property is simply missing from the entity. Properties are not guaranteed to exist, so the entity is selected and evaluation proceeds (returns true, "", nil). Updated tests to reflect the new behavior where missing properties no longer block evaluation. Co-authored-by: evankanderson <7959095+evankanderson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test for unknown property in selectors
Fix: proceed with evaluation when selector references an unknown entity property
Feb 26, 2026
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.
Using a property that doesn't exist in a profile selector (e.g.,
repository.properties.github['is_private']) caused a hard error:error evaluating rule type: error selecting entity: result is unknown. Properties are not guaranteed to be present, so evaluation should proceed rather than error.Changes
pkg/engine/selectors/selectors.goThe
Select()method now distinguishes two "unknown result" scenarios:WithUnknownPathsexplicitly set — caller is in the first pass of a retry pattern;ErrResultUnknownis still returned to trigger a retry with complete data.(true, "", nil)so evaluation proceeds.The same logic applies to the
types.IsUnknown(out)fallback check.pkg/engine/selectors/selectors_test.goErrResultUnknownfor missing properties (noWithUnknownPaths) updated to expectselected: true.TestSelectorEntityFillProperties"Fail to fetch a property" case updated: a property that can't be fetched no longer blocks evaluation (secondSucceeds: true).Testing
Unit tests in
pkg/engine/selectors/selectors_test.gocover the updated behavior directly. All selector and executor tests pass. TheWithUnknownPathsretry-pattern tests remain unchanged and continue to returnErrResultUnknownas expected.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:
www.google.com/tmp/go-build3711714686/b1939/rego.test /tmp/go-build3711714686/b1939/rego.test -test.testlogfile=/tmp/go-build3711714686/b1939/testlog.txt -test.paniconexit0 -test.timeout=2m0s -o 1714686/b1867/_p-errorsas mpile ux-amd64/pkg/tool/linux_amd64/vet -p .io/otel/semconv--64 t ux-amd64/pkg/too/tmp/ccPlXZWt.o -o E1mN/pSRwwy3Gpf6wksvjE1mN t ux-amd64/pkg/tool/linux_amd64/vet -p github.com/open--quiet t ux-amd64/pkg/toox86_64-linux-gnu(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Error: error evaluating rule type: error selecting entity: result is unknown#4785🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.