Skip to content

feat(cloud-tenants): a tenant serves several customers, so its row names the first and counts the rest CU-17tkuw5z06b - #2796

Merged
andriikachur merged 38 commits into
mainfrom
feature/directory-connection-customers
Nov 9, 2026
Merged

andriikachur merged 38 commits into
mainfrom
feature/directory-connection-customers

Conversation

@oleksandr-blip

@oleksandr-blip oleksandr-blip commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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.
  • TenantCustomerCell draws the first customer's avatar and name with a muted +N for the rest, or the empty mark when there is none. The count line keeps its loading state.
  • The count line reads "30 of 412 unattributed" in the warning colour while some synced users belong to no customer (Figma 3025-3536): TenantRow.unattributedUserCount, and unattributedLabel is exported so the app's details card words it the same way.
  • Product-demo fixture: Acme's Microsoft 365 tenant also serves Harbor, and its rules leave 14 users unattributed.

TenantRow changes shape: the openframe-frontend container moves to customers in the same change set and pins this PR's preview build.

Verified

  • Pre-commit (eslint, prettier on the staged files) and pre-push (type-check, eslint) pass.
  • npm run build, then yalc-linked into openframe-frontend: its tsc and lint pass with the container mapping customers.
  • Not rendered in a browser, and the lib's test suite was not run.

Change set flamingo-stack/openframe-oss-lib#2796: these pull requests are one change, reviewed together.

  • flamingo-stack/openframe-oss-lib#2796 (this pull request): feat(cloud-tenants): a tenant serves several customers, so its row names the first and counts the rest CU-17tkuw5z06b · landed
  • flamingo-stack/openframe-oss-frontend#690: feat(tenants): a directory serves several customers, each claiming its accounts by attribution rules CU-17tkuw5z06b · landed
  • …and 8 pull requests not visible

Linked work

Linked by the Depends-On / Change-Set lines in these descriptions; this block is maintained by the hub.

…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.
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦩 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

Files Lines Languages Tests Checks 🔴 Action required 🟠 Recommended 🔵 Informational
93 +4882 / -322 Java (1 Maven lane), TypeScript (1 npm lane) ✅ 8622 / 8622 green (291 skipped) ❌ 6 / 7 passed 0 0 1

🔵 Informational (1)

# Where Finding Flagged by
1 CustomMachineRepositoryDueForFleetHostFactsIT.java:32 The change's 8 ITs never run in CI: they are gated on -Dintegration.tests=true Tests and mutation

✅ What this change does well

  • MachineStatusService.java extracts the multi-line ifPresentOrElse lambdas into named methods (announceTransition/recordPresenceOnly), satisfying OFJAVA-004 while preserving the original branching semantics.
  • tenants-table-view.test.tsx and use-tag-filter-modal.test.ts add focused tests that exercise the exact behavior change being made (empty-options funnel, directory-group clearing on filter reset).
  • PinotConfigInitializer.java extracts the repeated desired.get("schemaName") call into a single named local (OFJAVA-002 style), avoiding duplicate parsing and improving the log statement's accuracy.
  • DeviceHeartbeatOfflineDetectionService and MachineStatusService write field by field through MachineWriter with lastSeen / status guards, so a heartbeat or uninstall that lands meanwhile is no longer overwritten by a whole-document save.
  • DeviceFilterFacet.REST keeps the external API's /filters off the two new Pinot facet queries its DTO cannot carry.
  • FleetHostFactsWriter only writes while every field it sets is still blank, so a value the agent reports between read and write always wins.
  • use-tag-filter-modal.test.ts and tenants-table-view.test.tsx pin the two review fixes: a cleared USER / SOURCES group clears its param, and an empty funnel still declares meta.filter.
  • AgentRegistrationServiceTest now proves a reinstall records the userId it is sent and keeps the stored one when blank.

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

  • 🔵 Informational · info · Tests and mutation · openframe-data-mongo-sync/src/test/java/com/openframe/data/repository/device/CustomMachineRepositoryDueForFleetHostFactsIT.java:32: The change's 8 ITs never run in CI: they are gated on -Dintegration.tests=true (existing thread)
1 possible problem checked and ruled out
  • openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/device/CustomMachineRepository.java:13 CustomMachineRepository is changed and no test references it: Interface methods are tested via CustomMachineRepositoryDueForFleetHostFactsIT and CustomMachineRepositoryHostFactsCheckedIT, both added in this PR, which exercise the implementation of this contract.

🧪 Tests and mutation

Tests per lane

Language Project Command Status Counts Time
Java (Maven) . mvn -B test -pl openframe-api-lib,openframe-api-service-core,openframe-client-core,openframe-data-device-aspect,openframe-data-kafka,openframe-data-mongo-common,openframe-data-mongo-sync,openframe-dat ✅ passed openframe-agent-key 4 · openframe-api-lib 611 · openframe-api-service-core 772 (44 skipped) · openframe-client-core 403 (4 skipped) · openframe-core 150 · openframe-core-crypto 8 · openframe-data-cassandra 20 · openframe-data-kafka 33 · openframe-data-loki 96 · openframe-data-mongo-sync 488 (214 skipped) · openframe-data-nats 154 (4 skipped) · openframe-data-pinot 75 · openframe-exception 4 · openframe-external-api-service-core 598 · openframe-graphql-node 76 · openframe-graphql-relay 69 · openframe-machine-delivery 138 · openframe-management-service-core 28 (3 skipped) · openframe-notification-core 103 (22 skipped) · openframe-notification-mail 4 · openframe-pinot-initializer 6 · openframe-presence 12 · openframe-security-core 38 · fleetmdm 51 · 0 failures 186.5 s
TypeScript (npm) openframe-frontend-core npx vitest related --run src/components/features/cloud-tenants/index.ts src/components/features/cloud-tenants/tenant-access-cell.tsx src/components/features/cloud-tenants/tenant-customer-cell.tsx src/ ✅ passed 4972 run, 0 failures 42.8 s

Checks

Check Kind Language Project Status Time
lint lint TypeScript (npm) openframe-frontend-core ✅ passed 1.8 s
lint:config-smoke lint TypeScript (npm) openframe-frontend-core ✅ passed 0.7 s
lint:cycles lint TypeScript (npm) openframe-frontend-core ✅ passed 560.6 s
lint:types lint TypeScript (npm) openframe-frontend-core ✅ passed 41.7 s
type-check typecheck TypeScript (npm) openframe-frontend-core ✅ passed 2.5 s
format format TypeScript (npm) openframe-frontend-core ✅ passed 12.5 s
Trivy security Java (Trivy) . ❌ failed 11 s
Trivy failed in .: what it printed last
2026-11-02T16:26:49Z	INFO	[vuln] Vulnerability scanning is enabled
2026-11-02T16:26:49Z	WARN	[pom] Dependency version cannot be determined. Child dependencies will not be found.	details="https://trivy.dev/docs/v0.74/guide/coverage/language/java#empty-dependency-version"
2026-11-02T16:26:59Z	FATAL	Fatal error	run error: fs scan error: scan error: scan failed: failed analysis: analyze with traversal: walk dir error: unknown error with openframe-frontend-core/node_modules/react-stately/dist/private/intl/color/fr-FR.js: file info error: lstat openframe-frontend-core/node_modules/react-stately/dist/private/intl/color/fr-FR.js: too many open files in system
trivy did not finish the scan of the change

Java (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 testing

This build has no PIT plugin, so each module is mutated from the command line with pit-adhoc.sh, changing nothing in the repository.

Module Classes Whole classes New lines only Time
api-lib DeviceFilterFacet, DeviceFilterService, DeviceService 140 mutants, 25 killed (18%), 11 survived, 104 no coverage, test strength 69%, line coverage 31% 19 mutants: 13 killed, 4 survived, 2 no coverage 40 s
api-service-core DeviceDataFetcher, ForceClientUninstallService, GraphQLDeviceMapper 83 mutants, 42 killed (51%), 3 survived, 38 no coverage, test strength 93%, line coverage 54% 7 mutants: 7 killed 29 s
client-core AgentRegistrationService, AgentUninstallService, FleetHostFactsBackfillScheduler, FleetHostFactsBackfillService, FleetHostFactsWriter, FleetMdmAgentIdTransformer, FleetMdmClients, MachineHostnameService, MachineStatusService, MachineTimezoneService 162 mutants, 133 killed (82%), 18 survived, 11 no coverage, test strength 88%, line coverage 92% 62 mutants: 55 killed, 5 survived, 2 no coverage 26 s
data-kafka 0 mutants, 0 killed (0%) none on added lines 12 s
data-mongo-sync CustomMachineRepositoryImpl 185 mutants, 136 killed (74%), 12 survived, 37 no coverage, test strength 92%, line coverage 75% 13 mutants: 4 killed, 9 no coverage 26 s
data-pinot PinotClientDeviceRepository 47 mutants, 29 killed (62%), 18 survived, test strength 62%, line coverage 93% 18 mutants: 12 killed, 6 survived 16 s
external-api-service-core DeviceController 8 mutants, 8 killed (100%), test strength 100%, line coverage 100% none on added lines 21 s
management-service-core DeviceHeartbeatOfflineDetectionService 9 mutants, 4 killed (44%), 5 survived, test strength 44%, line coverage 100% 5 mutants: 1 killed, 4 survived 17 s
pinot-initializer PinotConfigInitializer 47 mutants, 26 killed (55%), 11 survived, 10 no coverage, test strength 70%, line coverage 65% 13 mutants: 12 killed, 1 survived 16 s
data-device-aspect MachineTagEventServiceImpl Gap: the module has no tests, so PIT was not run (every mutant would survive)
data-mongo-common DirectorySource, DirectoryUserLink, Machine, MachineQueryFilter Gap: the module has no tests, so PIT was not run (every mutant would survive)

New code, its covering tests and the result

New code Covering tests Result
getDeviceFilters in DeviceFilterService, lines 88-100 DeviceFilterServiceTest (3), 12 more killed
lambda$getDeviceFilters$0 in DeviceFilterService, line 106 DeviceFilterServiceTest (3), 3 more killed
lambda$getDeviceFilters$1 in DeviceFilterService, line 108 DeviceFilterServiceTest (3), 1 more Survived: line 108: replaced return value with Collections.emptyMap for DeviceFilterService::lambda$getDeviceFilters$1
lambda$getDeviceFilters$2 in DeviceFilterService, line 110 DeviceFilterServiceTest (3), 1 more Survived: line 110: replaced return value with Collections.emptyMap for DeviceFilterService::lambda$getDeviceFilters$2
lambda$getDeviceFilters$3 in DeviceFilterService, line 112 DeviceFilterServiceTest (3), 1 more Survived: line 112: replaced return value with Collections.emptyMap for DeviceFilterService::lambda$getDeviceFilters$3
lambda$getDeviceFilters$4 in DeviceFilterService, line 114 DeviceFilterServiceTest (3), 1 more Survived: line 114: replaced return value with Collections.emptyMap for DeviceFilterService::lambda$getDeviceFilters$4
lambda$getDeviceFilters$5 in DeviceFilterService, line 116 DeviceFilterServiceTest (3), 1 more killed
lambda$getDeviceFilters$6 in DeviceFilterService, line 118 DeviceFilterServiceTest (3), 1 more killed
lambda$getDeviceFilters$7 in DeviceFilterService, line 120 DeviceFilterServiceTest (3), 10 more killed
queriedFacets in DeviceFilterService, lines 139-144 DeviceFilterServiceTest (3), 12 more killed
lambda$updateStatusByMachineId$1 in DeviceService, line 364 none no coverage (line 364)
updateStatusByMachineId in DeviceService, line 368 none no coverage (line 368)
directorySources in DeviceDataFetcher, line 209 DeviceDataFetcherTest (1) killed
directoryUserLink in DeviceDataFetcher, line 215 DeviceDataFetcherTest (1) killed
directoryUserIds in DeviceDataFetcher, line 221 DeviceDataFetcherTest (1) killed
toDirectorySources in GraphQLDeviceMapper, line 73 GraphQLDeviceMapperTest (2) killed
toDirectoryUserLink in GraphQLDeviceMapper, line 78 GraphQLDeviceMapperTest (2) killed
toDirectoryUserIds in GraphQLDeviceMapper, line 83 GraphQLDeviceMapperTest (1) killed
run in FleetHostFactsBackfillScheduler, line 31 FleetHostFactsBackfillSchedulerTest (2) killed
createMachine in AgentRegistrationService, line 116 AgentRegistrationServiceTest (3), 2 more killed
lambda$updateMachine$0 in AgentRegistrationService, line 179 none no coverage (line 179)
updateMachine in AgentRegistrationService, line 182 AgentRegistrationServiceTest (3), 2 more killed
registrationRequestFields in AgentRegistrationService, lines 192-197 AgentRegistrationServiceTest (3), 7 more killed
copyHardwareFacts in AgentRegistrationService, lines 203-206 AgentRegistrationServiceTest (3), 7 more killed
setIfNotBlank in AgentRegistrationService, line 210 AgentRegistrationServiceTest (3), 7 more killed
backfill in FleetHostFactsBackfillService, lines 51-61 FleetHostFactsBackfillServiceTest (3), 9 more killed
lambda$backfill$0 in FleetHostFactsBackfillService, line 58 FleetHostFactsBackfillServiceTest (3), 7 more killed
lambda$backfill$1 in FleetHostFactsBackfillService, line 60 FleetHostFactsBackfillServiceTest (3), 2 more killed
readHosts in FleetHostFactsBackfillService, lines 71-84 FleetHostFactsBackfillServiceTest (3), 3 more 3 killed. 3 survived: line 76: Changed increment from 1 to -1; line 75: negated conditional; line 84: replaced int return with 0 for FleetHostFactsBackfillService::readHosts
fleetHostIds in FleetHostFactsBackfillService, lines 94-98 FleetHostFactsBackfillServiceTest (3), 7 more killed
fleetHostId in FleetHostFactsBackfillService, lines 106-113 FleetHostFactsBackfillServiceTest (3), 5 more killed
fill in FleetHostFactsBackfillService, lines 120-128 FleetHostFactsBackfillServiceTest (3), 3 more 3 killed. 2 survived: line 122: replaced return value with null for FleetHostFactsBackfillService::fill; line 125: replaced return value with null for FleetHostFactsBackfillService::fill
fill in FleetHostFactsWriter, lines 35-48 FleetHostFactsWriterTest (3), 4 more killed
lambda$fill$0 in FleetHostFactsWriter, line 36 FleetHostFactsWriterTest (1) killed
lambda$stillBlank$0 in FleetHostFactsWriter, line 60 FleetHostFactsWriterTest (3), 2 more killed
lambda$stillBlank$1 in FleetHostFactsWriter, line 64 FleetHostFactsWriterTest (3), 2 more killed
stillBlank in FleetHostFactsWriter, line 65 FleetHostFactsWriterTest (3), 2 more killed
setWhereBlank in FleetHostFactsWriter, line 69 FleetHostFactsWriterTest (3), 3 more killed
lambda$client$0 in FleetMdmClients, line 35 FleetMdmClientsTest (1) killed
client in FleetMdmClients, line 38 FleetMdmClientsTest (1) killed
The covering tests by name (37 methods)
  • DeviceFilterService.getDeviceFilters: DeviceFilterServiceTest.filteredCountOnly_runsOneQueryAndSkipsEveryFacet, DeviceFilterServiceTest.directoryFacetsDisabled_selectedDirectoryFacets_neverQueriedAndEmpty, DeviceFilterServiceTest.dashboardCounterSelection_runsOnlyItsTwoQueries, and 12 more
  • DeviceFilterService.lambda$getDeviceFilters$0: DeviceFilterServiceTest.dashboardCounterSelection_runsOnlyItsTwoQueries, DeviceFilterServiceTest.directoryFacetsDisabled_directoryCriteriaStillFilter, DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, and 3 more
  • DeviceFilterService.lambda$getDeviceFilters$1: DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, DeviceFilterServiceTest.directoryFacetsDisabled_allFacets_runsEveryOtherQuery, and 1 more
  • DeviceFilterService.lambda$getDeviceFilters$2: DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, DeviceFilterServiceTest.directoryFacetsDisabled_allFacets_runsEveryOtherQuery, and 1 more
  • DeviceFilterService.lambda$getDeviceFilters$3: DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, DeviceFilterServiceTest.directoryFacetsDisabled_allFacets_runsEveryOtherQuery, and 1 more
  • DeviceFilterService.lambda$getDeviceFilters$4: DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, DeviceFilterServiceTest.directoryFacetsDisabled_allFacets_runsEveryOtherQuery, and 1 more
  • DeviceFilterService.lambda$getDeviceFilters$5: DeviceFilterServiceTest.directoryColumnsSelection_runsOnlyTheirTwoQueries, DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, and 1 more
  • DeviceFilterService.lambda$getDeviceFilters$6: DeviceFilterServiceTest.directoryColumnsSelection_runsOnlyTheirTwoQueries, DeviceFilterServiceTest.singleArgOverload_stillRequestsEveryFacet, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, and 1 more
  • DeviceFilterService.lambda$getDeviceFilters$7: DeviceFilterServiceTest.filteredCountOnly_runsOneQueryAndSkipsEveryFacet, DeviceFilterServiceTest.directoryFacetsDisabled_selectedDirectoryFacets_neverQueriedAndEmpty, DeviceFilterServiceTest.dashboardCounterSelection_runsOnlyItsTwoQueries, and 10 more
  • DeviceFilterService.queriedFacets: DeviceFilterServiceTest.directoryFacetsDisabled_selectedDirectoryFacets_neverQueriedAndEmpty, DeviceFilterServiceTest.directoryFacetsEnabled_allFacets_queriesTheDirectoryFacetsToo, DeviceFilterServiceTest.directoryFacetsDisabled_allFacets_runsEveryOtherQuery, and 12 more
  • DeviceDataFetcher.directorySources: DeviceDataFetcherTest.directoryFields_resolvedThroughTheMapper
  • DeviceDataFetcher.directoryUserLink: DeviceDataFetcherTest.directoryFields_resolvedThroughTheMapper
  • DeviceDataFetcher.directoryUserIds: DeviceDataFetcherTest.directoryFields_resolvedThroughTheMapper
  • GraphQLDeviceMapper.toDirectorySources: GraphQLDeviceMapperTest.toDirectorySources_nullStored_emptyList, GraphQLDeviceMapperTest.toDirectorySources_stored_returned
  • GraphQLDeviceMapper.toDirectoryUserLink: GraphQLDeviceMapperTest.toDirectoryUserLink_nullStored_none, GraphQLDeviceMapperTest.toDirectoryUserLink_stored_returned
  • GraphQLDeviceMapper.toDirectoryUserIds: GraphQLDeviceMapperTest.toDirectoryUserIds_nullAndStored
  • FleetHostFactsBackfillScheduler.run: FleetHostFactsBackfillSchedulerTest.run_backfillFails_failureLoggedNotThrown, FleetHostFactsBackfillSchedulerTest.run_scheduledTick_delegatesToTheBackfill
  • AgentRegistrationService.createMachine: AgentRegistrationServiceTest.registerAgent_WithHardwareFacts_CopiesThemOntoTheNewMachine, AgentRegistrationServiceTest.registerAgent_WithNewMachine_ReturnsCredentials, AgentRegistrationServiceTest.registerAgent_WithoutTags_DoesNotAssignTags, and 2 more
  • AgentRegistrationService.updateMachine: AgentRegistrationServiceTest.reinstall_WithoutUserId_KeepsTheStoredOne, AgentRegistrationServiceTest.reinstall_WithoutHardwareFacts_KeepsTheStoredOnes, AgentRegistrationServiceTest.reinstall_WithHardwareFacts_OverwritesTheStoredOnes, and 2 more
  • AgentRegistrationService.registrationRequestFields: AgentRegistrationServiceTest.reinstall_WithUserId_RecordsWhoInstalledTheAgent, AgentRegistrationServiceTest.reinstall_WithoutUserId_KeepsTheStoredOne, AgentRegistrationServiceTest.reinstall_WithoutHardwareFacts_KeepsTheStoredOnes, and 7 more
  • AgentRegistrationService.copyHardwareFacts: AgentRegistrationServiceTest.reinstall_WithHardwareFacts_OverwritesTheStoredOnes, AgentRegistrationServiceTest.registerAgent_WithHardwareFacts_CopiesThemOntoTheNewMachine, AgentRegistrationServiceTest.reinstall_WithoutUserId_KeepsTheStoredOne, and 7 more
  • AgentRegistrationService.setIfNotBlank: AgentRegistrationServiceTest.reinstall_WithoutUserId_KeepsTheStoredOne, AgentRegistrationServiceTest.reinstall_WithoutHardwareFacts_KeepsTheStoredOnes, AgentRegistrationServiceTest.reinstall_WithHardwareFacts_OverwritesTheStoredOnes, and 7 more
  • FleetHostFactsBackfillService.backfill: FleetHostFactsBackfillServiceTest.backfill_nothingDue_noConnectionReadAndNoFleetClient, FleetHostFactsBackfillServiceTest.backfill_machineWithoutAFleetConnection_stampedWithoutCallingFleet, FleetHostFactsBackfillServiceTest.backfill_readsOnlyTheConnectedFleetConnectionsOfTheDueMachines, and 9 more
  • FleetHostFactsBackfillService.lambda$backfill$0: FleetHostFactsBackfillServiceTest.backfill_machineWithoutAFleetConnection_stampedWithoutCallingFleet, FleetHostFactsBackfillServiceTest.backfill_hostNeverConfirmedByFleet_stampedWithoutCallingFleet, FleetHostFactsBackfillServiceTest.backfill_machinesWithoutAHostStampedBeforeTheFleetClientIsCreated_soAMissingFleetDoesNotKeepThemDue, and 7 more
  • FleetHostFactsBackfillService.lambda$backfill$1: FleetHostFactsBackfillServiceTest.backfill_machineWithoutAFleetConnection_stampedWithoutCallingFleet, FleetHostFactsBackfillServiceTest.backfill_hostNeverConfirmedByFleet_stampedWithoutCallingFleet, FleetHostFactsBackfillServiceTest.backfill_machinesWithoutAHostStampedBeforeTheFleetClientIsCreated_soAMissingFleetDoesNotKeepThemDue, and 2 more
  • FleetHostFactsBackfillService.readHosts: FleetHostFactsBackfillServiceTest.backfill_machinesReadInTheOrderTheQueryReturnsThem, FleetHostFactsBackfillServiceTest.backfill_hostIdTooLongForALong_stampedAndTheOthersStillRead, FleetHostFactsBackfillServiceTest.backfill_oneHostLookupFails_theOtherMachinesStillFilled, and 3 more
  • FleetHostFactsBackfillService.fleetHostIds: FleetHostFactsBackfillServiceTest.backfill_hostNeverConfirmedByFleet_stampedWithoutCallingFleet, FleetHostFactsBackfillServiceTest.backfill_machinesWithoutAHostStampedBeforeTheFleetClientIsCreated_soAMissingFleetDoesNotKeepThemDue, FleetHostFactsBackfillServiceTest.backfill_machinesReadInTheOrderTheQueryReturnsThem, and 7 more
  • FleetHostFactsBackfillService.fleetHostId: FleetHostFactsBackfillServiceTest.backfill_machinesWithoutAHostStampedBeforeTheFleetClientIsCreated_soAMissingFleetDoesNotKeepThemDue, FleetHostFactsBackfillServiceTest.backfill_machinesReadInTheOrderTheQueryReturnsThem, FleetHostFactsBackfillServiceTest.backfill_hostGoneFromFleet_nothingWritten, and 5 more
  • FleetHostFactsBackfillService.fill: FleetHostFactsBackfillServiceTest.backfill_hostGoneFromFleet_nothingWritten, FleetHostFactsBackfillServiceTest.backfill_hostIdTooLongForALong_stampedAndTheOthersStillRead, FleetHostFactsBackfillServiceTest.backfill_oneHostLookupFails_theOtherMachinesStillFilled, and 3 more
  • FleetHostFactsWriter.fill: FleetHostFactsWriterTest.fill_fleetHostWithoutFacts_nothingWritten, FleetHostFactsWriterTest.fill_paddedFleetValue_writtenTrimmed, FleetHostFactsWriterTest.fill_byMachineId_storedMachineFilled, and 4 more
  • FleetHostFactsWriter.lambda$fill$0: FleetHostFactsWriterTest.fill_byMachineId_storedMachineFilled
  • FleetHostFactsWriter.lambda$stillBlank$0: FleetHostFactsWriterTest.fill_paddedFleetValue_writtenTrimmed, FleetHostFactsWriterTest.fill_byMachineId_storedMachineFilled, FleetHostFactsWriterTest.fill_machineWithoutFacts_everyFleetFactWritten, and 2 more
  • FleetHostFactsWriter.lambda$stillBlank$1: FleetHostFactsWriterTest.fill_paddedFleetValue_writtenTrimmed, FleetHostFactsWriterTest.fill_byMachineId_storedMachineFilled, FleetHostFactsWriterTest.fill_machineWithoutFacts_everyFleetFactWritten, and 2 more
  • FleetHostFactsWriter.stillBlank: FleetHostFactsWriterTest.fill_paddedFleetValue_writtenTrimmed, FleetHostFactsWriterTest.fill_byMachineId_storedMachineFilled, FleetHostFactsWriterTest.fill_machineWithoutFacts_everyFleetFactWritten, and 2 more
  • FleetHostFactsWriter.setWhereBlank: FleetHostFactsWriterTest.fill_paddedFleetValue_writtenTrimmed, FleetHostFactsWriterTest.fill_byMachineId_storedMachineFilled, FleetHostFactsWriterTest.fill_machineWithoutFacts_everyFleetFactWritten, and 3 more
  • FleetMdmClients.lambda$client$0: FleetMdmClientsTest.client_noFleetTool_throwsNamingTheTool
  • FleetMdmClients.client: FleetMdmClientsTest.client_fleetTool_builtFromItsApiUrlAndToken

What the surviving mutations leave unverified

  • AgentRegistrationService.java:176-178: No test reaches the reinstall of a machine whose document vanished between the existence check and the write (the orElseThrow supplier has no coverage).
  • PinotClientDeviceRepository.java:128-160: getDirectorySourceFilterOptions and getUserLinkFilterOptions survive returning an empty map: the tests assert the SQL they build, not the counts they return, so a mapping slip in the SOURCES / USER facets would not fail a test.
  • DeviceHeartbeatOfflineDetectionService.java:50-68: The marked boolean survives forced to true or false: it only feeds the logged count, which no test checks. The guards themselves are verified by DeviceHeartbeatOfflineDetectionIT (gated, run by hand: green).
  • FleetHostFactsBackfillService.java:75-84: The read counter and the FOUND vs GONE outcome survive mutation: they only feed the summary log line; the stamping and FAILED-stays-due behaviour is tested.
  • CustomMachineRepositoryImpl.java:750-775: findDueForFleetHostFacts has no unit coverage, so PIT sees none; its only tests are the gated CustomMachineRepositoryDueForFleetHostFactsIT (17 tests, run by hand: green) that CI does not run.
  • PinotConfigInitializer.java:298: Negating the single-value check survives: no test proves a column turning multi-value counts as a schema change, so that change would not be shown to force-commit the consuming segments.

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 Flamingo Code Review / tests and mutation check.

6 gaps (not tested here):

  • Java (Maven) .: DeviceFilterCriteria.java, DeviceFilters.java changed but not mutation-tested (outside the mutation targets openframe-api-lib configures)
  • Java (Maven) .: DeviceFilterInput.java changed but not mutation-tested (outside the mutation targets openframe-api-service-core configures)
  • Java (Maven) .: MachinePinotMessage.java changed but not mutation-tested (outside the mutation targets openframe-data-kafka configures)
  • Java (Maven) .: CustomMachineRepository.java, ToolConnectionRepository.java, MachineFields.java changed but not mutation-tested (outside the mutation targets openframe-data-mongo-sync configures)
  • Java (Maven) .: PinotDeviceRepository.java changed but not mutation-tested (outside the mutation targets openframe-data-pinot configures)
  • TypeScript (npm) openframe-frontend-core: no mutation testing (no Stryker configured: mutation coverage is a gap to report)

Change set

  • Land together with flamingo-stack/openframe-oss-frontend#690: its branch uses what this pull request removes or changes.
🤖 Prompt for AI agents: fix every finding
Address these code-review findings on pull request #2796 of flamingo-stack/openframe-oss-lib, most important first.
For each one, make the minimal change that resolves it and do not refactor unrelated code.
If you can show a finding is wrong, skip it and say why.

1. [Informational] openframe-data-mongo-sync/src/test/java/com/openframe/data/repository/device/CustomMachineRepositoryDueForFleetHostFactsIT.java:32 The change's 8 ITs never run in CI: they are gated on -Dintegration.tests=true
   CustomMachineRepositoryDueForFleetHostFactsIT, CustomMachineRepositoryDirectoryFilterIT, CustomMachineRepositoryHostFactsCheckedIT, MachineWriterRoundTripIT, ToolConnectionRepositoryIT, both MachineFieldLevelWritesIT and DeviceHeartbeatOfflineDetectionIT are @EnabledIfSystemProperty(integration.tests=true), and neither build.yml nor any pom sets it. They are the only tests of findDueForFleetHostFacts, the NONE-matches-missing directory filter and the guarded field-level writes. Run by hand with the property and Docker on this code: all green. Turning the property on for the whole openframe-data-mongo-sync module also shows older gated ITs (notifications, rmm) already failing on context wiring, which nobody saw because CI never runs them.

Next: 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:

  • Review the new commits: only what was pushed since this review
  • Review the whole diff again: everything, including what was already reviewed

Or comment @flamingo-review (new commits) or @flamingo-review full (everything). Add the flamingo-review-always label to review every push.

Updated 2026-11-02 16:29 UTC · reviewed from Andrii Kachur's machine

…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
pavlo-flamingo added a commit that referenced this pull request Oct 27, 2026
…ield has no wrapper

Same change as in #2796, so whichever lands first merges cleanly into the other.
…/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
@oleksandr-blip oleksandr-blip added the build Run the PR builds and publish snapshots (Java, npm preview); stays on until removed label Nov 2, 2026
oleksandr-blip and others added 2 commits November 2, 2026 14:43
…SER device filters CU-86akgr5x2 (#2910)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andriikachur and others added 8 commits November 2, 2026 18:08
… 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>
…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.
…, 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>
andriikachur and others added 13 commits November 4, 2026 13:55
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 188df38 (#2954). No file overlaps the branch.

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
@andriikachur
andriikachur added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 02fe8e5 Nov 9, 2026
22 checks passed
@andriikachur
andriikachur deleted the feature/directory-connection-customers branch November 9, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Run the PR builds and publish snapshots (Java, npm preview); stays on until removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants