Skip to content

Integrate the pull request store - #2918

Merged
shiftkey merged 76 commits into
masterfrom
integrate-pr-store
Oct 24, 2017
Merged

shiftkey merged 76 commits into
masterfrom
integrate-pr-store

Conversation

@joshaber

@joshaber joshaber commented Sep 29, 2017 •

Copy link
Copy Markdown
Contributor

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.

@joshaber
joshaber changed the base branch from master to forks-make-everything-complicated September 29, 2017 18:38
@joshaber

Copy link
Copy Markdown
Contributor Author

This should be ready 🙏

I'm gonna open some issues for some remaining work.

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, a few little things to polish this up.

Comment thread app/src/lib/app-state.ts Outdated
readonly recentBranches: ReadonlyArray<Branch>

/** The open pull requests in the repository. */
readonly pullRequests: ReadonlyArray<PullRequest> | null

This comment was marked as spam.


this.pullRequestStore
.getPullRequests(gitHubRepository)
.then(p =>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/lib/stores/app-store.ts Outdated
.then(p =>
this.updateStateWithPullRequests(p, repository, gitHubRepository)
)
.catch(e => this.emitError(e))

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/lib/stores/app-store.ts Outdated
}

return {
...state,

This comment was marked as spam.

Comment thread app/src/lib/stores/app-store.ts Outdated
}))

this.updateBranchesState(repository, state => ({
...state,

This comment was marked as spam.

const api = API.fromAccount(account)

const prs = await api.fetchPullRequests(
const prsFrmoAPI = await api.fetchPullRequests(

This comment was marked as spam.


await this.writePullRequestStatus(pullRequestsStatuses)

prs = await this.getPullRequests(repository)

This comment was marked as spam.

baseId
))!

const prStatus = await this.getPullRequestStatusById(pr.head.sha, pr.id!)

This comment was marked as spam.

// in the first place.
const baseRepo = await this.repositoriesStore.findOrPutGitHubRepository(
repository.endpoint,
pr.base.repo!

This comment was marked as spam.

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there


this.pullRequestStore
.getPullRequests(gitHubRepository)
.then(p =>

This comment was marked as spam.

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.

Comment thread app/src/lib/fatal-error.ts Outdated
* 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.

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member

The only thing holding this up from me is really minor. I'm gonna let it slide.

@shiftkey
shiftkey merged commit 8fc8e6f into master Oct 24, 2017
@shiftkey
shiftkey deleted the integrate-pr-store branch October 24, 2017 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants