Skip to content

chore: remove unsed cm db connection from software-value [CM-787]#3920

Open
mbani01 wants to merge 1 commit intomainfrom
chore/remove_cm_db_connection_from_sv
Open

chore: remove unsed cm db connection from software-value [CM-787]#3920
mbani01 wants to merge 1 commit intomainfrom
chore/remove_cm_db_connection_from_sv

Conversation

@mbani01
Copy link
Contributor

@mbani01 mbani01 commented Mar 13, 2026

This pull request removes all code related to the CM database from the software_value service, 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:

  • Removed the CMDatabase field from the Config struct and all associated environment variable parsing in config.go, so only the Insights database configuration remains. [1] [2]

Database logic simplification:

  • Deleted the CMDB struct and its connection management functions (NewCMDB, Close) from db.go, leaving only the Insights database logic. [1] [2]

Main service logic update:

  • Removed CM database connection setup, error handling, and closure from main.go, streamlining repository processing to use only the Insights database.

Other cleanup:

  • Removed an unnecessary trailing newline in main.go for 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_value to use only the Insights database.

Removes the CMDatabase field and all CROWD_DB_* environment parsing from config.go, deletes the CMDB type plus NewCMDB/Close from db.go, and drops CM DB connect/cleanup logic from main.go so repository processing only initializes NewInsightsDB.

Written by Cursor Bugbot for commit f1d7968. This will update automatically on new commits. Configure here.

Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
@mbani01 mbani01 requested a review from epipav March 13, 2026 17:58
@mbani01 mbani01 self-assigned this Mar 13, 2026
Copilot AI review requested due to automatic review settings March 13, 2026 17:58
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

1 similar comment
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@mbani01 mbani01 changed the title chore: remove unsed cm db connection from software-value chore: remove unsed cm db connection from software-value [CM-787] Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
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.

3 participants