-
Notifications
You must be signed in to change notification settings - Fork 567
chore: remove GetRelationDetailsForUnit #19328
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
Conversation
8e6d9c8 to
a931fd9
Compare
gfouillet
left a comment
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.
Looks good overall, yet I have a small concern before approval.
| // - [relationerrors.RelationNotFound] is returned if the relation UUID | ||
| // is not found. | ||
| GetRelationDetails(ctx context.Context, relationID int) (relation.RelationDetailsResult, error) | ||
| GetRelationDetails(ctx context.Context, relationUUID corerelation.UUID) (relation.RelationDetailsResult, error) |
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.
👏
a931fd9 to
d56b40c
Compare
gfouillet
left a comment
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.
Thanks.
d56b40c to
f5b2dad
Compare
f5b2dad to
0f09795
Compare
|
/merge |
Remove the GetRelationDetailsForUnit method. Callsites of this method can be replaced by a call to
GetRelationDetailswhich will return the same contents. This method was added to replace the 3.6 functiongetRelationUnitin the uniter facade which fetched the unit and relation separately. In the callsites replaced in this PR, the unit information was not used anyway, so theGetRelationDetailsfunction can be swapped in.The only hitch was that
GetRelationDetailstook a relation ID rather than a relation UUID, whereasGetRelationDetailsForUnittook a unit UUID and a relation UUID. Since it would take an extra facade call to get the relation ID For this reason I changedGetRelationDetailsto use a UUID instead of an ID. This means that the existing facade calls in the uniter facade now need to resolve their relation ID into a relation UUID. I settled on this solution rather than resolving the UUID into an ID because we are generally moving towards using the UUIDs in the facades.Checklist
QA steps
Unit tests pass
Links
Jira card: JUJU-7701