You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue aims to refactor and reorganize the grafana-docs-monitoring repository to improve its maintainability and scalability. By implementing a more modular and configurable structure, we can simplify development and operational processes.
Tasks:
#### 1. Create Configuration Module - Establish a config directory to house all environment-specific settings rather hardcoding them in scripts. - Implement config/settings.py to manage settings from environment variables. - Optionaly introduce .env files for different deployment environments to easily switch and manage configurations.
#### 2. Database Module Setup - Set up a database module under the modules directory. - Create for example connect_to_db() function in database.py to manage database connections using configurations from config/settings.py.
3. GitHub and Gitea API Module
Introduce a github_api.py and gitea_api.py file in the modules directory for GitHub and Gitea API interactions respectively.
Ensure all API interactions are wrapped in try-except blocks to log and manage exceptions effectively. This includes handling API rate limits, connection errors, and data processing errors.
Centralize common functionality such as error handling, logging, and retry logic in a utility module or class to be used by both API modules.
#### 4. Scripts for Routine Tasks - Organize operational scripts in the scripts directory. - Utilize functions from modules for tasks like updating database data or checking GitHub/Gitea issues.
5. Refactor Environment Handling in request_changes.py
Create a dictionary with environment names and their corresponding configurations.
Replace direct function calls with a for loop iterating over the dictionary.
Add logging to indicate the start and end of processing for each environment.
Rename main functions for better clarity.
6. Main Execution Script
Develop main.py at the project root as the entry point for running scripts.
Keep main.py simple, facilitating easy command-line or scheduled execution of tasks.
Expected Outcome:
Achieving these tasks will enhance the project's architecture for better maintainability and scalability, simplifying both development and operational processes.
This issue aims to refactor and reorganize the
grafana-docs-monitoring
repository to improve its maintainability and scalability. By implementing a more modular and configurable structure, we can simplify development and operational processes.Tasks:
#### 1. Create Configuration Module- Establish aconfig
directory to house all environment-specific settings rather hardcoding them in scripts.- Implementconfig/settings.py
to manage settings from environment variables.- Optionaly introduce .env files for different deployment environments to easily switch and manage configurations.#### 2. Database Module Setup- Set up adatabase
module under themodules
directory.- Create for exampleconnect_to_db()
function indatabase.py
to manage database connections using configurations fromconfig/settings.py
.3. GitHub and Gitea API Module
github_api.py
andgitea_api.py
file in themodules
directory for GitHub and Gitea API interactions respectively.#### 4. Scripts for Routine Tasks- Organize operational scripts in thescripts
directory.- Utilize functions frommodules
for tasks like updating database data or checking GitHub/Gitea issues.5. Refactor Environment Handling in
request_changes.py
6. Main Execution Script
main.py
at the project root as the entry point for running scripts.main.py
simple, facilitating easy command-line or scheduled execution of tasks.Expected Outcome:
Achieving these tasks will enhance the project's architecture for better maintainability and scalability, simplifying both development and operational processes.
Project Structure Proposal:
The text was updated successfully, but these errors were encountered: