Repository navigation
fix: Declare the owner of compute's activity policies - #657
Merged
Merged
Conversation
The activity processor reads a policy's owner from its meta.datumapis.com/service and meta.datumapis.com/team labels, and the alerts for a failing policy take their service and team from them. Compute's four policies set neither, so their alerts fall back to the platform team. The policies' kustomization now sets both labels, compute and build, as the platform's service catalog lists this repository. A policy added to the folder takes them too. A new test fails when the labels are missing or wrong, or when a policy file is not in the kustomization's resources.
scotwells
approved these changes
Nov 17, 2026
JoseSzycho
approved these changes
Nov 17, 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.
Why
The activity processor reads the owner of an activity policy from its
meta.datumapis.com/serviceandmeta.datumapis.com/teamlabels (policy_ownership.go). The alerts for a failing policy go to the team those labels name. A policy without them alerts the platform team (dlq-alerts.yaml).None of compute's four activity policies has these labels, so a failing compute policy alerts the platform team, not build.
What
config/milo/activity/policiessetsmeta.datumapis.com/service: computeandmeta.datumapis.com/team: buildon every policy, by kustomizelabels:. The platform's service catalog lists this repository under the compute service, team build.TestEveryPolicyDeclaresItsOwner, fails when the kustomization sets no owner or a wrong one, or when a policy file in the folder is not in its resources.Milo's own activity policies got the same labels in milo-os/milo#1012.
Testing
mainand passes with this change. It also fails on an empty team, on the teamcompute, and on a policy file left out of the resources.kustomize build config/milo/activity: all four policies carry both labels, and nothing else in the policies changes.go test ./test/activitypolicy/and golangci-lint pass.