Skip to content

Conversation

@jenshenny
Copy link
Member

Follow up to: #6091

This enables us to create a db readonly user for blazer via the postgresql client.

Testing

Added the app to the docker-compose file and built it

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - RAILS_ENV=production
      - SECRET_KEY_BASE=secret_key_base
      - DATABASE_URL=postgresql://postgres@db:5432/rubygems_production

was able to psql and run the commands to create the db user.

Example

BEGIN;
CREATE ROLE blazer LOGIN PASSWORD 'secret';
GRANT CONNECT ON DATABASE rubygems_production TO blazer;
GRANT USAGE ON SCHEMA public TO blazer;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO blazer;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO blazer;
rubygems_production=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of 
-----------+------------------------------------------------------------+-----------
 blazer    |                                                            | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.24%. Comparing base (27992d5) to head (3f8b472).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6097   +/-   ##
=======================================
  Coverage   97.24%   97.24%           
=======================================
  Files         476      476           
  Lines        9785     9785           
=======================================
  Hits         9515     9515           
  Misses        270      270           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants