Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: add support for individual PostgreSQL connection parameters #16906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

kylecarbs
Copy link
Member

Summary

  • Fixed a type mismatch bug that prevented individual PostgreSQL connection parameters from being shown in CLI help output
  • Fixed improper boolean check that was using serpent.Bool type directly without calling .Value() method
  • Updated golden files to include the new CLI flags

This allows users to specify PostgreSQL connection details using individual environment variables (CODER_PG_HOST, CODER_PG_PORT, etc.), which is useful for systems with automatic password rotation.

Fixes #15264

Test plan

  • Confirmed CLI flags appear in the help output
  • Verified that golden files have been updated
  • Ran the related tests to ensure proper functioning
  • Manually tested that the individual parameters work by running the Coder server with them

🤖 Generated with Claude Code

Fix bug that prevented individual PostgreSQL connection parameters from being
shown in CLI help output and being used properly. The parameters were already
defined in the DeploymentValues struct but weren't accessible due to a type
mismatch when checking InMemoryDatabase value.

This allows users to specify PostgreSQL connection details using individual
environment variables, which is useful for systems with automatic password
rotation.

Closes #15264

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy link


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 can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Claude seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Claude added 5 commits March 13, 2025 15:20
Added tests to verify the PostgreSQL URL construction from individual components
and the CLI flags/environment variables handling:

1. Added unit test in cli/clitest package to test URL construction
2. Added integration test in cli/server_test.go to test CLI flags
3. Added integration test for environment variables

Refs #15264
@github-actions github-actions bot added the stale This issue is like stale bread. label Mar 21, 2025
@github-actions github-actions bot closed this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Postgresql database settings not only via connection string
1 participant