Project

General

Profile

Actions

Bug #6741

closed

rudder-dev commit fails to assign tickets for non-admin users

Added by Alexis Mousset over 9 years ago. Updated about 8 years ago.

Status:
Released
Priority:
N/A
Category:
Rudder dev tools
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Traceback (most recent call last):
  File "/usr/bin/rudder-dev", line 1058, in <module>
    commit(arguments['<trigraph>'], arguments['<PR_comment>'])
  File "/usr/bin/rudder-dev", line 771, in commit
    user = ask_username(trigraph)
  File "/usr/bin/rudder-dev", line 380, in ask_username
    users = get_normation_users()
  File "/usr/bin/rudder-dev", line 367, in get_normation_users
    user_list = [ u for u in users.json()['users'] if u['mail'].endswith("normation.com") ]
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 799, in json
    return json.loads(self.text, **kwargs)
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Actions #1

Updated by Alexis Mousset over 9 years ago

Redmine's response is a 403.

Related ticker on redmine.org: http://www.redmine.org/issues/7773.

Actions #2

Updated by Alexis Mousset over 9 years ago

  • Subject changed from rudder-dev commit fails to assign tickets to rudder-dev commit fails to assign tickets for non-admin users
Actions #3

Updated by Alexis Mousset over 9 years ago

There is a call to get all members of a project, which is accessible to non-admin users, but it requires to do another request for each member to get first and last name (necessary for trigram) and email to check if it comes from normation.

http://www.rudder-project.org/redmine/projects/rudder/memberships.xml

For now, I am using a static array with the needed information.

Actions #4

Updated by Alexis Mousset about 9 years ago

# Get Normations users from redmine (users that can review)
def get_normation_users():
  #users = requests.get(REDMINE_API_URL + "/projects/" + project +"/memberships.json?name=normation.com", headers = {'X-Redmine-API-Key': REDMINE_TOKEN } )
  #user_list = [ u for u in users.json()['users'] if u['mail'].endswith("normation.com") ]
  user_list = [{"firstname": "Matthieu", "lastname": "Cerda",   "id": "9"},
               {"firstname": "Benoît",   "lastname": "Pecatte", "id": "170"},
               {"firstname": "Vincent",  "lastname": "Membré",  "id": "34"},
               {"firstname": "François", "lastname": "Armand",  "id": "5"},
               {"firstname": "Nicolas",  "lastname": "Charles", "id": "4"},
               {"firstname": "Jonathan", "lastname": "Clarke",  "id": "6"}]
  return user_list
Actions #5

Updated by Benoît PECCATTE about 9 years ago

  • Status changed from New to In progress
  • Assignee set to Benoît PECCATTE
Actions #6

Updated by Benoît PECCATTE about 9 years ago

  • Status changed from In progress to Pending technical review
  • Assignee deleted (Benoît PECCATTE)
  • Pull Request set to https://github.com/Normation/rudder-tools/pull/82
Actions #7

Updated by Benoît PECCATTE about 9 years ago

  • Assignee set to Vincent MEMBRÉ
Actions #8

Updated by Benoît PECCATTE about 9 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #10

Updated by Benoît PECCATTE about 8 years ago

  • Status changed from Pending release to Released
Actions

Also available in: Atom PDF