Skip to content

Conversation

@PradyumnChauhan
Copy link

Implement Origin Curation Feature (#1932)

Overview

Adds comprehensive origin review, curation, propagation, and deployment capabilities to ScanCode.io, enabling manual review of automated origin determinations and publishing curated results to FederatedCode.

Key Features

  • Review Interface: Filterable dashboard with bulk actions for approving/rejecting relations
  • Manual Curation: Detail views for editing curation status, confidence levels, and notes
  • Propagation: Automated strategies (similarity, directory, package, pattern) to extend trustworthy signals
  • Deployment: Export curated relations to FederatedCode with merge strategies
  • Audit Trail: Complete history tracking via OriginCuration model

Changes

Models & Database

  • scanpipe/models.py - Added OriginCuration and PropagationBatch models, extended CodebaseRelation with curation fields
  • scanpipe/migrations/0077_add_origin_curation.py - Migration for new models and fields

API

  • scanpipe/api/views.py - Added relations, relation_detail, relations_bulk_curate endpoints
  • scanpipe/api/serializers.py - Added curation serializers with history tracking

UI & Views

  • scanpipe/views.py - Added OriginReviewView, OriginCurateView, OriginCurateCreateView, OriginPropagateView, OriginDeployView, OriginBulkCurationView
  • scanpipe/forms.py - Added curation forms (OriginCurationForm, BulkCurationForm, OriginPropagationForm, OriginDeployForm)
  • scanpipe/filters.py - Added curation filters
  • scanpipe/urls.py - Added origin curation routes

Templates

  • scanpipe/templates/scanpipe/origin_*.html - Review, curate, propagate, deploy pages
  • scanpipe/templates/scanpipe/tabset/tab_curation*.html - Curation detail tabs
  • scanpipe/templates/scanpipe/modals/origin_bulk_curation_modal.html - Bulk actions modal
  • Updated project_detail.html and relation_list.html with origin review links

Pipes & Logic

  • scanpipe/pipes/origin_propagation.py - Propagation strategies implementation
  • scanpipe/pipes/federatedcode.py - Export and merge functions for origin curations
  • scanpipe/pipelines/publish_to_federatedcode.py - Integration with deployment pipeline

Documentation

  • docs/api/origin-curation-api.rst - REST API reference
  • docs/origin-curation-guide.rst - User guide
  • docs/tutorial_origin_curation_workflow.rst - Step-by-step tutorial
  • docs/developer/origin-curation-architecture.rst - Architecture documentation
  • docs/index.rst - Added documentation links

Tests

  • scanpipe/tests/test_api.py - API endpoint tests
  • scanpipe/tests/test_views.py - View tests
  • scanpipe/tests/test_models.py - Model tests
  • scanpipe/tests/test_pipelines.py - Pipeline tests
  • scanpipe/tests/pipes/test_*.py - Pipe tests

Approach

The implementation follows a layered architecture: data models with audit trails, UI forms/views for user interaction, REST API for automation, and background pipes for propagation/deployment. All curation actions create OriginCuration history records for full traceability.

Signed-off-by: Pradyumn Chauhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant