Skip to content

refactor(os-update): rename the row of an update on a device to OsUpdateOnDevice CU-17tkuw67mjh - #3348

Merged
semen-flamingo merged 1 commit into
mainfrom
feat/os-update-on-device-rename
Dec 4, 2026
Merged

semen-flamingo merged 1 commit into
mainfrom
feat/os-update-on-device-rename

Conversation

@semen-flamingo

@semen-flamingo semen-flamingo commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What

Rename only, no behaviour change. OsUpdateDevice read as "a device", while it is one stored row per update on one device with its status there. It is read from both sides (the devices of an update, the updates of a device), so the name now says what the row is.

Was Now
OsUpdateDevice (document) OsUpdateOnDevice
OsUpdateDeviceStatus (enum) OsUpdateOnDeviceStatus
OsUpdateDeviceStatusCount OsUpdateOnDeviceStatusCount
OsUpdateDeviceRepository, CustomOsUpdateDeviceRepository, …Impl OsUpdateOnDeviceRepository, CustomOsUpdateOnDeviceRepository, …Impl
OsUpdateDeviceService (client-core writes the rows, api-lib reads them; bean apiOsUpdateDeviceService) OsUpdateOnDeviceService (bean apiOsUpdateOnDeviceService)
OsUpdateDeviceResponse OsUpdateOnDeviceResponse
fields, locals and methods named after them (osUpdateDeviceRepository, replaceOsUpdateDevices, …) the same with OnDevice

The document also gets a class comment: what the row is, what it is derived from, and that it is read from both sides.

Schema (breaking, no client calls it yet)

Was Now
type OsUpdateDevice OsUpdateOnDevice
type OsUpdateDeviceConnection OsUpdateOnDeviceConnection
type OsUpdateDeviceEdge OsUpdateOnDeviceEdge
enum OsUpdateDeviceStatus OsUpdateOnDeviceStatus

Fields, arguments and enum values are unchanged. The tenant federation snapshot changes with the next lib bump; these renames show there as breaking.

Not renamed

  • The collection os_update_devices and its indexes: no data migration.
  • The queries osUpdateDevices and osUpdateDeviceFilters, and the types named after them (OsUpdateDeviceFilterInput, OsUpdateDeviceFilters, OsUpdateDeviceFilter): they are about the devices of an update.
  • OsUpdateDeviceCounts, OsUpdateDeviceScope and the data loader: the device counts and the device scope of an update, not the row.
  • docs/: the generated architecture pages still carry the old names.

Tests

  • The full unit run of data-mongo-sync, client-core, api-lib and api-service-core is green.
  • Integration tests compile and were not run.

Change-Set: feat-os-update-on-device-rename

🤖 Generated with Claude Code

https://claude.ai/code/session_01EnBSFTsNdA8c4yRH3Lehi4

Change set flamingo-stack/feat-os-update-on-device-rename: this pull request is the only one in it so far. Another pull request joins by naming this one in a Depends-On line, or by carrying the same Change-Set line.

Linked work

  • …and 1 linked item not shown here

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

…ateOnDevice CU-17tkuw67mjh

OsUpdateDevice read as "a device"; it is one row per update on one device. Renamed with its repositories,
services, status enum, status count and response, and the GraphQL types OsUpdateDevice, its connection and
edge, and the enum OsUpdateDeviceStatus. The collection os_update_devices, its indexes and the queries
osUpdateDevices / osUpdateDeviceFilters keep their names. No behaviour change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnBSFTsNdA8c4yRH3Lehi4
@flamingo

flamingo Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

🦩 flamingo Code Review

5 findings: 🔴 1 action required · 🟠 0 recommended · 🔵 4 informational

Advisory: findings do not block the merge.

Rules cited: OFJAVA-002 · 1 defect outside any rule

Files Lines 🔴 Action required 🟠 Recommended 🔵 Informational
37 +603 / -601 1 0 4

🔴 Action required (1)

# Where Finding Flagged by
1 os-update.graphqls:165 GraphQL schema renames OsUpdateDeviceStatus/Connection/Edge/OsUpdateDevice with no deprecation alias for existing clients Review

🔵 Informational (4)

# Where Finding Flagged by
2 OsUpdateOnDeviceService.java:110 CursorCodec.encode(rawCursor) is called inside the toDeviceResponse argument list (Pre-existing) OFJAVA-002
3 OsUpdateOnDeviceService.java:80 sortInput.getField() is called inside the isBlank(...) argument list in toOsUpdateSort (Pre-existing) OFJAVA-002
4 OsUpdateOnDeviceService.java:55 findPage receives nested getCursor()/getLimit() calls as arguments (Pre-existing) OFJAVA-002
5 CustomOsUpdateOnDeviceRepositoryImpl.java:136 sort.getField() called inside Criteria.where(...) argument list in findRowsWithoutValue (Pre-existing) OFJAVA-002

✅ What this change does well

  • The rename in openframe-api-lib/src/main/java/com/openframe/api/service/rmm/osupdate/OsUpdateOnDeviceService.java keeps the explicit bean name (@‍Service("apiOsUpdateOnDeviceService")) and the warning comment about the client-core twin, so the two beans still coexist in one context.
  • OsUpdateOnDeviceResponse.java carries the full Lombok quad (@‍Data @‍Builder @‍NoArgsConstructor @‍AllArgsConstructor), matching the data-carrier convention.
  • The test renames in OsUpdateServiceTest.java and OsUpdateResponseMapperTest.java were updated consistently with the new types, so the moved code stays covered.
  • The rename to OsUpdateOnDevice* is applied consistently across production and test code (DeviceOsReportFacade.java, DeviceOsWiringTest.java, MachineFieldLevelWritesIT.java) with no leftover references.
  • MachineOsUpdatesIngestIT.java keeps the physical Mongo collection and TTL index names ("os_update_devices", "os_update_devices_ttl") unchanged, so the Java-level rename does not require a data migration.

Inline comments: 5 new

13 possible problems checked and ruled out
  • openframe-api-lib/src/main/java/com/openframe/api/dto/rmm/osupdate/OsUpdateOnDeviceResponse.java:11 OsUpdateOnDeviceResponse duplicates an existing definition: The 'twin' OsUpdateDeviceResponse.java is the OLD path of a file this PR moves (listed under moved files), rename artifact, false positive.
  • openframe-api-lib/src/main/java/com/openframe/api/service/rmm/osupdate/OsUpdateOnDeviceService.java:34 OsUpdateOnDeviceService duplicates an existing definition: Twin is the OLD path openframe-api-lib/.../OsUpdateDeviceService.java, which this PR moves to the new name, rename artifact.
  • openframe-client-core/src/main/java/com/openframe/client/service/rmm/osupdate/OsUpdateOnDeviceService.java:30 OsUpdateOnDeviceService duplicates an existing definition: Twin is openframe-client-core/.../OsUpdateDeviceService.java, the OLD path of a file this PR moves/renames, false positive per instructions.
  • openframe-client-core/src/main/java/com/openframe/client/service/rmm/osupdate/OsUpdateOnDeviceService.java:43 replaceOsUpdateOnDevices duplicates an existing definition: Same: twin is the old path of the moved OsUpdateDeviceService; a rename, not real duplication.
  • openframe-data-mongo-common/src/main/java/com/openframe/data/document/rmm/osupdate/OsUpdateOnDevice.java:18 OsUpdateOnDevice duplicates an existing definition: Twin OsUpdateDevice.java is the old path of the moved OsUpdateOnDevice.java.
  • openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/rmm/osupdate/CustomOsUpdateOnDeviceRepositoryImpl.java:24 CustomOsUpdateOnDeviceRepositoryImpl duplicates an existing definition: Twin CustomOsUpdateDeviceRepositoryImpl.java is the old path of the moved file.
  • openframe-api-lib/src/main/java/com/openframe/api/mapper/OsUpdateResponseMapper.java:101 toDeviceResponse duplicates a near-identical definition: Builder-style mapper method vs GraphQLOrganizationMapper#toFilterOptions (hamming 4) is convention boilerplate; the diff only renames types.
  • openframe-api-service-core/src/main/java/com/openframe/api/datafetcher/rmm/OsUpdateDataFetcher.java:106 failedDeviceCount duplicates an existing definition: Same as index 7: one-line resolvers already delegating to a shared helper.
  • openframe-api-service-core/src/main/java/com/openframe/api/datafetcher/rmm/OsUpdateDataFetcher.java:89 osUpdateDeviceFilters duplicates an existing definition: Thin DGS @‍DgsQuery handler delegating to a service, framework boilerplate every sibling fetcher repeats.
  • openframe-api-service-core/src/main/java/com/openframe/api/datafetcher/rmm/OsUpdateDataFetcher.java:96 pendingDeviceCount duplicates an existing definition: Three one-line @‍DgsData count resolvers already share loadDeviceCounts(dfe); only the getter differs, not actionable duplication.
  • openframe-api-service-core/src/main/java/com/openframe/api/mapper/OsUpdateGraphQLMapper.java:85 2 new or changed definitions have no test referencing them: toOsVersionConnection (OsUpdateGraphQLMapper.java:85) is a one-line delegation to toConnection and CustomOsUpdateOnDeviceRepository is an interface, trivial/declarative, no test warranted.
  • openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/rmm/osupdate/CustomOsUpdateOnDeviceRepositoryImpl.java:56 null is computed and passed into findRowsWithoutValue as the cursor id: The null here is an internal, documented sentinel in private methods of code merely renamed by this PR (lines 57,133-139 are unchanged logic); stretching OFJAVA-013's 'never pass null' to a private pagination helper is a nitpick a senior engineer would not raise.
  • openframe-api-service-core/src/main/resources/schema/os-update.graphqls:40 Rename left OsUpdateDeviceFilterInput/OsUpdateDeviceFilters inconsistent with the new OsUpdateOnDevice vocabulary: Schema now mixes OsUpdateDeviceFilterInput/OsUpdateDeviceFilters with OsUpdateOnDevice* node/edge/enum in the same query, and the doc line inside OsUpdateDeviceFilters already says OsUpdateOnDeviceStatus, a real but small naming-consistency gap in this rename.
