Skip to content

TejasMate/WinGetManifestGeneratorTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WinGet Manifest Generator Tool

CI/CD Pipeline codecov PyPI version Python Versions License: MIT

Professional generator tool for managing and updating WinGet package manifests with comprehensive monitoring and observability.

πŸš€ Features

Core Functionality

  • Automated Package Processing: Streamlined workflow for updating WinGet package manifests
  • GitHub Integration: Seamless integration with GitHub repositories and release management
  • Multi-source Support: Handle packages from various sources and repositories
  • Batch Processing: Efficiently process multiple packages simultaneously
  • Manifest Generation: Automated generation of WinGet manifest files

Enterprise-Grade Monitoring

  • Structured Logging: JSON-formatted logs with correlation tracking
  • Comprehensive Metrics: Performance monitoring with counters, gauges, and histograms
  • Health Checks: Automated system health monitoring and alerting
  • Progress Tracking: Real-time progress indicators with ETA calculation

Developer Experience

  • CLI Interface: Intuitive command-line interface with rich formatting
  • Configuration Management: Flexible configuration with environment-specific settings
  • Extensible Architecture: Plugin-friendly design for custom extensions
  • Comprehensive Testing: Full test suite with unit, integration, and E2E tests

πŸ“¦ Installation

From PyPI (Recommended)

pip install winget-manifest-generator-tool

From Source

git clone https://github.com/TejasMate/WinGetManifestGeneratorTool.git
cd WinGetManifestGeneratorTool
pip install -e .

Development Installation

git clone https://github.com/TejasMate/WinGetManifestGeneratorTool.git
cd WinGetManifestGeneratorTool
make dev-setup

πŸš€ Quick Start

1. Configuration

# Set up environment variables for GitHub tokens
cp .env.example .env
# Edit .env with your GitHub tokens

# Configuration is already set up in config/config.yaml
# Verify configuration
python -c "from src.config import get_config; print('Config loaded successfully')"

2. Health Check

# Verify system health
wmat health

3. Process Packages

# Process specific packages
wmat process --packages Microsoft.VSCode --packages Microsoft.PowerToys

# Process all packages (dry run)
wmat process --dry-run

# Process with filtering
wmat process --filter github

4. Monitor Operations

# View system metrics
wmat metrics

# Export health report
wmat health --format json > health-report.json

πŸ”„ Usage

Professional CLI (Recommended)

The tool now provides a modern CLI interface for streamlined operations:

# Install the package
pip install -e .

# Check system health
wmat health

# Process packages with monitoring
wmat process --packages Microsoft.VSCode --dry-run

# View system metrics
wmat metrics

Legacy Workflow (Direct Script Execution)

For users familiar with the original workflow, you can run the core scripts directly. The project workflow consists of three main steps:

1. Process WinGet Package Manifests

python src/winget_automation/PackageProcessor.py

This analyzes all package manifests in the WinGet repository, extracts version patterns, and creates CSV files with package information.

2. Analyze GitHub Repositories for Latest Versions

export```
This checks GitHub repositories for the latest versions of packages and compares them with the versions in WinGet.

#### 3. Generate Update Commands
```bash
python src/winget_automation/KomacCommandsGenerator.py

This creates komac update commands for packages that have newer versions available on GitHub.

βœ… Import Fix Applied: All scripts now work correctly with both direct execution and module imports.

Legacy Workflow with Monitoring

You can enhance the legacy workflow with the new monitoring capabilities:

# Run with structured logging
PYTHONPATH=src python scripts/test_monitoring.py

# Process with configuration validation
python scripts/test_config.py

# Run the complete legacy workflow with monitoring
python examples/integration_demo.py

Migration Notes

  • Script Paths: Scripts moved from src/ to src/winget_automation/
  • Import Paths: Updated for new package structure
  • Configuration: Enhanced YAML-based configuration system
  • Monitoring: All operations now include comprehensive monitoring
  • Backwards Compatibility: Original functionality preserved

πŸ—οΈ Architecture

