feat: ownership oracles (externally computed reviewer requirements) - #178
Draft
zbedforrest wants to merge 3 commits into
Draft
feat: ownership oracles (externally computed reviewer requirements)#178zbedforrest wants to merge 3 commits into
zbedforrest wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces 'Ownership Oracles' (computed ownership) to Codeowners Plus, allowing external tools to feed JSON-based reviewer requirements into the action. The changes include adding the oracle-files input, parsing and merging oracle rules with standard .codeowners requirements, and introducing the pkg/oracle package with accompanying tests. The review feedback focuses on improving robustness in pkg/oracle/oracle.go by validating glob patterns during parsing to fail-closed, and adding nil checks for warningWriter and overlays in Merge to prevent potential panics.
zbedforrest
force-pushed
the
feature/ownership-oracles
branch
from
July 22, 2026 19:26
ddcf8b6 to
5b75238
Compare
zbedforrest
force-pushed
the
feature/ownership-oracles
branch
from
July 22, 2026 20:00
5b75238 to
dbb86fe
Compare
…eviewer requirements)
zbedforrest
force-pushed
the
feature/ownership-oracles
branch
from
July 22, 2026 20:15
dbb86fe to
980c869
Compare
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.
Related PR(s)
#179 builds on this (inline ownership). Supersedes the seam explored in #45.
Summary / Background
Some ownership requirements depend on what changed inside a file, not which file changed (e.g. "telemetry event schema changes need data-platform review"). Path patterns can't express that, so such policies live in advisory bots that comment on PRs but enforce nothing.
This PR adds ownership oracles: an earlier workflow step computes reviewer requirements from the PR's content and hands them to codeowners-plus as a JSON file via the new
oracle-filesinput. The rules are AND-merged into.codeowners-derived ownership through the existingMergeCodeOwnerspath, so review requesting, approval tracking, smart dismissal, and the status check apply unchanged.Design properties:
.codeownersrules, so a tampered oracle file can at worst request extra reviews.Code Changes
pkg/oracle: JSON rule format,Parse/Loadwith strict validation,RuleSet.ToCodeOwnerspkg/codeowners:NewFromFileOwnersconstructor for computed ownershipinternal/app:applyOraclesmerge step;main.go/action.yml:oracle-filesinputsplitOracleFiles