Skip to content

feat(search): Index organizations and projects - #331

Merged
kevwilliams merged 1 commit into
mainfrom
feat/search-index-orgs-projects
Nov 16, 2026
Merged

kevwilliams merged 1 commit into
mainfrom
feat/search-index-orgs-projects

Conversation

@kevwilliams

Copy link
Copy Markdown
Contributor

Problem

There is no ResourceIndexPolicy for resourcemanager.miloapis.com Organization or Project. Because of that, the search service never indexes them, and the staff portal's global search can never return an organization or a project. For example, searching manifold (an existing organization) only finds users and contacts whose emails contain that word. See datum-cloud/staff-portal#840.

Change

This PR adds two policies under config/services/search.miloapis.com/ and lists both in its kustomization.yaml.

  • organization-resourceindexpolicy.yaml indexes metadata.name and the kubernetes.io/display-name and kubernetes.io/description annotations as searchable. It also stores spec.type (Personal or Standard), but not as a searchable field.
  • project-resourceindexpolicy.yaml indexes the same name and annotation fields, plus spec.ownerRef.name (the owning organization), so searching for an organization's name also finds its projects.

Both follow the same layout as the existing Contact and DNSZone policies.

Testing

kustomize build config/services/search.miloapis.com succeeds and outputs 9 ResourceIndexPolicy objects, up from 7.

I haven't confirmed whether existing organizations and projects are indexed as soon as these policies are applied, or only when each object next changes. If it's the latter, a re-index may be needed after this deploys.

There was no ResourceIndexPolicy for resourcemanager Organization or
Project, so the search service never indexed them and staff-portal
search could never return an organization or project.
@kevwilliams
kevwilliams requested a review from a team November 16, 2026 21:14
@kevwilliams
kevwilliams merged commit 5f9d048 into main Nov 16, 2026
10 checks passed
@kevwilliams
kevwilliams deleted the feat/search-index-orgs-projects branch November 16, 2026 21:21
kevwilliams added a commit that referenced this pull request Nov 16, 2026
## Problem

There is no `ResourceIndexPolicy` for `billing.miloapis.com`
BillingAccount, so the search service never indexes billing accounts and
they can't be found through search.

## Change

This PR adds
`config/services/search.miloapis.com/billingaccount-resourceindexpolicy.yaml`
and lists it in that folder's `kustomization.yaml`. The following fields
are searchable:

- `.metadata.name`
- `.metadata.annotations["kubernetes.io/display-name"]`
- `.spec.contactInfo.email`: the billing contact's email
- `.spec.contactInfo.invoiceEmails[*]`: the addresses invoices are sent
to
- `.status.paymentArrangement.invoice.purchaseOrderNumber`
- `.status.paymentArrangement.invoice.agreementReference`: the signed
MSA or order form, when there is one

The last two only exist on accounts with an active Invoice arrangement.

Contact names, postal addresses and tax IDs are left out on purpose.

## Testing

`kustomize build config/services/search.miloapis.com` succeeds and
outputs 10 `ResourceIndexPolicy` objects, up from 9.

As with the organization and project policies in #331, I haven't
confirmed whether existing billing accounts are indexed as soon as this
is applied, or only when each account next changes.
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.

2 participants