Repository navigation
feat(cloud-tenants): a tenant serves several customers, so its row names the first and counts the rest CU-17tkuw5z06b - #2796
Conversation
…mes the first and counts the rest CU-17tkuw5z06b Directory connections now bind many customers through attribution rules (openframe-saas-tenant#4136). TenantRow.customer becomes customers (earliest attached first, empty while it serves none); TenantCustomerCell draws the first customer and a muted "+N", or the empty mark. The product-demo fixture gains a tenant shared by two customers.
🦩 Flamingo Code Review❌ Tests and checks failed on this commit: Trivy. What each printed is in the Tests and mutation section. 1 finding: 🔴 0 action required · 🟠 0 recommended · 🔵 1 informational Advisory: findings do not block the merge. 1 defect outside any rule
🔵 Informational (1)
✅ What this change does well
Inline comments: 0 new · 1 already on this pull request from an earlier review (not posted again; the existing thread is linked below) Already commented on by an earlier review
1 possible problem checked and ruled out
🧪 Tests and mutationTests per lane
Checks
Trivy failed in .: what it printed lastJava (Maven): 3941 tests run, 0 failed, 291 skipped; the skips include the change's gated ITs, run by hand on this code with -Dintegration.tests=true and Docker: all green. Java mutation on the change's new lines: client-core 55 killed / 5 survived / 2 uncovered (was 51/7/2: the new userId tests kill the registration mutant, and MachineStatusService.write no longer returns an unread value), api-lib 13/4/2, api-service-core 7/0/0, data-pinot 12/6/0, pinot-initializer 12/1/0, management-service-core 1/4/0, data-mongo-sync 4/0/9 (the 9 are covered only by the gated IT). DeviceService (openframe-api-lib) shows no PIT coverage on updateStatusByMachineId because its tests live in openframe-api-service-core; not a real gap. TypeScript (frontend-core): vitest related 4972 tests pass, including the new use-tag-filter-modal and tenants-table-view tests; lint, lint:types, lint:cycles, type-check and format pass. No Stryker, so no TypeScript mutation. Trivy failed for the environment again, not the change: walking openframe-frontend-core/node_modules (installed by this run) it hit 'too many open files in system'. CI's own scan covers the change. Mutation testingThis build has no PIT plugin, so each module is mutated from the command line with pit-adhoc.sh, changing nothing in the repository.
New code, its covering tests and the result
The covering tests by name (37 methods)
What the surviving mutations leave unverified
33 mutants on lines this change added are not caught (20 survived, 13 with no test reaching them): each is annotated on its line in the 6 gaps (not tested here):
Change set
🤖 Prompt for AI agents: fix every findingNext: commit a suggestion, or hand a comment's prompt to your coding agent. React 👍 on a finding that helped and 👎 on one that is wrong: the reviewer learns from both. Review again. New commits are not reviewed until you ask:
Or comment Updated 2026-11-02 16:29 UTC · reviewed from Andrii Kachur's machine |
…nection-customers
…y-connection-customers
…r claims CU-17tkuw5z06b The Customers column's count line reads "30 of 412 unattributed" in the warning colour while some synced users belong to no customer (Figma 3025-3536), and the user count otherwise. TenantRow gains unattributedUserCount and the lib exports unattributedLabel, so the app's details card says it the same way. The product-demo fixture's shared Acme tenant leaves 14 users unattributed.
…stomers come in the host's order CU-17tkuw5z06b
…s-lib into feature/directory-connection-customers
…as no wrapper at all CU-17tkuw5z06b
…ield has no wrapper Same change as in #2796, so whichever lands first merges cleanly into the other.
…nection-customers
…nection-customers
…/directory-connection-customers. CU-17tkuw5z06b
…nto feature/directory-connection-customers. CU-17tkuw5z06b
….0.813) into feature/directory-connection-customers. CU-17tkuw5z06b
…0.0.815) into feature/directory-connection-customers. CU-17tkuw5z06b
…sed and never-read lines CU-86akgr5x2 - TenantsTableView takes `filters`: the Tenant, Customers, Licences and Access funnels, drawn only when the host offers them - TenantRow carries `licenses` and `syncPaused`; the access line says "Sync paused", a tenant never read says so under its customer - a phone keeps the tenant, the access tag and open (Figma 3033-9343); a tablet drops the licence cells and keeps the funnel (3032-4579) - "257 users" in lower case, as phase 2 draws it
…kgr5x2 - DevicesPanelView and DevicesTableBody take `directoryColumns`, off by default, so the pickers and product-demo keep their columns - getDeviceFilterColumns takes it too, and the phone's filter window carries `userLinks` and `directorySources` - device-directory.ts holds the labels and the USER cell's lines: the primary user's name, Shared with its recent users, or none - SOURCES names Microsoft 365 and Google Workspace only, the agent is never listed as a source - the toolbar takes `searchPlaceholder`: "Search for Devices and Users" with the columns on
…build again. CU-86akgr5x2
…SER device filters CU-86akgr5x2 (#2910) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… an empty funnel keeps its header CU-17tkuw5z06b Review findings on #2796: - useTagFilterModal sends userLinks/directorySources as [] when the modal leaves their group out (unticked or Reset), for hosts that draw the directory columns. FilterModal drops an empty group and setParams only writes the keys it gets, so the old filter stayed in the URL. - TenantsTableView declares meta.filter for a column whose options came back empty: below lg only a filtered column keeps its header. - AgentRegistrationServiceTest: a reinstall records the userId it is sent and keeps the stored one when it is blank. - Conventions: Optional pipelines in FleetHostFactsWriter and MachineStatusService, one-line comments instead of Javadoc in CustomMachineRepository, the schema name as a local in PinotConfigInitializer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nection-customers
…arries SOURCES where its header cannot CU-86akgr5x2 - useTagFilterModal decides on the content area's step, not the window's: with a side panel docked the table drops its header while the window stays wide, and the list had no filter anywhere. - Beside the customer column SOURCES shows from xl, so from lg until then the filter window carries it (getDeviceFilterColumns' roomyDirectory, the table's own rule). - DatePicker, DatePickerInput and DatePickerInputSimple take an id for their trigger, so a label outside names it.
…te it shows CU-86akgr5x2
…, where its header has no funnel CU-86akgr5x2 - useContentXlUp: the content-xl step in JS (the viewport's outside a content area). AppLayout publishes the area's width on that crossing too (contentStepFor), so a reader of it re-renders when the area passes xl. - From xl the header shows SOURCES beside the customer column again, so the window leaves it there. The column flag is named for its range: inWindowLgToXl.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…akgr5x2 - presentationFor moves to one private util with a real own-key guard. The tenant presentation and the device directory labels both use it, so an inherited key such as toString no longer answers. - The device directory's link and source tables are typed unions (DeviceDirectoryUserLink, DeviceDirectorySource), exported from the devices barrel. - The tag filter window reads useContentMdUp and useContentLgUp; the xl viewport query lives in breakpoints. - The tenants table writes its funnels back over TENANTS_TABLE_FILTER_COLUMNS, and the device column options type is named once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctor The package-private test constructor made Spring look for a no-arg one, so any service with the pinot initializer (shared management) failed to start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the draft script arguments of #2963 to this branch, which tenant main now needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…customers Conflicts, both sides kept: - DeviceHeartbeatOfflineDetectionService (main + test): both sides moved the offline sweep to a guarded MachineWriter write. Keeps the branch's status guard for an uninstall, its marked count and log, and main's telemetry guard for a machine whose status is not ONLINE, and every test of both sides. - CustomMachineRepositoryImpl: main's version $inc on updateLastSeen and the branch's Fleet host facts queries. - MachineFields: one TELEMETRY_STATUS, the branch's FIRST_CONNECTED_AT. - MachineWriterTest: the branch's field tests and main's publishing tests. - DeviceServiceTest, AgentUninstallServiceTest: the branch's field-level asserts with main's cleanUpDeletedMachine rename. Four ITs that build a MachineWriter pass the absent publishing providers main added to its constructor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Machine gained @Version on main, so Spring adds $inc +1 to any update that does not touch the field. markHostFactsChecked is a background stamp like updateLastSeen, and it runs on up to 200 machines per backfill run: without this it would fail a user's save of a machine read just before the stamp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…customers Picks up ac2e565 (#2971). DeviceService auto-merged: the connectivity sync runs before the field-level write, as on main. Conflict, both sides kept: - DeviceServiceTest: main's four connectivity tests and the branch's field-level tests. Main's tests reach the write, so each stubs the MachineWriter update with stubStatusWrite. MachineFieldLevelWritesIT, which main does not have, passes a mocked DeviceSoftwareConnectivitySync to the DeviceService constructor main extended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test Micrometer gauges hold their object weakly. batchSizeGaugePublishesConfiguredThreshold kept no reference to DeviceOnlineDispatchMetrics, so a GC before the read made the gauge return NaN and failed the CI publish. A forced System.gc() reproduces it. The instance is now a test field, which also covers the two tests that held it in a local. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…17tkuw5z06b The loading standard's whole-src scan fails on lib main since #2967 (its Node build was skipped): a literal default for loadingActionCount, a typed count in the PDF viewer, and skeleton buttons without data-loading-item. Every lib PR that takes main inherits the failure and gets no preview build.
…lt, multi-customer behind a variant CU-17tkuw5z06b Tenant Management Phase 2 ships behind tenant-management-v2, and the frontend renders main's tenants list while it is off, so one core release has to serve both. TenantsTableView renders lib main's single-customer table, its markup and classes unchanged, unless variant="multi-customer". TenantRow is lib main's single-customer row again, so main's app compiles after a core bump and a multi-customer host that forgets the variant does not compile; MultiCustomerTenantRow is phase 2's row. usersCountLabel keeps lib main's 'N Users'. The product page shows what production runs: lib main's fixture.
…raw 9.1.1 drops CU-17tkuw5z06b hast-util-raw 9.1.1 (2026-11-06, "Fix whitespace in head, tables, etc") stops emitting the newline text node between <article> and a GFM table's wrapper. The lib commits no lockfile, so every Node build resolves it, and the three table fixtures fail on lib main and every PR. The markup is otherwise identical.
…nection-customers # Conflicts: # openframe-frontend-core/src/components/embeds/embed-viewer-frame.tsx # openframe-frontend-core/src/components/embeds/pdf-viewer.tsx
Change-Set: feature-directory-connection-customers
ClickUp task: CU-17tkuw5z06b [Tenant Management] Sync Attribution Rules
Why
A directory connection now serves several customers, each bound by attribution rules (flamingo-stack/openframe-saas-tenant#4136, flamingo-stack/openframe-saas-lib#1077). The tenants list's Customer column drew a single
customer, so a tenant shared by two customers lost the second.What
TenantRow.customer→customers: readonly TenantCustomer[]: earliest attached first, empty while the tenant serves none.TenantCustomer({ name, imageUrl? }) is exported.TenantCustomerCelldraws the first customer's avatar and name with a muted+Nfor the rest, or the empty mark when there is none. The count line keeps its loading state.TenantRow.unattributedUserCount, andunattributedLabelis exported so the app's details card words it the same way.TenantRowchanges shape: the openframe-frontend container moves tocustomersin the same change set and pins this PR's preview build.Verified
npm run build, then yalc-linked into openframe-frontend: its tsc and lint pass with the container mappingcustomers.Change set
flamingo-stack/openframe-oss-lib#2796: these pull requests are one change, reviewed together.Linked work
Linked by the
Depends-On/Change-Setlines in these descriptions; this block is maintained by the hub.