Skip to content

Conversation

@isasmendiagus
Copy link
Contributor

No description provided.

isasmendiagus and others added 4 commits July 1, 2025 13:53
- Add local dependency with replace directive in go.mod
- Replace individual model initialization with unified ScanossModels wrapper
- Update AllUrlsModel to use shared helper functions for component selection
- Replace local pickOneUrl implementation with helpers.PickOneURL
- Add interface adapter for ProjectModel to support helpers.ProjectRepository
- Update GolangProjects model to use shared library types and helpers
- Add conversion functions between local and shared AllURL types
- Fix nil pointer handling for optional project repository
- All tests passing with shared library integration

This integration eliminates code duplication and provides unified PURL-based
logic across SCANOSS services while maintaining backward compatibility.
- Remove duplicated Project, Version, License, Mine models (4 files)
- Remove corresponding test files (4 test files)
- Update all_urls.go to use shared library ProjectModel and helpers
- Update golang_projects.go to use shared library model constructors
- Update test files to use shared library imports and constructors
- All tests passing with 8 files removed (~500+ lines eliminated)

This completes the cleanup phase by removing code duplication while
preserving all functionality through the shared library integration.
Dependencies service now properly uses go-models-helper for all basic models.
- Remove remaining duplicated AllUrls model (218 lines)
- Remove remaining duplicated GolangProjects model (218+ lines)
- Remove corresponding test files (4 additional test files)
- Dependencies service now uses shared library models directly
- No local model wrappers or conversion functions needed
- All tests passing with complete shared library integration

Total cleanup: 12 model files removed, ~1500+ lines of duplicated code eliminated.
Dependencies service now has zero model duplication with other SCANOSS services.
- Simplified NewDependencies constructor to accept only models parameter
- Moved models creation to service layer for proper request-scoped instances
- Updated DependencyUseCase struct to remove redundant fields (logger, conn)
- Added Logger() getter method to ScanossModels for clean access
- Each request now gets fresh models instance with request-specific logger
- Improved scalability and separation of concerns
- All tests passing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants