navapbc / template-application-rails

Ruby on Rails with USWDS template, including CI/CD, for teams building web applications
Apache License 2.0
2 stars 1 forks source link

Prepare for integration with infra template #40

Closed rocketnova closed 4 months ago

rocketnova commented 4 months ago

Ticket

Changes

What was added, updated, or removed in this PR.

Context for reviewers

Background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.

Adding pgcrypto as a database migration breaks integration with a more secure and restricted database migration user, such as with the https://github.com/navapbc/template-infra.

Normally, you should NOT delete database migrations. Instead, you should add a follow up migration that reverts the change. However, in this case, if you try to run the application on a more restrictive database migration user, all database migrations from this point on would fail with an error similar to this:

StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
PG::InsufficientPrivilege: ERROR:  permission denied to create extension "pgcrypto"
HINT:  Must have CREATE privilege on current database to create this extension.

That means a subsequent migration to revert the change would NOT fix the problem.

Release notes

28 was not included in any releases, but the next release should include a note mentioning the issue and instructing them to run make db-reset.

Testing

Provide testing instructions and evidence that the code works as expected. Include screenshots, GIF demos, shell commands or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

Test local development works in the container

  1. make init-container
  2. make start-container
  3. Check localhost:3100

Test local development works natively

  1. make init-native
  2. make start-native
  3. Check localhost:3000

Test remote deployment using integration with infra template: