Skip to content

fix: replace hardcoded postgres creds and deployment URLs#7

Merged
Benji918 merged 3 commits into
mainfrom
fix/ci-cd-hardcoded-values
May 16, 2026
Merged

fix: replace hardcoded postgres creds and deployment URLs#7
Benji918 merged 3 commits into
mainfrom
fix/ci-cd-hardcoded-values

Conversation

@AkwerigbeO
Copy link
Copy Markdown
Collaborator

@AkwerigbeO AkwerigbeO commented May 16, 2026

Description

Type of Change

  • feat — New feature
  • fix — Bug fix
  • refactor — Code refactoring (no functional change)
  • docs — Documentation update
  • test — Adding or updating tests
  • chore — Maintenance (dependencies, CI, tooling)

Related Issue

Closes #

Changes Made

  • Changed Hardcoded postgres values in workflows
    -The CI will fail until the following secrets are added to the repository by an admin:

TEST_POSTGRES_USER
TEST_POSTGRES_PASSWORD
TEST_POSTGRES_DB
-Also add environment variables under staging/production environments:

STAGING_URL = https://api.staging.meetmind.hng14.com
PROD_URL = https://api.meetmind.hng14.com

Proof of Work

API Response / Screenshots
// Paste your endpoint response here
// Example:
// POST /api/v1/meetings
// Status: 201 Created
// {
//   "id": "abc-123",
//   "title": "Sprint Planning",
//   "scheduled_at": "2026-05-10T10:00:00Z",
//   "duration_minutes": 30
// }

Test Cases

  • Test case 1: test_<action>_<expected_outcome>_<condition>
  • Test case 2: test_<action>_<expected_outcome>_<condition>
Test output
# Paste your test run output here
# uv run pytest tests/ -v

Checklist

  • My branch follows the naming convention (<type>/<short-description>)
  • My commits follow Conventional Commits
  • I have added meaningful tests that cover success and failure paths
  • All new and existing tests pass locally (uv run pytest)
  • I have included proof of work (JSON responses or screenshots)
  • I have updated documentation if needed
  • My code follows the project's style guidelines

Summary by CodeRabbit

  • Chores
    • Updated CI/CD workflows to source deployment and database configuration from environment variables and secrets instead of hardcoded values, improving flexibility and security.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 58c8cb2a-a51a-4d62-8019-80fb4f60af37

📥 Commits

Reviewing files that changed from the base of the PR and between 3d82954 and 4d627b4.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

GitHub Actions workflows in the CD and CI pipelines replace hardcoded configuration values with environment-specific GitHub Actions variables and secrets. The CD workflow sources deployment URLs dynamically; the CI workflow retrieves Postgres credentials from secrets to construct the test DATABASE_URL.

Changes

Workflow Configuration Externalization

Layer / File(s) Summary
CD deployment environment URLs
.github/workflows/cd.yml
Staging and production job environment.url fields reference vars.STAGING_URL and vars.PROD_URL instead of fixed https://api.* endpoint strings.
CI database credentials and connection
.github/workflows/ci.yml
Postgres service POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB switch from hardcoded values to ${{ secrets.* }} references with fallbacks; DATABASE_URL is constructed from the same secret-backed values preserving the asyncpg scheme and localhost target.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing critical sections: no actual description text provided, Proof of Work is just a placeholder, and Test Cases/Checklist remain unchecked. Add a detailed description of the changes, provide proof that the CI/CD workflows are correctly configured, and include test output verifying the workflows function properly.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: replacing hardcoded PostgreSQL credentials and deployment URLs with secrets/variables in CI/CD workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-cd-hardcoded-values

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 22-24: The workflow uses secrets for POSTGRES_USER,
POSTGRES_PASSWORD, POSTGRES_DB (and the derived DATABASE_URL) which are empty
for forked pull_request runs; change those environment expressions to provide
safe defaults using GitHub Actions coalescing, e.g. replace uses of ${{
secrets.TEST_POSTGRES_USER }} / ${{ secrets.TEST_POSTGRES_PASSWORD }} / ${{
secrets.TEST_POSTGRES_DB }} with expressions like ${{ secrets.TEST_POSTGRES_USER
!= '' && secrets.TEST_POSTGRES_USER || 'postgres' }} (and similar for
password/db) and rebuild DATABASE_URL from those fallback-backed values so CI
starts correctly on forked PRs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 687a668a-f374-4d87-a636-73ab1783c94c

📥 Commits

Reviewing files that changed from the base of the PR and between 349024e and 3d82954.

📒 Files selected for processing (2)
  • .github/workflows/cd.yml
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml Outdated
@Benji918 Benji918 merged commit d893fad into main May 16, 2026
7 checks passed
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