Skip to content

feat: updates conf to allow setting db name#112

Merged
semmet95 merged 1 commit into
mainfrom
feat/db-name-conf
May 17, 2026
Merged

feat: updates conf to allow setting db name#112
semmet95 merged 1 commit into
mainfrom
feat/db-name-conf

Conversation

@semmet95
Copy link
Copy Markdown
Contributor

@semmet95 semmet95 commented May 17, 2026

Summary by CodeRabbit

  • Chores

    • Configuration system updated to support DB_NAME (defaults to sourcescore) and PORT (defaults to 8080) environment variables.
  • Tests

    • Added test coverage for database name configuration.

Review Change Stack

Signed-off-by: Amit Singh <singhamitch@outlook.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e6f46e37-f795-4b86-bde7-73157ff1a025

📥 Commits

Reviewing files that changed from the base of the PR and between 1f2ac0f and 74f4ea3.

📒 Files selected for processing (3)
  • cmd/app/main.go
  • pkg/conf/conf.go
  • pkg/conf/conf_test.go

📝 Walkthrough

Walkthrough

Database name configuration is refactored from a compile-time constant to an environment-driven field. The DbName field now reads from the DB_NAME environment variable with a "sourcescore" default, tests verify this behavior, and the DSN construction reference is updated accordingly.

Changes

Database name environment configuration

Layer / File(s) Summary
Configuration structure and environment defaults
pkg/conf/conf.go
The DbName constant is removed and the conf struct field now sources from DB_NAME environment variable with default "sourcescore". The Port field receives an explicit env-default of "8080".
Configuration behavior tests
pkg/conf/conf_test.go
Test constant SampleDbName is added and Ginkgo When cases verify that Cfg.DbName defaults to "sourcescore" and respects the DB_NAME environment variable override.
DSN construction reference update
cmd/app/main.go
The PostgreSQL DSN construction updates the dbname format argument from conf.DbName to conf.Cfg.DbName.

🎯 2 (Simple) | ⏱️ ~8 minutes

In fields of config, a rabbit hops with glee,
No constants needed—env sets us free!
DbName now flows from the source outside,
With defaults and tests as our steadfast guide. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making the database name configurable via environment variables instead of a hardcoded constant.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/db-name-conf

Comment @coderabbitai help to get the list of available commands and usage tips.

@semmet95 semmet95 marked this pull request as ready for review May 17, 2026 12:38
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@semmet95 semmet95 merged commit 32946fa into main May 17, 2026
6 checks passed
@semmet95 semmet95 deleted the feat/db-name-conf branch May 17, 2026 12:43
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