-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add reference to central entities table in EEA #4191
Conversation
This adds a nullable reference to the central entities table in the EEA tables. This will simplify the EEA as we won't need to check multiple tables anymore. However, we can't just migrate to it in one go; we need to first duplicate the data then do it. Signed-off-by: Juan Antonio Osorio <[email protected]>
9e357ca
to
3d5d368
Compare
ArtifactID: artifactID, | ||
PullRequestID: pullRequestID, | ||
ProjectID: projectID, | ||
Entity: entities.EntityTypeToDB(inf.Type), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to get rid of the type field in a future PR? (I know removing this requires a few steps to avoid breaking backwards compatibility)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, type won't be needed in the future since the type won't matter. We'd be able to solely rely on the entity instance ID.
This PR merely duplicates info and is not making any logic moves yet.
return uuid.Nil, fmt.Errorf("no entity ID found") | ||
} | ||
|
||
func (eiw *EntityInfoWrapper) getIDForEntityType(t minderv1.Entity) (uuid.UUID, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you could make the methods simpler by making getIDForEntityType
accept a nil receiver and return uuid.Nil in that case as well as not return the second bool from getIDForEntityType
but just uuid.Nil. But it's a matter of taste, both are fine.
Summary
This adds a nullable reference to the central entities table in the EEA
tables. This will simplify the EEA as we won't need to check multiple
tables anymore. However, we can't just migrate to it in one go; we need
to first duplicate the data then do it.
Closes: #4167
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: