-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Calculate label URL on API #16186
Calculate label URL on API #16186
Conversation
Could the caches contain more then one element? |
Co-authored-by: zeripath <art27@cantab.net>
Codecov Report
@@ Coverage Diff @@
## main #16186 +/- ##
=======================================
Coverage ? 45.20%
=======================================
Files ? 766
Lines ? 86592
Branches ? 0
=======================================
Hits ? 39144
Misses ? 41105
Partials ? 6343
Continue to review full report at Codecov.
|
Hmm... I don't think they can here. The labels either belong to the repo or the org. It doesn't appear to make much sense to me that we would provide a cross repo label API. @6543 is there actually a way that this could happen? |
Yes the endpoint to get labels of issues can return org & repo labels |
yes this are edge cases but they exist |
hmm, let's check these:
@6543 where were you thinking this was called where it could be cross-repo or cross-org? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
@@ -25,6 +28,9 @@ func ToAPIIssue(issue *models.Issue) *api.Issue { | |||
if err := issue.LoadRepo(); err != nil { | |||
return &api.Issue{} | |||
} | |||
if err := issue.Repo.GetOwner(); err != nil { |
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 think err := issue.Repo.GetOwner();
is misleading, as this implies that err
would be the owner.
After what I have seen, this function should most likely be renamed to LoadOwner
, because that's what it does.
Returning only an error makes much more sense then.
An alternative for naming it would be InitializeOwner()
but that seems to conflict with the current naming scheme.
When renaming it, its function comment should be changed as well as that is simply incorrect by now.
Could it be that that is a leftover from when the owner was initialized eagerly?
fix #8028