fix: support postgressql access via docker exec when psql client not installed#11512
Conversation
9dc113d to
9f685f3
Compare
There was a problem hiding this comment.
Pull request overview
Updates the Radius debug/development tooling to work when the local psql client is missing by falling back to docker exec against a running radius-postgres container, and refactors DB init/cleanup logic to be more centralized.
Changes:
- Add
docker execfallback paths for PostgreSQL command execution instart-radius.shandstop-radius.sh. - Refactor
start-radius.shDB initialization into a reusableinit_db_tableshelper. - Relax
debug-check-prereqsto accept Dockerized PostgreSQL whenpsqlis not installed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| build/scripts/stop-radius.sh | Adds docker exec fallback for DB cleanup when psql is unavailable. |
| build/scripts/start-radius.sh | Adds docker exec fallback for DB init/connectivity detection; consolidates table creation. |
| build/debug.mk | Updates prereq checks to allow Dockerized PostgreSQL when psql is absent. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11512 +/- ##
=======================================
Coverage 51.38% 51.38%
=======================================
Files 699 699
Lines 44111 44111
=======================================
Hits 22667 22667
Misses 19277 19277
Partials 2167 2167 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cf3c4fa to
99bb507
Compare
sylvainsf
left a comment
There was a problem hiding this comment.
thanks for making it more modular!
…lled Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
99bb507 to
dfe0471
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
…installed (#11512) # Description This pull request updates development tooling for PostgreSQL by enhancing the logic for detecting and interacting with PostgreSQL, whether running locally or in Docker. It also refactors and consolidates database initialization and cleanup routines. The changes ensure that both the `start-radius.sh` and `stop-radius.sh` scripts, as well as the Makefile prerequisites check, can handle setups where either the `psql` client or a Dockerized PostgreSQL instance is present. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Contributor checklist Please verify that the PR meets the following requirements, where applicable: - An overview of proposed schema changes is included in a linked GitHub issue. - [ ] Yes <!-- TaskRadio schema --> - [x] Not applicable <!-- TaskRadio schema --> - A design document PR is created in the [design-notes repository](https://github.com/radius-project/design-notes/), if new APIs are being introduced. - [ ] Yes <!-- TaskRadio design-pr --> - [x] Not applicable <!-- TaskRadio design-pr --> - The design document has been reviewed and approved by Radius maintainers/approvers. - [ ] Yes <!-- TaskRadio design-review --> - [x] Not applicable <!-- TaskRadio design-review --> - A PR for the [samples repository](https://github.com/radius-project/samples) is created, if existing samples are affected by the changes in this PR. - [ ] Yes <!-- TaskRadio samples-pr --> - [x] Not applicable <!-- TaskRadio samples-pr --> - A PR for the [documentation repository](https://github.com/radius-project/docs) is created, if the changes in this PR affect the documentation or any user facing updates are made. - [ ] Yes <!-- TaskRadio docs-pr --> - [x] Not applicable <!-- TaskRadio docs-pr --> - A PR for the [recipes repository](https://github.com/radius-project/recipes) is created, if existing recipes are affected by the changes in this PR. - [ ] Yes <!-- TaskRadio recipes-pr --> - [x] Not applicable <!-- TaskRadio recipes-pr --> --------- Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Description
This pull request updates development tooling for PostgreSQL by enhancing the logic for detecting and interacting with PostgreSQL, whether running locally or in Docker. It also refactors and consolidates database initialization and cleanup routines. The changes ensure that both the
start-radius.shandstop-radius.shscripts, as well as the Makefile prerequisites check, can handle setups where either thepsqlclient or a Dockerized PostgreSQL instance is present.Type of change
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: