Skip to content

ci: remove redundant AWS and PG env vars from workflow#2112

Merged
duckduckgrayduck merged 1 commit intoMuckRock:masterfrom
labradorite-dev:fix-aws-env-vars
Jan 12, 2026
Merged

ci: remove redundant AWS and PG env vars from workflow#2112
duckduckgrayduck merged 1 commit intoMuckRock:masterfrom
labradorite-dev:fix-aws-env-vars

Conversation

@labradorite-dev
Copy link
Copy Markdown
Contributor

@labradorite-dev labradorite-dev commented Jan 6, 2026

Removes AWS credentials and PG user/password environment variables from the CI workflow that are redundant or unused.

Changes

  • Removed AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from workflow env vars
  • Removed PG_USER and PG_PASSWORD from pytest step env vars

Rationale

AWS credentials

The test settings already override these with placeholder values at muckrock/settings/test.py:55-56:

# don't use real AWS credentials for tests
AWS_ACCESS_KEY_ID = "placeholder"
AWS_SECRET_ACCESS_KEY = "placeholder"

PG credentials

PG_USER and PG_PASSWORD are not used because the database configuration extracts credentials from DATABASE_URL instead. The workflow uses DJANGO_SETTINGS_MODULE=muckrock.settings.test, which inherits from base.py where DATABASE_URL is parsed at muckrock/settings/base.py:589-604:

url = urllib.parse.urlparse(
    os.environ.get("DATABASE_URL", "postgres://vagrant@localhost/muckrock")
)

DATABASES = {
    "default": {
        "NAME": url.path[1:],
        "USER": url.username,      # ← from DATABASE_URL, not PG_USER
        "PASSWORD": url.password,  # ← from DATABASE_URL, not PG_PASSWORD
        "HOST": url.hostname,
        "PORT": url.port,
        ...
    }
}

Since DATABASE_URL is hardcoded at .github/workflows/test.yml:125 with the correct postgres service credentials (postgresql://test:postgres@localhost:5432/muckrock), the separate PG_USER and PG_PASSWORD env vars are redundant.

Note: PG_USER/PG_PASSWORD are only used by the codeship.py settings file, which is not used by this workflow.

Impact

This partially addresses issue #2111 by reducing the number of repository secrets required for CI to pass. External contributors forking the repository won't need to set these specific secrets to run tests.

AWS credentials are already set to placeholder values in test.py settings,
so they do not need to be passed from workflow secrets. PG_USER and PG_PASSWORD
are also unused since DATABASE_URL is hardcoded with the correct values.

This fixes issue MuckRock#2111 by reducing the number of required secrets for external
contributors who want to run CI checks on their forks.
@labradorite-dev
Copy link
Copy Markdown
Contributor Author

@duckduckgrayduck, this should slightly improve the issue noted in #2111 right?

@duckduckgrayduck duckduckgrayduck merged commit 08d2f0a into MuckRock:master Jan 12, 2026
1 of 3 checks passed
@labradorite-dev labradorite-dev deleted the fix-aws-env-vars branch January 31, 2026 23:33
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.

2 participants