Skip to content

Capture OEM and OEM Version attributes from Omaha requests#1286

Open
ervcz wants to merge 3 commits intomainfrom
feat/capture-oem-attribute
Open

Capture OEM and OEM Version attributes from Omaha requests#1286
ervcz wants to merge 3 commits intomainfrom
feat/capture-oem-attribute

Conversation

@ervcz
Copy link
Copy Markdown
Collaborator

@ervcz ervcz commented Jan 8, 2026

Summary

Captures OEM and Aleph version attributes from Omaha update requests, and refactors registration APIs to use struct params.

Changes

Database

  • New migration 0021_add_instance_oem.sql adds oem and aleph_version columns to the instance table

API

  • RegisterInstance, GetUpdatePackage, and GetUpdatePackagesForSyncer refactored from positional string params to Instance/InstanceApplication structs
  • NewInstanceApplication helper added for constructing registration input

Tests

  • Added test coverage for OEM/AlephVersion save, preserve, and update scenarios
  • Updated all existing test call sites for the new struct-based API

@ervcz ervcz marked this pull request as ready for review January 23, 2026 10:01
@ervcz ervcz requested a review from a team as a code owner January 23, 2026 10:01
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch 3 times, most recently from 17439e7 to efd1f3d Compare January 26, 2026 11:43
@ervcz ervcz requested a review from a team January 26, 2026 11:43
@jepio
Copy link
Copy Markdown
Member

jepio commented Jan 26, 2026

Just a note: OEM version is not particularly interesting as it is tightly coupled to the OS version and always updated in lockstep - one may look it up in the source repo git tag.

The alephversion attribute from the request would be more interesting - it tells you the initial version an instance was provisioned from.

@ervcz
Copy link
Copy Markdown
Collaborator Author

ervcz commented Jan 26, 2026

Just a note: OEM version is not particularly interesting as it is tightly coupled to the OS version and always updated in lockstep - one may look it up in the source repo git tag.

The alephversion attribute from the request would be more interesting - it tells you the initial version an instance was provisioned from.

Thanks for the note. I'll replace it with alephversion as suggested. That brings more value. We will know the "age" of individual nodes.

@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from 2d52519 to 410381d Compare February 6, 2026 07:04
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from 410381d to 0ef741f Compare February 13, 2026 09:23
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from 0ef741f to db18dd5 Compare March 3, 2026 06:42
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch 2 times, most recently from a0b40ea to a345261 Compare March 11, 2026 17:34
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from 7c54b45 to cbf596a Compare March 19, 2026 08:38
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from cbf596a to fd8ae1e Compare April 17, 2026 14:38
@John15321 John15321 requested a review from Copilot April 20, 2026 14:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Captures OEM and Aleph version attributes from Omaha update requests and refactors instance registration/update lookup APIs to use struct-based parameters.

Changes:

  • Add oem and aleph_version columns to the instance table.
  • Refactor RegisterInstance, GetUpdatePackage, and GetUpdatePackagesForSyncer to accept Instance / InstanceApplication structs (plus NewInstanceApplication helper).
  • Update and extend tests to cover OEM/AlephVersion persistence and to use the new APIs.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
backend/pkg/api/db/migrations/0021_add_instance_oem.sql Adds DB columns to persist OEM/AlephVersion.
backend/pkg/api/instances.go Extends Instance model and updates registration to upsert OEM/AlephVersion.
backend/pkg/omaha/omaha.go Populates OEM/AlephVersion from Omaha requests into instance registration calls.
backend/pkg/api/updates.go Refactors update lookup APIs to use struct params and relies on struct-based registration.
backend/pkg/api/instances_test.go Adds coverage for saving/preserving/updating OEM/AlephVersion and updates call sites.
backend/pkg/api/updates_test.go Updates test call sites to the new struct-based API.
backend/pkg/api/packages_floors_test.go Updates floor-related tests for the new GetUpdatePackage signature.
backend/pkg/api/events_test.go Updates event tests to use struct-based GetUpdatePackage/RegisterInstance.
backend/pkg/api/groups_test.go Updates group tests to use struct-based instance registration.
backend/pkg/api/applications_test.go Updates application tests to use struct-based instance registration.
backend/pkg/api/activity_test.go Updates activity tests to use struct-based instance registration.
backend/test/api/instance_test.go Updates higher-level API tests to use struct-based registration/update calls.
backend/test/api/stats_test.go Updates stats tests to use struct-based registration/update calls.
CHANGELOG.md Documents OEM/AlephVersion capture behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/pkg/api/db/migrations/0021_add_instance_oem.sql Outdated
Copy link
Copy Markdown
Member

@John15321 John15321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@ervcz ervcz force-pushed the feat/capture-oem-attribute branch 2 times, most recently from 3def60f to 6e7b262 Compare April 21, 2026 07:41
- Add OEM and OEM version columns to instance table
- Update RegisterInstance and GetUpdatePackage calls to include OEM parameters
- Modify test cases to pass empty OEM values for compatibility

Signed-off-by: Ervin Rácz <ervin.racz@protonmail.com>
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from 6e7b262 to 71a3566 Compare April 21, 2026 07:42
ervcz added 2 commits April 21, 2026 10:42
- Rename database column from `oem_version` to `aleph_version`
- Update struct field and JSON tag in Instance model
- Use struct params instead of long function signature
- Refactor method signatures and variable names
- Adjust test assertions

Signed-off-by: Ervin Rácz <ervin.racz@protonmail.com>
- Add NOT NULL constraints to `oem` and `aleph_version` columns
- Ensure default empty string values for both columns
- Maintain backward compatibility with existing data
- add PR link to OEM Attribute Capture entry

Signed-off-by: Ervin Rácz <ervin.racz@protonmail.com>
@ervcz ervcz force-pushed the feat/capture-oem-attribute branch from 71a3566 to a2e56c4 Compare April 21, 2026 07:43
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.

4 participants