Repository navigation
Integrate the pull request store - #2918
Conversation
|
This should be ready 🙏 I'm gonna open some issues for some remaining work. |
shiftkey
left a comment
There was a problem hiding this comment.
Looking good, a few little things to polish this up.
| readonly recentBranches: ReadonlyArray<Branch> | ||
|
|
||
| /** The open pull requests in the repository. */ | ||
| readonly pullRequests: ReadonlyArray<PullRequest> | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| this.pullRequestStore | ||
| .getPullRequests(gitHubRepository) | ||
| .then(p => |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| .then(p => | ||
| this.updateStateWithPullRequests(p, repository, gitHubRepository) | ||
| ) | ||
| .catch(e => this.emitError(e)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| return { | ||
| ...state, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| })) | ||
|
|
||
| this.updateBranchesState(repository, state => ({ | ||
| ...state, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const api = API.fromAccount(account) | ||
|
|
||
| const prs = await api.fetchPullRequests( | ||
| const prsFrmoAPI = await api.fetchPullRequests( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| await this.writePullRequestStatus(pullRequestsStatuses) | ||
|
|
||
| prs = await this.getPullRequests(repository) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| baseId | ||
| ))! | ||
|
|
||
| const prStatus = await this.getPullRequestStatusById(pr.head.sha, pr.id!) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // in the first place. | ||
| const baseRepo = await this.repositoriesStore.findOrPutGitHubRepository( | ||
| repository.endpoint, | ||
| pr.base.repo! |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| this.pullRequestStore | ||
| .getPullRequests(gitHubRepository) | ||
| .then(p => |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const baseRepo = await this.repositoriesStore.findOrPutGitHubRepository( | ||
| repository.endpoint, | ||
| pr.base.repo! | ||
| forceUnwrap('PR cannot have a null base repo', pr.base.repo) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * value is defined. | ||
| */ | ||
| export function forceUnwrap<T>(message: string, x: T | null | undefined): T { | ||
| if (x) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
The only thing holding this up from me is really minor. I'm gonna let it slide. |
This builds on top of #2903, so go review that first #️⃣ 1️⃣ 🔁
@iAmWillShepherd and I paired on most of this 2️⃣ 💻 so someone else will need to review it.