Add new endpoint to consolidate detailed agreement information for users
To better reflect the current standing and status of users, a way of checking the users current project committer standing for projects is needed. To do this, a new endpoint will be created to indicate the signed agreements for the user. This endpoint will be hosted under a URL similar to https://api.eclipse.org/account/profile/{userId}/agreements. This new data point will contain information on the following agreements, where organizational agreements are dependent on the users indicated employer:
- ECA
- ICA
- MCCA
- WGPA
- IWGPA
Included will be projects that the user participates in, along with the users current standing with the project. This will take into account the users ICA/MCCA status, as well as WGPA and IWGPA documents when applicable for projects related to working group specifications. Included at the bottom of this issue is a sample of JSON data for the projected endpoint, with the given example having a user with a single project relation to a non-specification project.
This new logic will make use of the existing Working Groups API to retrieve the documents associated with each of the working groups, and will look to the foundation database to check for active documents in both the OrganizationDocuments and PeopleDocuments table for WGPA and IWGPA documents respectively. As part of a different feature, we already track the ICA and MCCA document IDs to look for the general committer status, so those values will be reused when checking for individual and organizational standing when appropriate.
Additionally, we’ll want to create a version of this endpoint that allows us to request agreement status by the users GitHub handle as well. To keep things simple, we will add a new endpoint under https://api.eclipse.org/github/profile/{githubId}/agreements which would mostly act as a proxy to the logic. The only deviation is that we would lookup the user object before forwarding the request to the logic to keep it simple.
{
"employer" : {
"organization_id": 658,
"active_member": true,
"mcca": {
"active": false,
"signed_version": 1
},
"wgpa": [
{
"active": false,
"signed_version": 1,
"document_id": "abc-123",
"working_group_alias": "jakarta-ee"
}
]
},
"personal_agreements": {
"iwgpa": [
{
"active": false,
"signed_version": 1,
"document_id": "abc-123",
"working_group_alias": "jakarta-ee"
}
],
"ica": {
"active": false,
"signed_version": 1
},
"eca": {
"active": false,
"signed_version": 1
},
},
"projects": {
"technology.dash": {
"specification_project": false,
"working_group": null,
"agreement_status": true,
"relations": ['CM', 'PL']
}
}
}