Skip to content

Comments

Try to split player service (To review)#1253

Closed
raskyer wants to merge 12 commits intoPokemonGoF:devfrom
raskyer:dev2
Closed

Try to split player service (To review)#1253
raskyer wants to merge 12 commits intoPokemonGoF:devfrom
raskyer:dev2

Conversation

@raskyer
Copy link
Contributor

@raskyer raskyer commented Jul 27, 2016

Short Description:
Try to make services inside this mess (first incrementation)

@raskyer raskyer changed the title Try to split player service [WIP] Try to split player service Jul 27, 2016
@raskyer raskyer changed the title [WIP] Try to split player service Try to split player service (To review) Jul 27, 2016
@douglascamata
Copy link
Member

Merge conflicts :/

@raskyer
Copy link
Contributor Author

raskyer commented Jul 27, 2016

@douglascamata fix

@raskyer
Copy link
Contributor Author

raskyer commented Jul 27, 2016

Got other stuff to fix

response = self.get_inventory()
inventory = list()

if not 'responses' in response:
Copy link
Contributor

Choose a reason for hiding this comment

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

can't this whole thing be

r = response.get('responses', {}).get('GET_INVENTORY', {}).get('inventory_delta', {}).get('inventory_items', {})

@fredrik-hellmangroup
Copy link
Contributor

what was the 'fix' commit a4c7426 ?

@douglascamata
Copy link
Member

@LeaklessGfy you mixed a lot of fixes with code move and we're a bit afraid to merge this. Can you organise commits in a better way? Maybe split this PR in 2 (or more):

  1. Just code extraction from bot's main class
  2. Fixes to the extracted code

@jtdroste
Copy link
Contributor

Please use the .get method on dicts, rather than checking every nested level and returning if it doesn't exist. This extends @TheSavior's comment - however there's two other areas that are just like it that I'd like you to change.

In the future PLEASE title your commits appropriately. Having a commit message say "Fix" gives us NO information what was changed


for item in inventory_dict:
try:
# print(item['inventory_item_data']['item'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove all commented-out code.

@raskyer
Copy link
Contributor Author

raskyer commented Jul 28, 2016

All the comment are pretty interesting because I just move code on this PR. No new function so these comment concern former dev' not me especially. But I can do that of curse.

This merge is important because it's the first step to get thing more modular and structured.

@elicwhite
Copy link
Contributor

@LeaklessGfy I think @douglascamata's last comment represents accurately where the dev team feels about this:

@LeaklessGfy you mixed a lot of fixes with code move and we're a bit afraid to merge this. Can you organise commits in a better way? Maybe split this PR in 2 (or more):

Just code extraction from bot's main class
Fixes to the extracted code

We are scared of this large of a refactor. It's too hard to feel confident in it from looking at the diff. If there is any way to split it up into smaller PRs, it would be beneficial to all of us and they would get merged quicker.

@raskyer
Copy link
Contributor Author

raskyer commented Jul 28, 2016

The problem of this refacto it's that it's a structural refacto .. hard to push it into little commit.

When you look at the method changes, this is log method etc ... not really fundamental method.

Moreover, there's still shortcut for these method inside the former class. (Before actually develop a service container, which is on the pip).

Maybe test it ?

@elicwhite
Copy link
Contributor

This PR is really far behind dev and difficult to review properly. We would still love to split this file up but would prefer doing it in many smaller, easy to understand pull requests.

@LeaklessGfy, if you are still interested in doing that, it would be much appreciated but we would understand if you don't.

@elicwhite elicwhite closed this Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants