SciCatProject / SciCatProject/backend
Migrations: script uses dotenv which does not pick up environment variables
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 37
- Avg merge
- 17h 32m
- Merged PRs (30d)
- 38
Description
The migrations script uses the dotenv package to pickup the MONGODB_URI. It turns out that this package cannot handle the case where there is no .env file. The equivilent python package will go to actual environment variables and if one is over-ridden by a value in a .env, that will be used.
This comes up because I'm trying to do a migration right within my container, which defines MONGODB_URI as an environment variable and has no .env file. It would be nice to update this script to look at system environment for this variable too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with migrate-mongo-config.js at the linked dotenv usage and check how MONGODB_URI is loaded when no .env file exists. Verify the migration script in a container with MONGODB_URI set only as an environment variable; done means that value is used while a .env value can still override it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100