B7: html_url on issue + PR responses#309
Merged
Merged
Conversation
f05477e to
55f1a05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
B-audit finding B7 (deferred from S62): the issue and PR REST responses didn't include
html_url, so CLI clients had to compose the user-facing URL themselves (and were inconsistent about it).Fix
HTMLURL string(json:html_url, omitempty) to bothissueResponseandpullResponse.resolveAPIRepotoresolveAPIRepoWithLoginso they have the owner login available.(h *Handlers) issueHTMLURL(owner, repo, number)andpullHTMLURL(...), both composing<BaseURL>/<owner>/<repo>/issues|pulls/<number>.The pointer-vs-value type change (
*reposdb.Repo→reposdb.Repo) required dropping*repoderefs at policy callsites and wrapping with&repoatrepoGitDircallsites — both spots are mechanically obvious in the diff.Test plan
TestIssues_CreateAndGet— extended:created.HTMLURLandfetched.HTMLURLboth end in/alice/demo/issues/1.TestPulls_CreateAndGet— extended:created.HTMLURLends in/alice/demo/pulls/1.apiIssue+apiPulltest structs gainHTMLURL string.Notes
This PR depends on no other open PRs. If #307 (D1) merges first,
issueResponsewill gainAssigneesadjacent to where this PR addsHTMLURL— clean rebase.