Skip to content

Add API new version cloning and complete fork endpoints for all work …#268

Merged
pellecchialuigi merged 8 commits intomainfrom
fix-api-new-v
Apr 13, 2026
Merged

Add API new version cloning and complete fork endpoints for all work …#268
pellecchialuigi merged 8 commits intomainfrom
fix-api-new-v

Conversation

@pellecchialuigi
Copy link
Copy Markdown
Collaborator

Refers to #228

  • Add /apis/new-version endpoint to clone a software component with all its mappings (sw-requirements, test-specifications, test-cases, documents, justifications) into a new library version
  • Implement remaining fork endpoints: test-specification, test-case, and justification for both direct API and indirect sw-requirement/ test-specification parent mappings
  • Extract get_api_from_indirect_test_specification_mapping helper to resolve parent API from TestSpecificationTestCase mappings
  • Fix fork() methods in mapping models to correctly propagate parent links (if/elif mutual exclusivity, FK-only assignment to avoid SQLAlchemy cascade issues on self-referential relationships)
  • Add fork() method to JustificationModel, TestCaseModel, and TestSpecificationModel
  • Remove redundant session.add() calls on already-tracked objects
  • Extract permission helpers (hasReadPermission, hasWritePermission, etc.) into constants.tsx replacing inline indexOf checks
  • Add New Version modal and menu entries in the frontend
  • Add unit tests for all 10 fork endpoints (api/test/test_fork.py)

…item types

- Add /apis/new-version endpoint to clone a software component with all
  its mappings (sw-requirements, test-specifications, test-cases,
  documents, justifications) into a new library version
- Implement remaining fork endpoints: test-specification, test-case, and
  justification for both direct API and indirect sw-requirement/
  test-specification parent mappings
- Extract get_api_from_indirect_test_specification_mapping helper to
  resolve parent API from TestSpecificationTestCase mappings
- Fix fork() methods in mapping models to correctly propagate parent
  links (if/elif mutual exclusivity, FK-only assignment to avoid
  SQLAlchemy cascade issues on self-referential relationships)
- Add fork() method to JustificationModel, TestCaseModel, and
  TestSpecificationModel
- Remove redundant session.add() calls on already-tracked objects
- Extract permission helpers (hasReadPermission, hasWritePermission,
  etc.) into constants.tsx replacing inline indexOf checks
- Add New Version modal and menu entries in the frontend
- Add unit tests for all 10 fork endpoints (api/test/test_fork.py)

Signed-off-by: Luigi Pellecchia <[email protected]>
@pellecchialuigi pellecchialuigi added enhancement New feature or request fix testing labels Apr 4, 2026
Luigi Pellecchia and others added 7 commits April 10, 2026 23:36
Extract status codes, response types, and ApiResponse/api_response_decorator
into api/api_response.py and route handlers through it. Replace ad hoc field
checks with get_wrong_mandatory_fields for clearer validation feedback.

Remove the obsolete api_url.py stub and containerfile comments that referenced
it. Add .coveragerc to omit api/test from coverage; adjust pyproject.toml.

Frontend: expand Constants (API_BASE_URL, endpoint paths, mapping path builders,
HTTP success helpers) and update screens to use them instead of scattered
literals.

Add broad API integration tests for mappings, user flows, files, notifications,
permissions, and related routes.

Signed-off-by: Luigi Pellecchia <[email protected]>
Enhance Prettier check with error handling and output
Signed-off-by: Luigi Pellecchia <[email protected]>
…he args variable even if we moved to request_data

Signed-off-by: Luigi Pellecchia <[email protected]>
Introduce 16 pytest test modules covering admin operations, user
lifecycle, test run configuration, traceability scanner, and
specification mapping endpoints.

Fix plugin presets fetch in TestRunConfigForm and TestResultsModal to
gracefully handle non-OK responses and non-array payloads instead of
crashing on malformed data.

Signed-off-by: Luigi Pellecchia <[email protected]>
Signed-off-by: Luigi Pellecchia <[email protected]>
@pellecchialuigi pellecchialuigi merged commit ab01f67 into main Apr 13, 2026
3 of 4 checks passed
@pellecchialuigi pellecchialuigi deleted the fix-api-new-v branch April 13, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fix testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant