Repository navigation
feat: feedback CRDs and operator scaffold - #32
Merged
Merged
Conversation
Replace the aggregated apiserver with CRDs installed in Milo and a controller-runtime operator, following billing. Every v1alpha1 kind is a cluster-scoped CRD; user-owned kinds carry spec.userRef and declare it as Milo's owner field, and posts declare spec.hidden as the hidden field. Staff-only fields move to SubmissionReview and SecurityReportTriage. FeedbackProfile and FeedbackDigest are new. CEL rules enforce vote and follow names, immutable specs and complete review decisions; an envtest suite checks them against a real API server.
This was referenced Nov 17, 2026
Closed
scotwells
previously approved these changes
Nov 17, 2026
# Conflicts: # .github/workflows/ci.yaml # go.mod # go.sum
|
Non-blocking follow-up: readiness currently returns success before the webhook server is necessarily serving TLS ( |
Readiness was a plain ping, so a new operator pod could take webhook traffic before its TLS listener was up, and Milo's fail-closed webhooks would refuse requests during rollouts. Use the webhook server's StartedChecker instead. Document what must ship before the API is enabled for users: the Metadata-only audit policy, Milo's owner filtering, and the user and public-reader bindings.
Contributor
Author
|
Done in 2cea230: readiness now includes the webhook server's |
scotwells
approved these changes
Nov 18, 2026
This was referenced Nov 18, 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.
Closes #2. First PR of the CRD rewrite: the design moved from an aggregated apiserver with Postgres to CRDs in Milo with an operator, like billing (design change). This replaces #16 and the Postgres stack (#22, #23, #25–#31), which I'm closing.
What's here
config/crd, for installing in Milo.feedback operatorcommand. It's a controller-runtime manager pointed at Milo with--milo-kubeconfig, plus a webhook server, health probes, metrics, and leader election in the local cluster. No controllers or webhooks are registered yet; they come in the next PRs.config/base/operator: Deployment, Services, PDB and leader-election RBAC.config/components/milo-integration: Milo kubeconfig, client certificate and webhook certificate from thedatum-control-planeissuer, the same way billing does it.API changes from the Postgres version
Vote,Subscription,Submission,SecurityReportandFeedbackProfilecarryspec.userRef. They declareiam.miloapis.com/owner-field: spec.userRef.nameand make it a selectable field.<post>.<user>, enforced by CEL.Postdeclaresiam.miloapis.com/hidden-field: spec.hidden.getonposts/hidden.SubmissionReviewCRD: triage and the staff decision (Approved,Merged,Rejected,MoveToSecurity). CEL makes the decision immutable once set and requires its fields.reviewandto-security-reportsubresources and the submitter redaction. A CRD can't hide a field from some readers, so staff-only data lives on a staff-only kind.SecurityReportTriageCRD.status.internalon reports, for the same reason.FeedbackProfileandFeedbackDigestCRDs.votes.trendingScoreis an integer (score × 1000).feedback.miloapis.com/{org,status,stage}andcategory.feedback.miloapis.com/<category>labels.PostQuery,AttachmentUploadandSubmissionToSecurityReport.Tests
task testnow fetches envtest binaries and runspkg/apis/.../crd_test.goagainst a real API server with the generated CRDs. It covers:spec.hidden!=truefilters out hidden posts;envtestjob inci.yamlruns these tests.ci-basicruns plaingo test, so they skip there.go vet ./...,task test, andtask generatewith no diffkustomize buildofconfig/base,config/overlays/core-control-planeandconfig/crd