Skip to content

Issue: Improve Configuration Handling in Roboflow API Script #13

@therealharshit

Description

@therealharshit

Description

The current configuration handling in the script relies on multiple sources (environment variables, a JSON config file, and default values). However, there are potential issues that could lead to unexpected behavior:

  1. Missing Config File Handling: If the config file does not exist, the script attempts to load it, which may cause errors.
  2. Error Handling for JSON Parsing: If the config file is malformed, the script does not handle the JSON parsing errors gracefully.
  3. Redundant Environment Variable Checks: The script checks for environment variables multiple times in different locations, which could be streamlined.
  4. Logging Instead of Silent Failures: Errors or missing configurations should be logged for better debugging.

Steps to Reproduce

  1. Remove the config.json file or set ROBOFLOW_CONFIG_DIR to a non-existent path.
  2. Run the script and observe any failures.
  3. Modify config.json to contain invalid JSON.
  4. Run the script again and observe the error handling.

Expected Behavior

  • The script should handle missing or malformed config files gracefully.
  • It should provide clear logs when a configuration value cannot be retrieved.
  • Environment variable lookups should be optimized.

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