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

F001 add author biographies #2

Merged
merged 5 commits into from
Mar 19, 2019
Merged

Conversation

scasagrande
Copy link
Owner

@scasagrande scasagrande commented Mar 16, 2019

This PR adds backend support for author biographies.

Work is grouped in two commits: One for migrating the DB to include the new fields, and one for adding the new rake command.

DB

  • biography and github_issue_id columns added to Authors table
  • biography data is added to author_serializer.rb, and was manually checked with curl to verify that the data is returned
  • schema updated

Data sync

  • New rake command bin/rake github:sync has been added to update author data in the application's database as per story requirements
  • Two dependencies have been added to facilitate this rake task (octokit to connect to github API, and literate_randomizer to generate random book titles)
  • Author model updated such that destroying an author from the DB will also destroy books foreign key dependencies
  • rakefile set to look here for author data: https://github.com/scasagrande/bookstore-authors/issues

Some of my thoughts have been posted as comments in-line.

Readme updates to come, and a few modification to the tests to support this are available, but require PR #1 to be merged first.

Copy link
Collaborator

@undergroundwebdesigns undergroundwebdesigns left a comment

Choose a reason for hiding this comment

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

Great first pass, I left a few comments and suggestions for changes I'd like to see, mostly answering your questions and looking for some better error handling.

app/models/author.rb Show resolved Hide resolved
app/models/author.rb Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
lib/tasks/github.rake Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
Copy link
Collaborator

@undergroundwebdesigns undergroundwebdesigns left a comment

Choose a reason for hiding this comment

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

Requested a couple more changes, most notably around using transactions to better ensure data consistency.

lib/tasks/github.rake Outdated Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
lib/tasks/github.rake Outdated Show resolved Hide resolved
Copy link
Collaborator

@undergroundwebdesigns undergroundwebdesigns left a comment

Choose a reason for hiding this comment

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

Looks good! Go ahead and merge this, and that finishes up the API side of this project.

@scasagrande
Copy link
Owner Author

🚢 :shipit: 🚢

@scasagrande scasagrande merged commit bfb0f36 into master Mar 19, 2019
@scasagrande scasagrande deleted the f001_add_author_biographies branch March 19, 2019 18:05
@scasagrande scasagrande restored the f001_add_author_biographies branch March 19, 2019 18:13
@scasagrande scasagrande deleted the f001_add_author_biographies branch March 19, 2019 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants