:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Changelog
Notable changes to the owners-yaml package. The format follows
Keep a Changelog, and versions follow
semantic versioning.
publish-owners-yaml.yml reads the section matching the tagged version and uses it as
the GitHub Release body, so add the entry here before you cut the tag.
Unreleased
Added
- The resolution of a path that the resolver's tree does not hold carries
added: the first part of the path, from the root, that the tree does not hold as a directory, and the owners of additions there. Resolved against the tree before a change, this names the new directory for every file a change adds, so a consumer can useadditionswithout its own tree walk.nullwhen the tree holds the path, or when the resolver reads only ownership files. SPEC sections 4 and 7.2 define it. - An optional
sensitivefield, at file level and in rules, marks paths where a small change can change behavior far outside the change. The nearest value wins, as forstatus. The format only states the fact; a consumer decides what to do with it, for example a review assigner that requests the owners for each change. It never makes a review required. An alias file such asproduct.yamlcan set it too, so a manifest that already used asensitivekey for another purpose now marks its paths as sensitive.SPEC.mdsection 3.7 defines it. - The resolver response carries a
sensitivemember, andResolutionasensitivefield. A consumer treats a missing member asfalse. lintwarns about a sensitive path that has no owners, because a consumer has no owner to request a review from.unowned_test_directories(resolver, paths)returns the directories that hold a test file no team owns.GitRefSourcereads ownership files as a git ref holds them, so a check can read what a push carries.
Changed
- A field that a tool does not know is a warning, not an error, at the top level, in a rule, in
teams, and incodeowners. A file that uses a field from a newer release then still passes an olderlint.parse_owners_filetakes an optionalwarningslist that collects them. SPEC section 3 adds the rule that an amendment only adds a field that a tool can safely ignore.
Fixed
censusno longer counts files thatowners: nullexempts underunowned, as SPEC section 3.1 requires.
0.3.0
Added
--producer NAMEonowners resolveand onpython -m owners_yaml, and aproducerargument onOwnersResolver. Without it, a team that mapsnotificationsper producer was never matched, so every bot fell back to the team'sslackchannel. A name the root file'sproducerslist does not declare is an error, because it would silently route to the people channel. SPEC section 7.1 now defines the producer as part of a resolver request.- An optional
additionsfield, at file level and in rules, names the owners of additions below a directory, separate from the owners of the files in it. The format only names them; a consumer decides what counts as an addition and what to do with the list. Unlikeowners, the owners of additions from every file on the walk and every matching rule add up, andinherit: falsestill cuts them.SPEC.mdsection 3.6 defines it. - The resolver response carries an
additionsmember, andResolutionanadditionsfield. Consumers that ignore unknown members, as SPEC section 7.4 requires, are unaffected. SPEC section 7.4 requires a consumer to treat a missing member as an empty array. lintfails on a rule that names a tracked directory without the trailing/, such asdocsfordocs/. A literal last segment also matches a file of that name, so the slash says which one is meant.- Conformance cases may state
additions. A case that leaves it out expects an empty list, so existing cases need no edit.
Changed
- Path normalization removes a trailing
/.products/new/andproducts/newnow resolve alike; before, the slash put the directory's own ownership file on the walk. - Every matching rule in a file now applies, and each replaces only the fields it sets. Before, the last matching rule replaced the earlier ones entirely, so a rule that set only
statusdropped theownersan earlier rule had set.SPEC.mdsection 3.4 records the amendment.
Docs
- The PyPI project page links to the new website, owners-yaml.posthog.dev, as its homepage. The README links to it too.
- The
notificationsexample in the README and the command next to it now agree: a per-producer mapping needs--purpose notifications --producer review-bot. A plain channel string covers all automation. - The install section warns that the PyPI project named
ownersis a different package. Always writeowners-yaml. - "Lint in CI" says what plain
lintdoes not check: it does not know which teams exist,lint --liveasks GitHub through theghCLI, andwhoandresolveanswer from the parent directory when a file does not parse. - SPEC section 10 and the README record a non-goal: CODEOWNERS is an export target and a one-time migration source, never a second input format.
0.2.0
First release on PyPI, as owners-yaml. The package was developed in the monorepo as posthog-owners and never published under that name.
Added
SPEC.mddefines theowners.yamlformat, version 1, with the resolution steps, a field merge table, a flow diagram, and a worked example.owners.schema.jsondescribes the file for editors.SPEC.mdsection 7 defines the resolver interface, andresolution.schema.jsondescribes its JSON response.conformance/holds language-neutral test cases for the resolution rules, which any implementation can run.publish-owners-yaml.ymlpublishes the package to PyPI when anowners-yaml-v*tag is pushed.- Root-only repo settings in
owners.yaml:github_org,producers,reserved_dirs,alias_files, andcodeowners. alias_filesdeclares the file names, besidesowners.yaml, that count as ownership files. It defaults to[product.yaml], so a root file that predates the setting keeps resolving as before; a declared list replaces the default, andalias_files: []turns alias files off.--repo-rooton every CLI command, and--orgonlintandcodeowners.- A tree that is not a git worktree is read from disk, so the CLI works on an export or a scratch copy.
owners_yaml.github.GitHubOrgvalidates team slugs and handles without any host tooling.- An
owners-yamlconsole script, souvx owners-yamlworks without--from. BatchOwnershipSource, a source that fetches a batch's ownership files together.OwnersResolver.map()calls itsread_allbefore it reads any file: first for the rootowners.yaml, then for the batch.- The top-level
owners_yamlpackage exports the full public API, so consumers do not import submodules. py.typed, so type checkers read the package's annotations.
Fixed
- Rule patterns support
[abc],[a-z]and[!abc]character classes, as SPEC section 3.5 now states.match_is_globalready counted[as a wildcard, so such a pattern passed lint, counted as a crosscutting glob, then matched nothing and let its paths fall through to an ancestor's owner.
Changed
- The GitHub organization is no longer hardcoded.
codeownersandlint --liveread it fromgithub_orgor--org, and fail with a clear message when neither is set. - Producer names are no longer hardcoded. A repo that declares
producersgets typo checks; a repo that does not accepts any name. - The reserved
products/**/mcp/**location moved from the code into PostHog's ownreserved_dirs..github/workflows/**stays built in. - The CODEOWNERS projection reads its Jest spelling rules from the
codeownerssettings instead of PostHog's layout. - Outside a git worktree and without
--repo-root, the CLI prints an error instead of a traceback. version: trueandversion: 1.0no longer count asversion: 1, so such a file counts as absent.product.yamlis no longer a PostHog convention baked into the code. It is the default value ofalias_files, which a root file can replace or empty.
0.1.0
First version, used inside the PostHog monorepo only.