Skip to content

fix: Declare the owner of compute's activity policies - #657

Merged
vvoytovych merged 1 commit into
mainfrom
fix/activity-policy-owners
Nov 17, 2026
Merged

vvoytovych merged 1 commit into
mainfrom
fix/activity-policy-owners

Conversation

@vvoytovych

Copy link
Copy Markdown
Contributor

Why

The activity processor reads the owner of an activity policy from its meta.datumapis.com/service and meta.datumapis.com/team labels (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

  • The policies' kustomization in config/milo/activity/policies sets meta.datumapis.com/service: compute and meta.datumapis.com/team: build on every policy, by kustomize labels:. The platform's service catalog lists this repository under the compute service, team build.
  • The labels sit on the kustomization, not on each policy, so a policy added to the folder takes the owner with it.
  • A new test, 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

  • The new test fails on main and passes with this change. It also fails on an empty team, on the team compute, 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.

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.
@vvoytovych vvoytovych self-assigned this Nov 17, 2026
@vvoytovych
vvoytovych marked this pull request as ready for review November 17, 2026 16:42
@vvoytovych
vvoytovych requested a review from a team as a code owner November 17, 2026 16:42
@vvoytovych
vvoytovych merged commit aa5b2ff into main Nov 17, 2026
14 checks passed
@vvoytovych
vvoytovych deleted the fix/activity-policy-owners branch November 17, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants