Skip to content

Conversation

@powersurge360
Copy link
Contributor

Link to pivotal/JIRA issue

Is PM acceptance required? (delete one)

  • No - merge after code review approval

Reminder: merge main into this branch and get green tests before merging to main

What was done?

  • Changes the default port in .env to reflect an incremented port
  • Removes the specific version in the Brewfile for postgres

How to test?

  • Edit .env to include a new RAILS_DB_PORT (find a suggested port in dotenv)
  • Run bin/setup
  • Observe database connection still works in rails
  • Run docker compose ps
  • Observe that the port is being forwarded to the local port of your choosing.

@github-actions
Copy link

Heroku app: https://gyr-review-app-6085-36b3ce6c2d01.herokuapp.com/
View logs: heroku logs --app gyr-review-app-6085 (optionally add --tail)

cask "temurin@21"
brew "poppler"
brew "postgresql@14"
brew "postgresql"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may be that we want to remove this line. We require binaries though. We can get them from libpq instead but it requires a modification of PATH which we don't have a standard tool to do. I recommend mise if we proceed down that path.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is as reasonable as anything else if there isn't a brew formula for the exact binaries we need.

Comment on lines +51 to 52
system! "docker compose pull db"
system! "docker compose up --wait -d db"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer stopping Postgres because other projects might be using it. Should be sufficient to just start on another port. This up call should stop and restart if env vars change and assign the new ports. pull to check for updates to the specified image before uping.

Comment on lines -19 to -20
username: <%= ENV.fetch("RAILS_DB_USERNAME", 'postgres') %>
password: <%= ENV.fetch("RAILS_DB_PASSWORD", 'password') %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't need this after using .env. Shouldn't have made it in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what "shouldn't have made it in" means here & just want to double check to make sure I'm not missing something - these lines were added by Melanie when she added the docker compose file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added these lines in my last merge. They're unnecessary because they only matter in development and we're already using .env in development so we should be dealing with it there.

Copy link
Contributor

Choose a reason for hiding this comment

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

my bad - i was looking at the very similar lines 7-8 up in local_default

Copy link
Contributor

Choose a reason for hiding this comment

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

does the same rationale for removing these lines apply now to those ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'm inclined to leave them alone. Ports rarely change and username / password additionally are allowable to be entirely nil. This differs from setting them to '' because it switches postgres into trust authentication, if enabled.

user: postgres
ports:
- 127.0.0.1:5432:5432
- 127.0.0.1:${RAILS_DB_PORT:-5432}:5432
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The unusual notation of ${SOME_ENV_VAR:-value} allows you to set value as a default value when SOME_ENV_VAR is not set or otherwise empty.

@mrotondo
Copy link
Contributor

@powersurge360 Was there a change to the dotenv file that was supposed to go in this PR? The description says "find a suggested port in dotenv" but I don't see one there.

@powersurge360
Copy link
Contributor Author

You are correct! Thanks.

@mrotondo
Copy link
Contributor

Ok, with a change to my .env and an invocation of bin/setup in vita-min I now have a docker postgres container exposing 5433:5432, and with a brew services start postgresql i now have a pya that can access its database! one non-blocking question above, but looks good however/whether you choose to do anything about that.

@powersurge360 powersurge360 merged commit 5b80ce7 into main Oct 16, 2025
8 checks passed
@powersurge360 powersurge360 deleted the TBE-299/scope-postgres-to-vita-min branch October 16, 2025 19:23
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