RHINENG-25147: refactor workspaces#2176
RHINENG-25147: refactor workspaces#2176Dugowitch wants to merge 34 commits intoRedHatInsights:masterfrom
Conversation
… PackagesListHandler
…ystemVmaasJSONHandler, SystemYumUpdatesHandler
…stemsListIDsHandler, SystemsExportHandler
…dler, TemplateSystemsListIDsHandler, TemplateSystemsExportHandler
…andler, TemplateSystemsDeleteHandler, TemplateSubscribedSystemsUpdateHandler
… AdvisoriesListIDsHandler, AdvisoriesExportHandler
…dler, AdvisorySystemsListIDsHandler, AdvisorySystemsExportHandler
…r, SystemAdvisoriesIDsHandler, SystemAdvisoriesExportHandler
…ler, PackageSystemsListIDsHandler, PackageSystemsExportHandler
… SystemPackagesExportHandler
There was a problem hiding this comment.
Sorry @Dugowitch, your pull request is larger than the review limit of 150000 diff characters
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2176 +/- ##
==========================================
- Coverage 59.13% 59.03% -0.11%
==========================================
Files 134 136 +2
Lines 8738 8697 -41
==========================================
- Hits 5167 5134 -33
+ Misses 3028 3023 -5
+ Partials 543 540 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @@ -0,0 +1,10 @@ | |||
| ALTER TABLE system_inventory | |||
| ADD COLUMN workspace_id TEXT CHECK (NOT empty(workspace_id)), | |||
There was a problem hiding this comment.
workspace_id is uuid so we should use UUID type here - 2 reasons (at least):
- you won't need
empty()check, - and mostly UUID takes 16 bytes, while as text it takes 36 bytes .
| } | ||
|
|
||
| type SystemWorkspace struct { | ||
| WorkspaceID *string `json:"workspace_id" csv:"workspace_id" query:"si.workspace_id" gorm:"column:workspace_id"` |
| Tags []byte `gorm:"column:tags"` | ||
| Created time.Time // set by trigger system_platform_insert_trigger | ||
| Workspaces *inventory.Groups `gorm:"column:workspaces"` | ||
| WorkspaceID *string `gorm:"column:workspace_id"` |
| OSAttributes | ||
| SystemTimestamps | ||
| SystemTags | ||
| SystemGroups |
There was a problem hiding this comment.
Removal of SystemGroups is actually trickier...
Since group column is part of API removal will break API v3 (contract). So we have 2 options:
- keep groups there as "virtual" column made from workspace_id and workspace_name,
- or create new API v4 without this column.
There was a problem hiding this comment.
So as a part of this PR / ticket I propose keep groups as is. And I created new epic for V4 API - we have many such columns over the time so it make sense to clean things a bit.
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist