narrowizard commented on issue #8393:
URL:
https://github.com/apache/incubator-devlake/issues/8393#issuecomment-2817449196
**Implementation Plan**
To support a new QA domain in DevLake and enable CSV import through the
Customize plugin, the following implementation plan is proposed:
1. **QA Domain Schema Design**
Introduce a dedicated QA domain to capture testing-related data. Core
entities:
- `QaProject`: Represents a testing project or scope. It will be
implicitly created via test case data.
- `QaApi` *(optional)* – represents API metadata for coverage metrics.
- `QaTestCase` – represents individual test cases, including type
(functional or API), and links to APIs and projects.
- `QaTestCaseExecution` – represents execution records of test cases,
including timestamps and status.
`QaProject` will be derived from the `qa_test_cases.csv` import, using
fields like `qa_project_id` and `qa_project_name`.
2. **Customize Plugin Extension**
Extend the Customize plugin to support CSV imports for the QA domain
using standardized endpoints. Each CSV file corresponds to one importable
entity via the following pattern:
| CSV File | API Endpoint
| Description |
|--------------------------------|--------------------------------------------------------------|--------------------------------|
| `qa_apis.csv` *(optional)* | `POST
/plugins/customize/csvfiles/qa_apis.csv` | Imports API
metadata |
| `qa_test_cases.csv` | `POST
/plugins/customize/csvfiles/qa_test_cases.csv` | Imports test cases
+ projects + apis |
| `qa_test_case_executions.csv` | `POST
/plugins/customize/csvfiles/qa_test_case_executions.csv` | Imports test
execution records |
Each endpoint:
- Accepts a CSV file upload.
- Automatically maps and ingests data into the corresponding QA domain
entity.
3. **Incremental Import Support**
- Use `id` as the primary key to identify each row.
- Optional deduplication logic may be applied depending on import mode.
- For `QaProject`, ensure uniqueness via `qa_project_id`.
4. **CSV Format Specification**
Based on MeterSphere schema and export capabilities, the CSV schemas are:
**qa_test_cases.csv**
- `id`, `name`, `create_time`, `creator_id`, `type` (`functional` or
`api`)
- `api_id` *(nullable)*, `api_name`, `api_create_time`, `api_creator_id`
*(optional, used to create/import `QaApi`)*
- `qa_project_id`, `qa_project_name` *(used to create/import `QaProject`)*
**qa_test_case_executions.csv**
- `id`, `qa_test_case_id`, `qa_project_id`
- `create_time`, `start_time`, `finish_time`
- `creator_id`, `status` (`PENDING`, `IN_PROGRESS`, `SUCCESS`, `FAILED`)
**qa_apis.csv** *(optional)*
- `id`, `name`, `create_time`, `creator_id`, `qa_project_id`
5. **Documentation**
- Add CSV schema definitions and examples to DevLake documentation.
- Provide import instructions for each endpoint using
`/plugins/customize/csvfiles/{csvfilename}.csv`.
- Clarify the expected relationships between test cases, executions,
APIs, and projects.
--
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]