Skip to content

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

Open
pellecchialuigi wants to merge 2 commits intomainfrom
fix-api-new-v
Open

Add API new version cloning and complete fork endpoints for all work …#268
pellecchialuigi wants to merge 2 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 <lpellecc@redhat.com>
@pellecchialuigi pellecchialuigi added enhancement New feature or request fix testing labels Apr 4, 2026
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 <lpellecc@redhat.com>
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