CarmineOptions / derisk-research

MIT License
6 stars 26 forks source link

Handle missing environment variables PG_CONNECTION_STRING and CREDENTIALS_PATH #200

Open djeck1432 opened 6 days ago

djeck1432 commented 6 days ago

Task Description

Handle missing env variables while set up the project and up and running to pretend most common issue with set up the project.

Steps

  1. Review our Contributor Guidelines and README

  2. Set up the project and create a new branch: • Fork this repository. • Create a new branch for your work.

  3. Install the project installation guide

  4. Handle missing PG_CONNECTION_STRING and CREDENTIALS_PATH. If you not export these variables, the charts can't be rendered. So we would like to handle this case.

Hints:

You can find settings there env variables here:

  1. PG_CONNECTION_STRING
  2. CREDENTIALS_PATH
AndriiBogomolov commented 6 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I'm developer with experience in Starknet, I was working closely with blockchain and web3 technologies

  1. Understand Where the Variables are Used: Based on the provided hints, I would start by reviewing the relevant files where the environment variables PG_CONNECTION_STRING and CREDENTIALS_PATH are used. Specifically: • PG_CONNECTION_STRING is used in src/db.py at line 8. • CREDENTIALS_PATH is used in src/helpers.py at line 155.
  2. Add Error Handling for Missing Variables: • In both db.py and helpers.py, I would add a check to ensure the environment variables are set before proceeding with the code. This can be done using Python’s os.getenv() function, which allows for handling a missing environment variable gracefully. • If the required environment variable is not found, I would raise a clear, descriptive error or log a message to inform the user about the missing configuration.
  3. Provide Fallbacks (Optional): • If appropriate, I could provide default values or fallbacks for the missing environment variables. This depends on whether the project can still function without these values in certain cases.
  4. Update Documentation: • Ensure that the error message or logging clearly guides users to set the required environment variables. I would also update the documentation (if not already clear) to mention the necessity of setting PG_CONNECTION_STRING and CREDENTIALS_PATH when setting up the project.
Gift-Naomi commented 6 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

@djeck1432 can I work on this? I am a web3/frontend developer I have a lot of open source contributions

Kaminar-i commented 6 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

hello i would love to work on this issue

How I plan on tackling this issue

Review Contributor Guidelines and README. Fork the repository and create a new branch for your work. Follow the project installation guide to set up the environment. Implement error handling for missing PG_CONNECTION_STRING and CREDENTIALS_PATH. Ensure the charts can still render gracefully if these variables are not exported.

jaykayudo commented 6 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a python developer with good web3 experience. i believe i am fit to perform this task based on my experience as a software engineer with 5 years of experience which you can confirm by viewing my profile

How I plan on tackling this issue