chore: remove unsed cm db connection from software-value [CM-787]#3920
chore: remove unsed cm db connection from software-value [CM-787]#3920
Conversation
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
|
|
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
Removes the unused CM database configuration and connection logic from the software_value service so it only manages the Insights database, reducing configuration surface area and simplifying runtime behavior.
Changes:
- Removed CM DB fields/env parsing from
Config, keeping only Insights DB configuration. - Deleted CM DB connection types and constructors, leaving a single Insights DB connection path.
- Simplified main execution flow by removing CM DB connect/close handling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/apps/git_integration/src/crowdgit/services/software_value/config.go | Drops CM DB config from the service configuration parsing. |
| services/apps/git_integration/src/crowdgit/services/software_value/db.go | Removes CM DB connection wrapper; retains Insights DB connection and persistence methods. |
| services/apps/git_integration/src/crowdgit/services/software_value/main.go | Removes CM DB initialization/teardown and related error handling. |
Comments suppressed due to low confidence (1)
services/apps/git_integration/src/crowdgit/services/software_value/db.go:89
- These comments reference PostgreSQL 14 for the (now-removed) CM database. Since the service no longer manages a CM DB connection, please update/remove this rationale so it reflects the actual database(s) this code targets.
// From PostgreSQL 15 and newer, there's another way to do this: https://www.postgresql.org/docs/15/sql-merge.html
// But since we currently use PostgreSQL 14 for CM, and despite me having created a database for this using 15,
// I'll keep this compatible with 14, just in case.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| } | ||
|
|
||
| // newDBConnection establishes a new database connection pool. | ||
| // This is a helper function used by NewInsightsDB and NewCMDB. |
This pull request removes all code related to the CM database from the
software_valueservice, simplifying the configuration and database management logic. The changes eliminate the CM database configuration, connection setup, and resource management, focusing the service solely on the Insights database.Configuration cleanup:
CMDatabasefield from theConfigstruct and all associated environment variable parsing inconfig.go, so only the Insights database configuration remains. [1] [2]Database logic simplification:
CMDBstruct and its connection management functions (NewCMDB,Close) fromdb.go, leaving only the Insights database logic. [1] [2]Main service logic update:
main.go, streamlining repository processing to use only the Insights database.Other cleanup:
main.gofor code tidiness.Note
Low Risk
Low risk: this is a deletion-only cleanup that drops unused CM DB env/config and connection setup, with minimal impact beyond deployments that still set/expect those variables.
Overview
Simplifies
software_valueto use only the Insights database.Removes the
CMDatabasefield and allCROWD_DB_*environment parsing fromconfig.go, deletes theCMDBtype plusNewCMDB/Closefromdb.go, and drops CM DB connect/cleanup logic frommain.goso repository processing only initializesNewInsightsDB.Written by Cursor Bugbot for commit f1d7968. This will update automatically on new commits. Configure here.