🤖 Prompt for AI agents: fix every finding
Address these code-review findings on pull request #3348 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. [Action required] openframe-api-service-core/src/main/resources/schema/os-update.graphqls:165 GraphQL schema renames OsUpdateDeviceStatus/Connection/Edge/OsUpdateDevice with no deprecation alias for existing clients
   The diff renames four published GraphQL type names in os-update.graphqls: the enum `OsUpdateDeviceStatus` → `OsUpdateOnDeviceStatus`, and the types `OsUpdateDeviceConnection`/`OsUpdateDeviceEdge`/`OsUpdateDevice` → `OsUpdateOnDevice*`. GraphQL type names are part of the wire contract: any client query that names them (inline fragments, named fragments `on OsUpdateDevice`, `$status: OsUpdateDeviceStatus!` variable declarations, generated TS types) stops validating. A grep of this repository (no hits for `OsUpdateDeviceStatus|OsUpdateDeviceConnection|OsUpdateDeviceEdge` outside the diff) confirms nothing in-repo still references them, but the graph lists OpenFrame OSS Frontend as a consumer of this repo's published frontend-core package, and GraphQL documents there are not visible to me — that is what is left to check.
2. [Informational] openframe-api-lib/src/main/java/com/openframe/api/service/rmm/osupdate/OsUpdateOnDeviceService.java:110 CursorCodec.encode(rawCursor) is called inside the toDeviceResponse argument list
   OFJAVA-002 forbids calling a method inside another call's argument list (CI-enforced by PMD NoMethodCallAsArgument). In the new openframe-api-lib OsUpdateOnDeviceService#toResponse the encoded cursor is produced inline as the third argument of osUpdateResponseMapper.toDeviceResponse; it must be extracted to a named local first.
3. [Informational] openframe-api-lib/src/main/java/com/openframe/api/service/rmm/osupdate/OsUpdateOnDeviceService.java:80 sortInput.getField() is called inside the isBlank(...) argument list in toOsUpdateSort
   OFJAVA-002 requires every method call to be extracted into a named local before being passed as an argument; here sortInput.getField() is invoked inside isBlank(...) in the new OsUpdateOnDeviceService of openframe-api-lib. The same compound condition also mixes a null check with the blank check, which OFJAVA-007 wants behind a named predicate.
4. [Informational] openframe-api-lib/src/main/java/com/openframe/api/service/rmm/osupdate/OsUpdateOnDeviceService.java:55 findPage receives nested getCursor()/getLimit() calls as arguments
   OFJAVA-002 forbids method calls in an argument list; listDevices in the new openframe-api-lib OsUpdateOnDeviceService passes normalizedPagination.getCursor() and normalizedPagination.getLimit() + 1 directly into osUpdateOnDeviceRepository.findPage.
5. [Informational] openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/rmm/osupdate/CustomOsUpdateOnDeviceRepositoryImpl.java:136 sort.getField() called inside Criteria.where(...) argument list in findRowsWithoutValue
   OFJAVA-002 forbids calling a method inside another call's argument list; the sibling method findRowsWithValue extracts `String sortField = sort.getField();` first, while this new line passes the call directly into Criteria.where(...). This is CI-enforced by PMD NoMethodCallAsArgument.

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-12-04 12:23 UTC · reviewed from Semen Lisak's machine

@flamingo

flamingo Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

🦩 flamingo Code Review / security

✅ No findings on the current head.

Advisory: findings do not block the merge.

Files Lines 🔴 Action required 🟠 Recommended 🔵 Informational
37 +603 / -601 0 0 0

Review again. New commits are not reviewed until you ask:

  • Security-check the new commits: only what was pushed since this security review
  • Security-check the whole diff again: everything, including what was already checked

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

Updated 2026-12-04 12:26 UTC · reviewed from Semen Lisak's machine

@semen-flamingo
semen-flamingo added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 49330da Dec 4, 2026
25 checks passed
@semen-flamingo
semen-flamingo deleted the feat/os-update-on-device-rename branch December 4, 2026 12:28
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