-
Notifications
You must be signed in to change notification settings - Fork 5
Repository Management CRUD Service #35
Description
Summary
This task is to create an API for Repository Management.
Background
A CLA Group is a logical organization under a single Foundation (also often called a Project) that groups a collection of related source code organizations (e.g. GitHub Organization or Gerrit Group) and/or repositories under a single CLA legal grouping/policy. This task will define, implement, validate and test the API services supporting creating, updating, viewing, searching and deleting of repositories under a CLA Group.
User Story
As a project manager, I want to add a set (one or more) of GitHub repositories to my project.
As a project manager, I want to delete a set (one or more) of GitHub repositories to my project.
As a project manager, I want to search the GitHub repositories by the repository name under my project.
Tasks
-
Define a swagger specification for creating one or more repositories under a given project.
- The swagger specification will accept the foundation/project id (SFID) and the CLA Group id, the repository type (GitHub, Gerrit, GitLab, etc.), and one or more repositories to add.
-
Define a swagger specification for deleting a set (one or more) repositories under a CLA Group
-
Define a swagger specification for searching or listing a list of repositories under a Project/CLA Group. Include pagination params as well: page_size/limit, offset, order_by as the list of parameters.
- Should be able to search all repositories under the Project/CLA Group
- Should be able to search/filter by repository type
- Should be able to search/filter by repository name
- Should be able to search/filter by repository organization
-
Define the repository database schema using
dbmate. Fields might include:- repository_id: pk GUID type v4 or something similar
- repository_type: a string representing the repository type (GitHub, Gerrit, GitLab, etc.)
- repository_name - the name of individual repository on GitHub/Gerrit/GitLab, etc.
- repository_organization_name - the name of the repository parent organization
- repository_url - the repository URL, such as github.com/communitybridge/easycla
- repository_enabled - a flag to indicate if this repository is enabled for this Project/CLA Group (may not need this) - default TRUE
- project_id - the SFDC project id
- cla_group_id - the CLA Group ID
- date_created - the date the repository was added
-
Create a repo implementation for the CRUD operations defined above
-
Create a service layer to support the REST operations defined above
-
Create an API handler to bin the Swagger specification to the implementation
-
Add the handler/service/repo to the setup to stitch it together
-
Create an audit event in the audit table when a repository is added, updated or deleted
-
test/validate CRUD operations
Acceptance Criteria
The "done" criteria when this feature or problem is resolved. Such as:
- Unit Tests added and running in CI
- Functional Tests updated to cover feature, if applicable
- Demonstrate the set of capabilities to the product team while the code is
running in the DEV environment.
References
- EasyCLA v1 repository schema: https://confluence.linuxfoundation.org/display/PROD/EasyCLA+Version+1+Database+Schema+Walkthrough#EasyCLAVersion1DatabaseSchemaWalkthrough-Repositories
- UX Mock Ups that leverage this service: https://wireframepro.mockflow.com/view/app-easycla#/page/D2f18f9c3dbacbc216821b379b96a0347