Skip to content

Adopt .env-file-as-canonical-per-env-config pattern in other Makefiles #441

Description

@turbomam

PR #438 established a pattern for nmdc-submissions-to-mongo: the per-environment .env file holds all per-env config (MONGO_URI, BASE_URL, OUTPUT_FILE, plus the refresh token), and the Makefile target chooses which file to load. Variable names are consistent across prod and dev; user overrides on the command line work uniformly; recipes never echo credentialed values.

Several other Makefiles in the repo carry the same kind of per-env divergence at smaller scale and would benefit from the same pattern:

  • Makefiles/ncbi_to_duckdb.MakefileMONGO_HOST/MONGO_PORT/MONGO_DB triple, would benefit from a unified env-file approach
  • Makefiles/test_workflow.MakefileSOURCE_* / TARGET_* variables (intentional source-vs-target pattern, not prod-vs-dev, so possibly out of scope but worth a look)
  • Makefiles/env_triads.Makefile and others where MONGO_URI is the only knob

Proposed direction

Pick one Makefile at a time, migrate to:

  1. A single *_ENV variable per Makefile, defaulting to local/.env.<pipeline>
  2. Per-env config (URI, paths, base URLs) inside the env file
  3. Single recipe shape per logical operation; target-specific defaults for dev/test variants

This is mostly a documentation/refactoring task once the canonical pattern is settled. See sibling issues for the broader connection-config story.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions