Skip to content

When a user does not exist in contributors, the script blows up #2

aclark4life opened this Issue Sep 26, 2012 · 2 comments

3 participants

Plone Collective member


3163 - 1099/5000 - GET -
    - --auto-collective.codemirror-owners - ADDED MEMBERS:
3164 - 1098/5000 - PUT -
{'headers': {'Authorization': 'Basic cGxvbmUtZm91bmRhdGlvbjpnYXJiYXNpc2dldHRpbmdvbGQzMA==',
             'Content-Length': '0'},
 'url': u''}
'{"message":"Not Found"}'
Traceback (most recent call last):
  File "/opt/github-collective/bin/github-collective", line 8, in <module>
    load_entry_point('github-collective==0.1.4', 'console_scripts', 'github-collective')()
  File "/opt/github-collective/githubcollective/", line 81, in run
    ).run(new, old)
  File "/opt/github-collective/githubcollective/", line 150, in run
    self.add_team_member(old, old_team, member)
  File "/opt/github-collective/githubcollective/", line 248, in add_team_member
    return self.github._gh_org_add_team_member(, member)
  File "/opt/github-collective/githubcollective/", line 148, in _gh_org_add_team_member
    return self._put_request('/teams/%s/members/%s' % (id, member))
  File "/opt/github-collective/githubcollective/", line 80, in _put_request
    return self._request(requests.put, url)
  File "/opt/github-collective/githubcollective/", line 61, in _request
    raise e
requests.exceptions.HTTPError: 404 Client Error

Plone Collective member
davidjb commented Oct 2, 2012

This could be an interesting one to attempt to fix. The obvious option would be check all user IDs mentioned in a configuration file to see if they exist, but this is going to be a long process since the GitHub API only allows 1 look up at a time. Caching is probably the best way to go, but then the same issue will happen when/if someone removes their account -- this is a lot less likely to happen compared to someone making a typo when changing the config.

Sound reasonable / other suggestions?


This seems very similar to the 422 error if the user is not in the org.

My general thought was to maybe just catch the exception and write a list of bad users to a log file if they dont exist at all, and another file if they aren't in the org. possibly add a switch to '--invite-missing-members' that invites them as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.