Skip to content
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

Add an identify command #FF #7

Merged
merged 5 commits into from
Sep 6, 2019
Merged

Conversation

anandaroop
Copy link
Member

@anandaroop anandaroop commented Aug 8, 2019

Adds an identify command to identify an Artist, Artwork or Partner based on its BSON id. This also demonstrates the oclif way of mocking network requests in the accompanying test.

Screen Shot 2019-09-01 at 5 40 30 PM

Still supplying the token as an env var, till we get logins wired up.

@anandaroop
Copy link
Member Author

Haha I think Circle is lying to us about all that 🍏

@joeyAghion joeyAghion changed the title [WIP] Add an identify command [WIP] Add an identify command #FF Aug 9, 2019
@joeyAghion joeyAghion added the ff Future Fursday/Friday label Aug 9, 2019
@anandaroop anandaroop changed the title [WIP] Add an identify command #FF Add an identify command #FF Sep 1, 2019
Copy link
Member Author

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

Got this working, once I figured out how to nock correctly.

.get("/api/v1/artwork/abc123")
.reply(200)
.get("/api/v1/partner/abc123")
.reply(404)
Copy link
Member Author

@anandaroop anandaroop Sep 1, 2019

Choose a reason for hiding this comment

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

The second arg to .reply could be an object representing the JSON response. But here we mainly care whether the request 404'd or not.

})

const gravityResponses = await Promise.all(gravityPromises)
const foundIndex = gravityResponses.findIndex(r => r.status === 200)
Copy link
Member Author

Choose a reason for hiding this comment

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

The strategy here is to build up all the requests for the various collections, fire em off all at once, and look for one that succeeded.

@jonallured
Copy link
Member

Ok just had to update an assumption about the Gravity urls based on what @pepopowitz did over on #8.

@jonallured jonallured merged commit d998dfa into artsy:master Sep 6, 2019
@artsyit
Copy link
Contributor

artsyit commented Sep 6, 2019

🚀 PR was released in v0.0.4 🚀

1 similar comment
@artsyit
Copy link
Contributor

artsyit commented Sep 6, 2019

🚀 PR was released in v0.0.4 🚀

@artsyit
Copy link
Contributor

artsyit commented Sep 6, 2019

🚀 PR was released in v0.0.4 🚀

2 similar comments
@artsyit
Copy link
Contributor

artsyit commented Sep 6, 2019

🚀 PR was released in v0.0.4 🚀

@artsyit
Copy link
Contributor

artsyit commented Sep 6, 2019

🚀 PR was released in v0.0.4 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ff Future Fursday/Friday released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants