Contributing
Contributing to testing-api
We welcome contributions to the Supervised AI testing API structure. To maintain consistency across our platform's testing suite, please follow these guidelines when proposing structural changes or updating data models.
How to Propose Changes
If you need to modify the API testing structure or introduce new endpoints to the mock environment, follow this workflow:
- Fork and Branch: Create a feature branch from the
mainbranch. - Implement Changes: Update the relevant schema definitions or structural logic.
- Validate: Ensure your changes do not break existing test consumers.
- Submit a PR: Provide a clear description of why the structural change is necessary and which platform features it supports.
Updating response.json
The response.json file serves as the primary data source for expected API outputs. When the platform's API contract changes, this file must be updated to reflect the new state.
Guidelines for Data Updates
- Type Consistency: Ensure that new fields match the data types (string, integer, boolean) expected by the Supervised AI platform.
- Minimalism: Only include fields that are necessary for testing the specific API logic.
- Valid JSON: Always validate your JSON structure before submitting a pull request.
Example Update
When adding a new test case to response.json, follow the existing schema:
{
"test_case_id": "TC-005",
"endpoint": "/v1/ai/inference",
"expected_response": {
"status": "success",
"data": {
"confidence_score": 0.98,
"labels": ["active", "verified"]
}
}
}
Structural Guidelines
When proposing changes to the testing structure:
- Backward Compatibility: Avoid removing fields that are currently used in active CI/CD pipelines unless it is a coordinated breaking change.
- Naming Conventions: Use
snake_casefor all keys within the JSON structures to maintain alignment with the Supervised AI internal standards. - Documentation: If you introduce a new testing category, add a brief description of its purpose in the PR notes.
Pull Request Process
- Ensure the
response.jsonfile is correctly formatted. - Update any related documentation if your change introduces a new testing pattern.
- Tag the relevant project maintainers for a review.
- Once the PR is approved and merged, the new structure will be available for all downstream testing consumers.