Skip to content

Conversation

@nadzyah
Copy link
Member

@nadzyah nadzyah commented Apr 30, 2024

This PR closes C3-649. It depends on https://github.com/canonical/hexr/pull/307 and uses the endpoint defined there

Here we introduce the Device model and the M2M relationship between it and the Report model to reflect the structure that we have in C3.
The importer logic adds a new device only if another device with the same vendor, name, subsystem, bus, version, and category doesn't exist. It was done this way to avoid populating duplicates but keeping as much information as we need to identify a device

There also were added two tests:

  • to check that the corresponding devices are created and attached to the correct reports
  • to check that we don't add duplicates

@nadzyah nadzyah requested review from mz2, omar-selo and plars and removed request for mz2 April 30, 2024 14:24
@nadzyah nadzyah force-pushed the import-devices-c3 branch from 0aca312 to 2348c74 Compare May 3, 2024 09:35
Copy link

@omar-selo omar-selo left a comment

Choose a reason for hiding this comment

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

Some small comments but a couple a bit more involved. Would it not be better to extend the existing certificates endpoint on C3 to include devices. And do we want device instances or not

@nadzyah nadzyah force-pushed the import-devices-c3 branch from 2348c74 to 229ab91 Compare May 3, 2024 12:53
@nadzyah nadzyah requested a review from omar-selo May 3, 2024 13:19
Copy link

@omar-selo omar-selo left a comment

Choose a reason for hiding this comment

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

LGTM! thanks for addressing my comments

@nadzyah nadzyah merged commit 72fe9b8 into main May 6, 2024
@nadzyah nadzyah deleted the import-devices-c3 branch May 6, 2024 11:54
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.

3 participants