WinGet Manifest Generator Tool
β”œβ”€β”€ CLI Interface (Rich formatting, Click-based)
β”œβ”€β”€ Configuration Management (YAML-based, environment-aware)
β”œβ”€β”€ Package Processing Engine
β”‚   β”œβ”€β”€ GitHub Integration
β”‚   β”œβ”€β”€ Release Detection
β”‚   └── Manifest Generation
β”œβ”€β”€ Monitoring & Observability
β”‚   β”œβ”€β”€ Structured Logging (JSON, correlation IDs)
β”‚   β”œβ”€β”€ Metrics Collection (Prometheus-compatible)
β”‚   β”œβ”€β”€ Health Checks (System, API, Repository)
β”‚   └── Progress Tracking (Real-time, ETA calculation)
└── Utilities & Extensions

πŸ“– Documentation

πŸ› οΈ Development

Prerequisites

  • Python 3.8+
  • Git
  • Make (optional, for convenience commands)

Setup Development Environment

# Clone repository
git clone https://github.com/TejasMate/WinGetManifestGeneratorTool.git
cd WinGetManifestGeneratorTool

# Setup development environment
make dev-setup

# Run tests
make test

# Run linting and formatting
make check

Project Structure

β”œβ”€β”€ src/winget_automation/     # Main package
β”‚   β”œβ”€β”€ cli.py                 # Command-line interface
β”‚   β”œβ”€β”€ config/                # Configuration management
β”‚   β”œβ”€β”€ monitoring/            # Monitoring and observability
β”‚   β”œβ”€β”€ github/                # GitHub integration
β”‚   └── utils/                 # Utility functions
β”œβ”€β”€ tests/                     # Test suite
β”œβ”€β”€ docs/                      # Documentation
β”œβ”€β”€ scripts/                   # Development scripts
β”œβ”€β”€ examples/                  # Usage examples
└── config/                    # Configuration files

Available Commands

make help                   # Show all available commands
make test                   # Run test suite
make lint                   # Run code linting
make format                 # Format code
make build                  # Build package
make clean                  # Clean build artifacts
make docs                   # Generate documentation
make demo                   # Run integration demo

πŸ”§ Configuration

The tool uses a unified YAML-based configuration system with environment variable support:

Environment Variables (.env file)

Create a .env file in the project root to store sensitive configuration:

# Copy the example file
cp .env.example .env

# Edit with your values
nano .env

Example .env file:

# GitHub API tokens (choose one method)
GITHUB_TOKEN=ghp_your_github_token_here
# OR multiple tokens for higher rate limits
GITHUB_TOKENS=ghp_token1,ghp_token2,ghp_token3

# Optional environment overrides
ENVIRONMENT=development
DEBUG=true

Main Configuration

# config/config.yaml
github:
  api_url: "https://api.github.com"
  # Tokens loaded automatically from .env file
  tokens: []  
  
package_processing:
  batch_size: 100
  max_workers: 4
  
filtering:
  blocked_packages:
    - "package.identifier"
  
monitoring:
  logging:
    level: "INFO"
    structured: true

Key Features:

  • πŸ”’ Secure: Sensitive tokens stored in .env (not tracked by Git)
  • πŸ”„ Flexible: Environment-specific overrides
  • ⚑ Auto-loading: .env files loaded automatically on startup
  • πŸ“ Multiple formats: Single token, multiple tokens, or individual variables

See Configuration Guide for detailed setup instructions.

πŸ“Š Monitoring

Structured Logging

from winget_automation.monitoring import get_logger

logger = get_logger(__name__)
logger.info("Processing package", package="Microsoft.VSCode", version="1.85.0")

Metrics Collection

from winget_automation.monitoring import get_metrics_collector, timer

metrics = get_metrics_collector()
metrics.increment_counter("packages.processed")

with timer("api_request_duration"):
    # Your API call here
    pass

Health Monitoring

# Check system health
wmat health

# Programmatic health checks
from winget_automation.monitoring import check_all_health
health_results = check_all_health()

🐳 Docker Support

Development

# Start development environment
docker-compose up winget-automation

# Run with monitoring
docker-compose up

Production

# Build production image
docker build --target production -t winget-automation .

# Run container
docker run -v $(pwd)/config:/app/config winget-automation wmat health

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Run the test suite: make test
  5. Submit a pull request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Microsoft WinGet team for the package manager
  • GitHub for excellent API and platform support
  • Python community for amazing libraries and tools

πŸ“ž Support


Made with ❀️ for the WinGet community

About

Automate the process of analyzing and updating packages in the Microsoft WinGet package repository.

Topics

Resources

License

Security policy

Stars

Watchers

Forks