jhanley634 / dojo-blackboard

An HTMX webserver for the Dojo's Tuesday night python meetups.
MIT License
3 stars 1 forks source link

11 missing secrets #12

Closed jhanley634 closed 2 months ago

jhanley634 commented 2 months ago

Summary by Sourcery

Enhance API key management by introducing checks for key enablement and refactoring related functions. Update documentation with new guides on secrets management and contribution processes. Improve test coverage to include new utility functions and key enablement checks. Simplify the Makefile by removing redundant commands.

New Features:

Enhancements:

Documentation:

Tests:

Chores:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request introduces several changes to improve code organization, error handling, and secret management. The main focus is on enhancing the credentials handling system, adding new utility functions, and updating tests to accommodate these changes.

File-Level Changes

Change Details Files
Improved credentials handling and API key management
  • Added an is_enabled function to check if an API key is enabled
  • Implemented a file_exists function to safely check file existence
  • Modified get_api_key to assert that the key is enabled before retrieval
  • Updated read_api_keys to handle missing secret files gracefully
src/bboard/util/credentials.py
tests/credentials_test.py
src/bboard/transit/vehicles.py
Enhanced error handling and utility functions
  • Implemented a throw function to turn raise into an expression
  • Removed unused mypy ignore comments
  • Updated temp_dir function to use assert with throw
src/bboard/util/credentials.py
src/bboard/util/fs.py
Updated tests to accommodate new credential handling
  • Modified test_creds to check if the API key is enabled before testing
  • Added a new test for the file_exists function
  • Updated test_query_vehicles to check if the key is enabled before querying
tests/credentials_test.py
tests/vehicles_test.py
Added documentation for secrets management and development process
  • Created a new file docs/secrets.md with instructions for handling API keys and secrets
  • Added docs/process.md to outline the development process and pull request workflow
docs/secrets.md
docs/process.md
Minor updates to project configuration and documentation
  • Added Coveralls badge to README.md
  • Updated Makefile to remove unnecessary pip upgrade step
  • Added KEY_NAME constant in vehicles.py
ReadMe.md
Makefile
src/bboard/transit/vehicles.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.