Fix large code duplication
Several observations have bene made about ways in which major components/functions of the codebase are duplicated, requireing changes to be made in more than one place.
- #3338
- #3342 (the fix is made in multiple places that access the database)
- #3357 (helps fix duplication in reading from config
- The get_section in lib.py (more reading from config dupe not addressed by the above
- augur backend start cli function and augur api start cli function seem to be very similar...
Is there a historical reason for this?
@sgoggins
I think this is almost certainly technical debt that was introduced when we were refining contributor resolution.
There are a few files with suffix _old two of them are in the data models module
looking specifically at the two data insertion methods touched by #3342 - a codebase wide search indicates that
insert_data (2020, seemingly no specific reason to add) is used by the tables/models:
- CollectionStatus
- Config
- Repo
- UserGroup/UserRepo
- Contributor
- Message
- PR/IssueMessageRef
- PullRequest
- PRAssignee/reviewer/Meta
- PRReviewMessageRef
- PRFile/PRCommit
bulk_insert_dicts (created apr 2024 by andrew to remove db session dependence) is used by:
- Contributor
- ContributorRepo
- CommitMesage
- RepoDepsLibyear
- RepoDependency
- RepoDepsScorecard
- RepoLabor
- Issue/PREvent
- Issue Label/Assignee
- RepoClone
- Repo
- ContributorsAlias
- UnresolvedCommitEmail
- PRLabel/Assignee/Reviewer/Meta
- Message
- PRReviewMessageRef
- Release
- repoInfo
- Issue/PREvent
- Issue
- IssueMessageRed
- PullRequest
- and more.....
So this seems more complex than just duplicate code....