lf-engineering / easycla-api Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED - NOT USED - A backend API for the EasyCLA web application
License: MIT License
DEPRECATED - NOT USED - A backend API for the EasyCLA web application
License: MIT License
Create a new templates table and support service for the EasyCLA system.
The EasyCLA system requires a standard template for Project Managers to select from in order to establish legal documents for their project CLA. This issue will provide a database table and API services to support creating, searching, updating and deleting the templates.
This task is to create an API for Repository Management.
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.
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.
Define a swagger specification for creating one or more repositories under a given project.
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.
Define the repository database schema using dbmate
. Fields might include:
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
The "done" criteria when this feature or problem is resolved. Such as:
This task is to create an API for CLA Group Management
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.
The CLA Group consists of:
This task will define, implement, validate and test the API services supporting creating, updating, viewing, searching and deleting CLA Groups.
dbmate
. Fields might include:
This is the first piece of several to establish the Project/CLA Group/Template setup required for on-boarding a project.
See existing cla-project-{STAGE}
table concepts/schema already defined in DynamoDB for an example.
Summary
Develop the backend service to support the LFX EasyCLA Organization Dashboard (Member Manager View).
Background
The LFX EasyCLA Organization Dashboard front-end, request/response models are documented in the [EasyCLA v2 PRD](https://confluence.linuxfoundation.org/display/PROD/EasyCLA+v2+PRD#EasyCLAv2PRD-OrganizationDashboard(MemberManagerView). Enhance the existing API to incorporate the referenced path/endpoint.
User Story
As an LFX Community Bridge EasyCLA Organization Manager, I can view the list of Foundations affiliated with my Organization.
Tasks
orgs
package in the main folderswagger/cla.yml
)orgs
package to map the API spec to a specific handler function. For examples, see EasyCLA v1 go backend or Organization ServiceAcceptance Criteria
The "done" criteria when this feature or problem is resolved. Such as:
References
Implement the framework for the GitHub Activity Callback.
In order to support EasyCLA management of checks on GitHub, a callback handler must be implemented. We will register a GitHub app within the LFX Community Bridge organization which will include a callback URL. This URL will be implemented in this API and support a number of events including open PR, close PR, reopen PR, sync and a few others. This handler will initially support parsing the messages to determine the event type.
As a developer, I want the EasyCLA bot to check the CLA database when a PR is opened.
Summary
Create an Audit Service for recording events in the EasyCLA system.
Background
Since the EasyCLA system processes permissions relating to legal CLA documents, a comprehensive audit log needs to record all access and permission events. Examples include add permission, delete permission, create a signature, delete a signature, add/update/delete whitelist entry.
Task
dbmate
documentationdbmate new create_audit_table
to construct a SQL script to provision and migrate the audit table definition. Include this in the PR.Suggested columns (will refine):
-- migrate:up
define a database table schema.{"github_whitelist": ["prasannamahajan", "ddeal"]}
Also:
SearchEvent
, should include search by event type, by the user, project id, company/org, and by a time window. Support any combination of these parameters. Also, include pagination params as well: page_size/limit, offset, order_by as the list of events may/will be large.SearchEvent
SearchEvent
SearchEvent
.CreateEvent
CreateEvent
- note: this service will NOT have a public endpoint or definition in swagger.We’ll use this for auditing everything in the backend/events, etc.
Acceptance Criteria
References
We have similar examples of a Search Endpoint used in the Platform Core Services, such as the Organization Service: https://github.com/LF-Engineering/organization-service/blob/master/swagger/organization-service.yaml#L61 (private repo).
Data migration from the existing DynamoDB database to the v2 RDS instance.
The EasyCLA v2 system will need to migrate existing data from the old v1 system into the new database model. This will require a migration script that can read from the existing DynamoDB database from {DEV, STAGING, and PROD} and write to the Aurora RDS PostgreSQL database tables in {DEV, STAGING, and PROD}. We will initially test by exporting data from DynamoDB DEV to a local PostgreSQL instance on the developer's machine. We will work to migrate the CLA specific data including signatures, permissions, and other metadata. We will not transfer data that is currently duplicated in our 'system of record' database: Salesforce.
--dry-run
mode which exercises the code but does not import the data.The "done" criteria:
See @dealako for script setup examples and usage of existing v1 python models.
Build out the EasyCLA v2 API service to support the LFX CLA Member Project page.
This task will build out the EasyCLA API v2 swagger, handler, service, and repository/db backend logic to support the LFX CLA Member Project page.
[ ] Provide an API endpoint in the v2 swagger specification to support the LFX CLA Member Project page.
[ ] Develop the request/response/error models within the swagger specification - leverage the UI mock data and existing data models to outline the fields
[ ] Generate the code using go-swagger, review, iterate
[ ] Write a handler to process the incoming request - add to the server startup logic
[ ] Write a service layer, connect the service layer to the handler
[ ] Write a repository layer, connect the repository to the service layer
[ ] Test/validate the service
[ ] Write unit tests
When provided the project identifier, return the CLA Member project page details. Demonstrate locally and in the DEV environment.
https://lfx.dev.platform.linuxfoundation.org/foundation/cncf/cla
We want to leverage the API Gateway Authentication headers to apply role-based access to the Easy CLA services.
The EasyCLA v2 system will reside behind the LF platform API Gateway. The REST services we develop will be protected by the Gateway and the ACS service. We need to leverage this by restricting access based on user roles.
Example 1:
Example 2:
Demonstrate to the stakeholders.
See the LF Core Platform organization or the project service as an example.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.