Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS-853: Create BOM service table scheme and generate ORM files. #231

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

Alva8756
Copy link
Contributor

@Alva8756 Alva8756 commented Aug 17, 2023

This PR create sqlboiler sql file and generate related ORM model files for BOM service.
As listed in the design doc, we will need to create 3 tables bom-info, aoc_mac_address_bom and bmc_mac_address_bom.

More table details can be found in design doc: 19IG7fU0jc_F3GV71nx_P5hbMHjhCv3_EzIUmFfvCGNU.

Tested in Sandbox:
When using the locally built serverService image in sandbox,
the crdb initialize the new added tables successfully.

root@:26257/defaultdb> SHOW TABLES;
  schema_name |         table_name         | type  | owner | estimated_row_count | locality
--------------+----------------------------+-------+-------+---------------------+-----------
  public      | aoc_mac_address            | table | root  |                   0 | NULL
  public      | attributes                 | table | root  |                   0 | NULL
  public      | attributes_firmware_set    | table | root  |                   0 | NULL
  public      | bmc_mac_address            | table | root  |                   0 | NULL
  public      | bom_info                   | table | root  |                   0 | NULL
  public      | component_firmware_set     | table | root  |                   0 | NULL
  public      | component_firmware_set_map | table | root  |                   0 | NULL
  public      | component_firmware_version | table | root  |                   0 | NULL
  public      | goose_db_version           | table | root  |                  22 | NULL
  public      | server_component_types     | table | root  |                   0 | NULL
  public      | server_components          | table | root  |                   0 | NULL
  public      | server_credential_types    | table | root  |                   1 | NULL
  public      | server_credentials         | table | root  |                   0 | NULL
  public      | servers                    | table | root  |                   0 | NULL
  public      | versioned_attributes       | table | root  |                   0 | NULL
(15 rows)

@Alva8756 Alva8756 force-pushed the FS-853 branch 4 times, most recently from 60f4b24 to f37972c Compare August 17, 2023 19:03
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #231 (3f0139a) into main (97b483f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #231   +/-   ##
=======================================
  Coverage   71.87%   71.87%           
=======================================
  Files          36       36           
  Lines        3549     3549           
=======================================
  Hits         2551     2551           
  Misses        745      745           
  Partials      253      253           
Flag Coverage Δ
unittests 71.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@Alva8756 Alva8756 force-pushed the FS-853 branch 6 times, most recently from d2406ca to 99ddf8b Compare August 17, 2023 21:44
@Alva8756 Alva8756 changed the title WIP: FS-853 Create BOM service table scheme and generate ORM files. FS-853: Create BOM service table scheme and generate ORM files. Aug 17, 2023
@Alva8756 Alva8756 marked this pull request as ready for review August 17, 2023 22:18
@Alva8756 Alva8756 requested a review from a team as a code owner August 17, 2023 22:18
@Alva8756 Alva8756 force-pushed the FS-853 branch 5 times, most recently from 487f831 to 0388df9 Compare August 17, 2023 23:09
Copy link
Contributor

@DoctorVin DoctorVin left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me. Have you tried creating these tables and verifying it in the sandbox?

metro STRING NULL
);

CREATE TABLE mac_aoc_address_bom (
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor naming quibbles: consider renaming one of the two Mac tables so they are more consistent? Either aoc_mac_address or mac_bmc_address? Also, it feels like the _bom suffix stutters here (i.e it repeats without adding much value).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

kinda neat that it generates code and tests itself for the tables you created.

@Alva8756 Alva8756 force-pushed the FS-853 branch 2 times, most recently from f4db7a2 to 9f9cf46 Compare August 18, 2023 17:41
@Alva8756 Alva8756 merged commit 26cf401 into metal-toolbox:main Aug 21, 2023
7 checks passed
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