Assignee causes 422 Validation Error #19

Closed
magnific0 opened this Issue Feb 20, 2014 · 6 comments

Comments

Projects
None yet
4 participants
@magnific0

patch on line 60 of issue.py causes a "422: Validation Error."

Upon inspection of the error the value to the assignee field is 'invalid', APIv3 says the following about this error:

This means the formatting of a field is invalid. The documentation for that resource should be able to give you more specific information.

The value in my case is just a simple string.

@ttencate

This comment has been minimized.

Show comment
Hide comment
@ttencate

ttencate Feb 20, 2014

Owner

No idea... Maybe caused by https://github.com/ttencate/sf2github/pull/18/files? Please send a pull request if/when you figure this out!

Owner

ttencate commented Feb 20, 2014

No idea... Maybe caused by https://github.com/ttencate/sf2github/pull/18/files? Please send a pull request if/when you figure this out!

@codeguru42

This comment has been minimized.

Show comment
Hide comment
@codeguru42

codeguru42 Feb 20, 2014

Contributor

@magnific0 Can you give a specific, complete example of the string value which causes this error?

Contributor

codeguru42 commented Feb 20, 2014

@magnific0 Can you give a specific, complete example of the string value which causes this error?

@magnific0

This comment has been minimized.

Show comment
Hide comment
@magnific0

magnific0 Feb 21, 2014

Hi, thanks for the fast responses I created a small test case and it seems that this occurs for any assignee, but myself. Does the assignee have to be the repo owner or contributor?

#!/usr/bin/env python
import json
import requests
from getpass import getpass

username = "magnific0"
password = getpass('%s\'s GitHub password: ' % username)
auth = (username, password)

updateData = {
    'title': "New title"
}

# Try with repo owner
updateData['assignee'] = username

response = requests.patch("https://api.github.com/repos/magnific0/testpagmo/issues/39", data=json.dumps(updateData), auth=auth)
print response.status_code
print response
print response.json().get('message')
print response.json().get('error')

# 200
# <Response [200]>
# None
# None

updateData['assignee'] = "ttencate"

response = requests.patch("https://api.github.com/repos/magnific0/testpagmo/issues/39", data=json.dumps(updateData), auth=auth)
print response.status_code
print response
print response.json().get('message')
print response.json().get('error')

# 422
# <Response [422]>
# Validation Failed
# None

Hi, thanks for the fast responses I created a small test case and it seems that this occurs for any assignee, but myself. Does the assignee have to be the repo owner or contributor?

#!/usr/bin/env python
import json
import requests
from getpass import getpass

username = "magnific0"
password = getpass('%s\'s GitHub password: ' % username)
auth = (username, password)

updateData = {
    'title': "New title"
}

# Try with repo owner
updateData['assignee'] = username

response = requests.patch("https://api.github.com/repos/magnific0/testpagmo/issues/39", data=json.dumps(updateData), auth=auth)
print response.status_code
print response
print response.json().get('message')
print response.json().get('error')

# 200
# <Response [200]>
# None
# None

updateData['assignee'] = "ttencate"

response = requests.patch("https://api.github.com/repos/magnific0/testpagmo/issues/39", data=json.dumps(updateData), auth=auth)
print response.status_code
print response
print response.json().get('message')
print response.json().get('error')

# 422
# <Response [422]>
# Validation Failed
# None
@jpschewe

This comment has been minimized.

Show comment
Hide comment
@jpschewe

jpschewe Apr 6, 2014

Contributor

The assignee needs to be someone that is listed as a contributor. So the script should actually have a list of known contributors and skip the assignment to unknown contributors. This would happen if you had 4 people on SourceForge and only 3 of them are on Github.

Contributor

jpschewe commented Apr 6, 2014

The assignee needs to be someone that is listed as a contributor. So the script should actually have a list of known contributors and skip the assignment to unknown contributors. This would happen if you had 4 people on SourceForge and only 3 of them are on Github.

@codeguru42

This comment has been minimized.

Show comment
Hide comment
@codeguru42

codeguru42 Aug 7, 2014

Contributor

Is this fixed with 3ea23e9?

Contributor

codeguru42 commented Aug 7, 2014

Is this fixed with 3ea23e9?

@ttencate

This comment has been minimized.

Show comment
Hide comment
@ttencate

ttencate Aug 7, 2014

Owner

Yes, I think so.

Owner

ttencate commented Aug 7, 2014

Yes, I think so.

@ttencate ttencate closed this Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment