Skip to content

feat: extract environment variable handling #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2025
Merged

feat: extract environment variable handling #293

merged 2 commits into from
Mar 30, 2025

Conversation

jmeridth
Copy link
Member

  • central env.py for gathering and setting env vars
  • bool and int env var handling and tests broken out

Pull Request

Proposed Changes

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance or breaking

- [x] central env.py for gathering and setting env vars
- [x] bool and int env var handling and tests broken out

Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth jmeridth self-assigned this Mar 30, 2025
@Copilot Copilot AI review requested due to automatic review settings March 30, 2025 22:48
@jmeridth jmeridth requested a review from a team as a code owner March 30, 2025 22:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extracts environment variable handling into a centralized module (env.py) and refactors the code and tests accordingly to support boolean and integer environment variable parsing.

  • Moved environment variable handling from multiple files into env.py
  • Added dedicated tests for get_int_env_var and get_bool_env_var
  • Updated stale_repos.py to use the new env.py module for configuration

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test_stale_repos.py Removed tests for get_int_env_var to avoid redundancy with new tests
test_env_get_int.py Added tests for integer environment variable parsing
test_env_get_bool.py Added tests for boolean environment variable parsing
test_env.py Added tests for overall environment variable gathering logic
stale_repos.py Refactored to use get_env_vars instead of inline dotenv loading
env.py New module to encapsulate environment variable handling and parsing

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

thanks copilot

Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth jmeridth merged commit d03d35a into main Mar 30, 2025
30 checks passed
@jmeridth jmeridth deleted the jm_env_vars branch March 30, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant