[PR #503] [MERGED] feat: Enhance scan-missing-env-vars.py to detect defaults, types, and categorize output #561

Closed
opened 2026-02-15 17:17:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/docs/pull/503
Author: @silentoplayz
Created: 4/15/2025
Status: Merged
Merged: 4/18/2025
Merged by: @tjbck

Base: mainHead: main


📝 Commits (5)

  • 7645989 Update env-configuration.md
  • 2ca78ce Update scan-missing-env-vars.py
  • 3598ee5 Update env-configuration.md
  • 668e48b Update env-configuration.md
  • 6f0f7fd Update env-configuration.md

📊 Changes

2 files changed (+209 additions, -41 deletions)

View changed files

📝 docs/getting-started/env-configuration.md (+19 -21)
📝 scripts/scan-missing-env-vars.py (+190 -20)

📄 Description

Pull Request Checklist

Changelog Entry

Description

  • Improved the scan-missing-env-vars.py script to provide more detailed information about environment variable usage in the codebase. The script now detects default values, infers variable types, and categorizes undocumented variables for better analysis of environment variable configurations.

Added

  • Detection of default values for environment variables accessed via os.getenv, os.environ.get, and PersistentConfig.
  • Inference of variable types (str, int, bool, list[dict], dict, tuple, set) for environment variables, especially within PersistentConfig.
  • Categorized output for undocumented environment variables, separating PersistentConfig variables from other undocumented variables.
  • Output includes default values and inferred types for undocumented variables.
  • Filenames are now tracked to show where each environment variable is accessed.

Changed

  • The find_env_vars function now returns a dictionary containing detailed context for each environment variable (files, default, type) instead of just a set of variable names.
  • The output format is enhanced to display default values, types, and file locations for undocumented variables.

Fixed

  • Improved accuracy and detail in environment variable scanning compared to the original script, providing a more comprehensive analysis.

Additional Information

  • This script is used internally to help maintain documentation and ensure all necessary environment variables are documented. The enhanced script provides more granular information, making it easier to identify and document environment variables, especially those used with PersistentConfig and those with default values and specific types.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/docs/pull/503 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 4/15/2025 **Status:** ✅ Merged **Merged:** 4/18/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (5) - [`7645989`](https://github.com/open-webui/docs/commit/76459896154af597abb6eb4bc825a2e759aab67f) Update env-configuration.md - [`2ca78ce`](https://github.com/open-webui/docs/commit/2ca78ce2c94a0fb5ac74b1adcd6c1c4b569870aa) Update scan-missing-env-vars.py - [`3598ee5`](https://github.com/open-webui/docs/commit/3598ee54a5048cfe0fdb1580276c4e009c408a65) Update env-configuration.md - [`668e48b`](https://github.com/open-webui/docs/commit/668e48ba08d8903203cd7875ba29a76f71b999ee) Update env-configuration.md - [`6f0f7fd`](https://github.com/open-webui/docs/commit/6f0f7fd660e4e1f73a2ff5cb85b68dbe4fa86f3e) Update env-configuration.md ### 📊 Changes **2 files changed** (+209 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `docs/getting-started/env-configuration.md` (+19 -21) 📝 `scripts/scan-missing-env-vars.py` (+190 -20) </details> ### 📄 Description # Pull Request Checklist # Changelog Entry ### Description - Improved the `scan-missing-env-vars.py` script to provide more detailed information about environment variable usage in the codebase. The script now detects default values, infers variable types, and categorizes undocumented variables for better analysis of environment variable configurations. ### Added - Detection of default values for environment variables accessed via `os.getenv`, `os.environ.get`, and `PersistentConfig`. - Inference of variable types (str, int, bool, list[dict], dict, tuple, set) for environment variables, especially within `PersistentConfig`. - Categorized output for undocumented environment variables, separating `PersistentConfig` variables from other undocumented variables. - Output includes default values and inferred types for undocumented variables. - Filenames are now tracked to show where each environment variable is accessed. ### Changed - The `find_env_vars` function now returns a dictionary containing detailed context for each environment variable (files, default, type) instead of just a set of variable names. - The output format is enhanced to display default values, types, and file locations for undocumented variables. ### Fixed - Improved accuracy and detail in environment variable scanning compared to the original script, providing a more comprehensive analysis. --- ### Additional Information - This script is used internally to help maintain documentation and ensure all necessary environment variables are documented. The enhanced script provides more granular information, making it easier to identify and document environment variables, especially those used with `PersistentConfig` and those with default values and specific types. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:17:40 -05:00
yindo closed this issue 2026-02-15 17:17:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/docs#561