This project is designed to monitor the development progress of a repository by initializing the main repository and its family in a database, and continuously running a specified script at defined intervals. The project consists of several scripts that work together to achieve this goal.
Clone the Repository:
git clone https://github.com/bactensor/github-family-observer.git
cd github-family-observer
Install Dependencies:
pip install -r requirements.txt
Set Up the .env file:
GIT_ACCESS_TOKEN = "your git access token here"
Prepare the config file: The script uses config.yaml file to get the configuration. Each run will store the current state of the repository in a SQLite database. Path to the database is specified in the config file. You can prepare your own config file based on the example in the repository. Here is the structure of the config file:
# config.yaml
DATABASE_DIR: "/path/to/your/db"
MAIN_REPO: "your main repo owner/name"
FORKS:
- "your fork owner/name"
- "your another fork owner/name"
DISCORD_WEBHOOK_URL: "your discord bot webhook url here"
Run the Main Script: Run the script providing the config file and (optionally) wait interval between consecutive runs (in seconds).
python main.py --interval 3600 config.yaml
The primary target of this project is to monitor the development progress of a repository by:
Initialization:
Continuous Monitoring:
main.py
This script initializes the main repository and repository family in the database and continuously runs a specified script at defined intervals.
database.py
This script initializes the database with the initial state of the main repository.
Functions:
init_main_repo()
: Initializes the main repository in the database.init_repo_fam()
: Initializes the repository family in the database.fetch_initial_state()
: Fetches the initial state from GitHub.Usage:
Functions:
branch_report()
: Connects to the database, fetches the state data, and processes it to generate a report.Usage:
project/
│
├── main.py
│
├── observing/
│ └── bot/bot.py
│ └── observer/
│ └── utils/database.py
│── .env
├── db/
│ └── ob_branch.db
│ └── ob_prs.db
│
│
├── config.yaml
└── run.py # Script that is run continuously by main.py
By following this documentation, you should be able to set up and run the project to monitor the development progress of a repository. Each script plays a crucial role in initializing the database, continuously updating the repository state, and generating reports.