lhotari opened a new pull request, #326:
URL: https://github.com/apache/whimsy/pull/326

   ### Problem
   
   The committee roster JSON endpoint fails with HTTP 500 for committees with a 
chair. Example: https://whimsy.apache.org/roster/committee/pulsar.json
   
   ```
   sinatra.error = detected duplicate key "role" in {:name=>"Matteo Merli", 
:date=>"2018-09-19", :role=>"PMC member", "ldap"=>true, 
"githubUsername"=>"merlimat", "asf_githubStringID"=>"merlimat", :member=>true, 
"role"=>"PMC chair"}
   sinatra.route = GET /committee/:name.json
   REQUEST_URI = /roster/committee/pulsar.json
   ```
   
   ### Cause
   
   Roster entries store the role under the symbol key `:role`, but the chair's 
role was set with the string key `'role'`. The chair's hash therefore has both 
`:role` and `"role"`. Older versions of the `json` gem wrote `"role"` twice, 
while newer versions raise "detected duplicate key".
   
   ### Fix
   
   Set the chair role with `:role` in `Committee` 
(`www/roster/models/committee.rb`) and `NonPMC` 
(`www/roster/models/nonpmc.rb`), so that it replaces the existing value rather 
than adding a second key.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to