Skip to content

docs(nebraska): add docker exec option for postgres setup - #701

Open
chengr4 wants to merge 1 commit into
flatcar:mainfrom
chengr4:dev
Open

docs(nebraska): add docker exec option for postgres setup#701
chengr4 wants to merge 1 commit into
flatcar:mainfrom
chengr4:dev

Conversation

@chengr4

@chengr4 chengr4 commented Sep 9, 2026

Copy link
Copy Markdown

Docs(nebraska): add docker exec option for postgres setup

Previously, the Nebraska development setup guide only provided commands assuming the psql client was installed directly on the host machine.

This PR add another database setup method for no psql user.

Testing done

I ran new command on my Mac book and it worked.

  • Changelog entries added in the respective changelog/ directory: N/A
  • Inspected CI output for image differences: N/A

Copilot AI lite review requested due to automatic review settings September 9, 2026 02:10
@chengr4
chengr4 requested a review from a team as a code owner September 9, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The updated doc section has formatting that will likely render awkwardly and Option A’s timezone command is non-persistent/inconsistent with the stated requirement to set the DB timezone to UTC.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Nebraska development documentation to provide an additional way to initialize the local PostgreSQL databases when the psql client is not installed on the host machine.

Changes:

  • Converts the Postgres container startup command into a standalone command block.
  • Adds “Option A” (local psql) and “Option B” (docker exec) instructions for creating databases and setting timezone.
File summaries
File Description
content/docs/latest/updates-releases/nebraska/development.md Adds a docker exec-based Postgres setup path alongside the existing local psql instructions.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 02:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is documentation-only and the new docker exec workflow is coherent and consistent with the stated goal of supporting users without local psql.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

- Create the database for Nebraska (by default it is `nebraska`):
- `psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska;'`
```bash
docker run --rm -d --name nebraska-postgres-dev -p 5432:5432 -e POSTGRES_PASSWORD=nebraska postgres
Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 02:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The documentation change is cohesive and correct, with only a small suggested improvement to avoid an unbounded readiness-wait loop.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 03:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new readiness snippet uses exit 1, which can unexpectedly terminate an interactive shell session when copy/pasted from the docs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 03:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are documentation-only, internally consistent, and add a working alternative workflow without impacting application code.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Comment thread content/docs/latest/updates-releases/nebraska/development.md
Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Comment thread content/docs/latest/updates-releases/nebraska/development.md Outdated
Comment on lines +41 to +69
- Initialize the databases (`nebraska` and `nebraska_tests`) using either of the following methods:

```bash
psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;'
psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c 'set timezone = "utc";'
```
- **Option A: Using local `psql`** (if you have `psql` installed on your host machine):

```bash
# Create the database for Nebraska (by default it is `nebraska`)
psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska;'

# Set the timezone to Nebraska's database
psql postgres://postgres:nebraska@localhost:5432/nebraska -c "alter database nebraska set timezone to 'utc';"

# Set up the nebraska_tests database for running unit tests
psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;'
psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c "alter database nebraska_tests set timezone to 'utc';"
```

- **Option B: Using `docker exec`** (run directly inside the container without requiring local PostgreSQL tools):

```bash
# Create the database for Nebraska (by default it is `nebraska`)
docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska;"

# Set the timezone to Nebraska's database
docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska set timezone to 'utc';"

# Set up the nebraska_tests database for running unit tests
docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska_tests;"
docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska_tests set timezone to 'utc';"
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The docker run command in the previous suggestion now sets POSTGRES_DB and TZ, so the nebraska database and the UTC timezone are already handled when the container starts. Only the test database is left to create here.

That also means we do not need the two options. We can simplify the doc. The docker run bullet already needs Docker, so docker exec works for every reader, while local psql only works for people who have it installed.

Let me know if you see a reason to keep them.

Suggested change
- Initialize the databases (`nebraska` and `nebraska_tests`) using either of the following methods:
```bash
psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;'
psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c 'set timezone = "utc";'
```
- **Option A: Using local `psql`** (if you have `psql` installed on your host machine):
```bash
# Create the database for Nebraska (by default it is `nebraska`)
psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska;'
# Set the timezone to Nebraska's database
psql postgres://postgres:nebraska@localhost:5432/nebraska -c "alter database nebraska set timezone to 'utc';"
# Set up the nebraska_tests database for running unit tests
psql postgres://postgres:nebraska@localhost:5432/postgres -c 'create database nebraska_tests;'
psql postgres://postgres:nebraska@localhost:5432/nebraska_tests -c "alter database nebraska_tests set timezone to 'utc';"
```
- **Option B: Using `docker exec`** (run directly inside the container without requiring local PostgreSQL tools):
```bash
# Create the database for Nebraska (by default it is `nebraska`)
docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska;"
# Set the timezone to Nebraska's database
docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska set timezone to 'utc';"
# Set up the nebraska_tests database for running unit tests
docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska_tests;"
docker exec nebraska-postgres-dev psql -U postgres -c "alter database nebraska_tests set timezone to 'utc';"
```
- Create the second database, used by the unit tests:
```bash
docker exec nebraska-postgres-dev psql -U postgres -c "create database nebraska_tests;"
```

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The only reason I kept psql and added the docker exec option was that psql was already in the doc first, and I was afraid I might have missed something.
If you think docker exec is enough and better, we should remove psql.

Signed-off-by: R4 Cheng <karaburi2023@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The updated instructions claim the database timezone is set to UTC, but the current commands do not reliably configure PostgreSQL’s timezone setting.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread content/docs/latest/updates-releases/nebraska/development.md
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