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

Create Process Story Service #315

Merged
merged 3 commits into from
Jan 4, 2022
Merged

Create Process Story Service #315

merged 3 commits into from
Jan 4, 2022

Conversation

andrewyguo
Copy link
Collaborator

@andrewyguo andrewyguo commented Jan 3, 2022

Notion ticket link

Ticket

Implementation description

  • Create process story service that reads file and extracts story information without committing changes to the database

Steps to test

  1. Place this file in your root directory
    test_story_file.docx

  2. Log in as Angela Merkel on GQL and retrieve the auth_token, set the variable auth_token

  3. Run curl http://localhost:5000/graphql -F operations='{"query": "mutation ($file: Upload!) { processStory(storyFile: $file) { storyContents }}","variables": {"file": null}}' -F map='{ "0": ["variables.file"]}' -F 0=@test_story_file.docx -H "Authorization: Bearer $auth_token"

  4. This command should return the contents of the file

What should reviewers focus on?

  • Correct information is being returned from calling the mutation

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • For backend changes, I have run the appropriate linters: docker exec -it planet-read_py-backend_1 /bin/bash -c "black . && isort --profile black ." and I have generated new migrations: flask db migrate -m "<your message>"
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@github-actions
Copy link

github-actions bot commented Jan 3, 2022

Visit the preview URL for this PR (updated for commit b973b7f):

https://planet-read-uwbp--pr315-create-process-story-ot6xak7s.web.app

(expires Tue, 11 Jan 2022 04:23:05 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@andrewyguo andrewyguo changed the title Create Process Story Create Process Story Service Jan 3, 2022
@andrewyguo andrewyguo marked this pull request as ready for review January 3, 2022 18:57
@andrewyguo andrewyguo force-pushed the Create_Process_story branch 6 times, most recently from 4273777 to 6c68aa6 Compare January 3, 2022 19:31
Copy link
Contributor

@gaoxk gaoxk left a comment

Choose a reason for hiding this comment

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

gotta meeting coming up, will test pr afterwards
edit: oops meant to hit "request changes"

Copy link
Contributor

@gaoxk gaoxk left a comment

Choose a reason for hiding this comment

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

tested and worked as expected

backend/python/app/graphql/mutations/story_mutation.py Outdated Show resolved Hide resolved
Copy link
Contributor

@gaoxk gaoxk left a comment

Choose a reason for hiding this comment

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

feel free to merge after making changes. fyi theres no auth requirement on the mutation rn so this is the actual call to test:

curl http://localhost:5000/graphql -F operations='{"query": "mutation ($file: Upload!) { processStory(storyFile: $file) { storyContents }}","variables": {"file": null}}' -F map='{ "0": ["variables.file"]}' -F 0=@the_musical_donkey.docx 

@andrewyguo andrewyguo merged commit de295f2 into main Jan 4, 2022
@andrewyguo andrewyguo deleted the Create_Process_story branch January 4, 2022 04:26
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