This repository contains automation tools for MLOps project management, including sprint planning and Git branch management.
Tools for creating sprint milestones and user stories:
github_sprint_planner_local.py- Token-free local simulation of GitHub Issues and Milestonesgithub_sprint_planner.py- Creates actual GitHub Issues and Milestones using the PyGithub librarygithub_sprint_planner_rest.py- Alternative implementation using direct REST API callsvisualize_sprint_planning.py- Visualizes locally created sprint data
Tools for creating branch structure and protection rules:
github_branch_manager.py- Creates dev/test branches and generates branch protection configurationsgithub_branch_manager_api.py- Extended version that can apply branch protection rules via GitHub API
- Python 3.6+
- For GitHub API integration: A GitHub Personal Access Token with repo scope
- Clone this repository
- Install the required packages:
pip install -r requirements.txtThis approach doesn't require GitHub authentication and simulates sprint planning locally:
python github_sprint_planner_local.py <owner> <repo_name> <stories_json_file>For example:
python github_sprint_planner_local.py "myusername" "my-mlops-project" user_stories.jsonTo visualize the results:
python visualize_sprint_planning.pyIf you want to create actual GitHub issues (requires a token):
- Set your GitHub token as an environment variable:
# For Windows PowerShell
$env:GITHUB_TOKEN="your_token_here"
# For Bash/Linux
export GITHUB_TOKEN="your_token_here"- Run the script with your repository details:
# Using PyGithub library
python github_sprint_planner.py <owner> <repo_name> <stories_json_file>
# OR using direct REST API calls
python github_sprint_planner_rest.py <owner> <repo_name> <stories_json_file>Create dev/test branches and generate branch protection configurations without applying them:
python github_branch_manager.py --owner <owner> --repo <repo_name>Example:
python github_branch_manager.py --owner "myusername" --repo "my-mlops-project"To create branches and apply protection rules via GitHub API (requires a token):
python github_branch_manager_api.py --owner <owner> --repo <repo_name> --token <token> --apply-protectionTo check if branches are already protected:
python github_branch_manager_api.py --owner <owner> --repo <repo_name> --token <token> --check-protectionThe branch management tools set up the following branch structure:
main- Production environment (protected)test- Staging/testing environment (protected)dev- Development environment
Branch protection rules include:
- Required pull request reviews (at least 1 approving review)
- Required status checks (lint, unit-tests)
- Disabled force pushes and deletions
The sprint planning tools use the following JSON format for user stories:
[
{
"title": "Story title",
"description": "Detailed description",
"assignee": "username",
"labels": ["label1", "label2"],
"sprint": 1
}
]Where:
title: The title of the issue (required)description: The detailed description for the issue bodyassignee: Username of the assigneelabels: Array of label names to applysprint: Sprint number (1 or 2) (required)