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

Adding support for working with stories from the API client, as well as adding aggregation support in the backend #1134

Merged
merged 20 commits into from
Mar 13, 2020

Conversation

kiddinn
Copy link
Contributor

@kiddinn kiddinn commented Mar 11, 2020

This PR does quite a few things:

  1. Increments client API version number
  2. Adds a Story class that can add views and text to a story
  3. Adds the ability to delete a story from a sketch in the API
  4. Adds some logging into the API client for failed resource fetches
  5. Adds the ability to create and list stories in the sketch object for the API client
  6. Adds ability to manipulate and work with stories and individual blocks in the API client
  7. Adds the ability for analyzers to add aggregation to stories.
  8. Fixes an issue where API client tests weren't run and fixes broken tests

@kiddinn kiddinn self-assigned this Mar 12, 2020
@kiddinn kiddinn marked this pull request as ready for review March 12, 2020 12:55
@kiddinn kiddinn requested a review from berggren March 12, 2020 12:56
@kiddinn kiddinn changed the title Adding the ability to work with stories from the API Adding support for working with stories from the API client, as well as adding aggregation support in the backend Mar 13, 2020
Copy link
Contributor

@berggren berggren 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, just a couple of small things

response_json = response.json()
story_dict = response_json.get('objects', [{}])[0]
return story.Story(
story_id=story_dict.get('id', -1),
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't remember why, cjhanged to zero


Args:
story_id: an integer indicating the ID of the story to
be fetched. Defaults to None.
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this argument required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, either one... if need to provide either one, if you provide story_title the first instance of a story with that title will be returned... made that a bit more clear in the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, is this really what we want? Oh, a Story for that sketch right? that would make sense

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, this is for the sketch. All good

@kiddinn kiddinn requested a review from berggren March 13, 2020 14:42
@kiddinn
Copy link
Contributor Author

kiddinn commented Mar 13, 2020

responded to comments

Copy link
Contributor

@berggren berggren left a comment

Choose a reason for hiding this comment

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

LGTM


Args:
story_id: an integer indicating the ID of the story to
be fetched. Defaults to None.
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, is this really what we want? Oh, a Story for that sketch right? that would make sense


Args:
story_id: an integer indicating the ID of the story to
be fetched. Defaults to None.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, this is for the sketch. All good

@kiddinn kiddinn merged commit 48b0fc1 into google:master Mar 13, 2020
@kiddinn kiddinn deleted the api_stories branch March 13, 2020 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants