Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ exports/*

# Temporary files
tmp/
temp/
temp/

# Local utility scripts (not for production)
scripts/cleanup_*.py
scripts/test_*.py
scripts/check_*.py
scripts/README_cleanup.md
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GitHub Copilot Cost Center Automation
# GitHub Cost Center Automation

Automate GitHub Copilot license cost center assignments for your enterprise with two powerful modes:

Expand Down
3 changes: 2 additions & 1 deletion automation/update_cost_centers.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

# GitHub Copilot Cost Center Update Script
#!/bin/bash
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate shebang line. Remove the redundant #!/bin/bash on line 3.

Suggested change
#!/bin/bash

Copilot uses AI. Check for mistakes.
# GitHub Cost Center Update Script
# This script runs the cost center assignment and exports data
# Usage: ./update_cost_centers.sh [full]
# - Default: Incremental processing (only new users since last run)
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '3.8'

services:
copilot-manager:
cost-center-automation:
build: .
container_name: copilot-cost-center-manager
container_name: cost-center-automation
volumes:
- ./config:/app/config:ro
- ./exports:/app/exports
Expand All @@ -14,9 +14,9 @@ services:
command: python main.py --assign-cost-centers --export both --summary-report

# Optional: Scheduled runner using cron-like functionality
copilot-scheduler:
cost-center-scheduler:
build: .
container_name: copilot-scheduler
container_name: cost-center-scheduler
volumes:
- ./config:/app/config:ro
- ./exports:/app/exports
Expand Down
32 changes: 28 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
GitHub Copilot Cost Center Management Script
GitHub Cost Center Management Script

Automates cost center assignments for GitHub Copilot users with two operational modes:

Expand Down Expand Up @@ -51,7 +51,7 @@ def handle_interrupt(signum, frame):
def parse_arguments():
"""Parse command line arguments."""
parser = argparse.ArgumentParser(
description="GitHub Copilot Cost Center Management - PRU-based or Teams-based assignment",
description="GitHub Cost Center Management - PRU-based or Teams-based assignment",
epilog="""
Examples:
# PRU-based mode (default)
Expand Down Expand Up @@ -217,8 +217,26 @@ def _handle_teams_mode(args, config: ConfigManager, teams_manager, logger) -> No

# Exit early if only showing config
if args.show_config and not any([args.assign_cost_centers, args.summary_report]):
logger.info("Configuration displayed. Use --mode plan or --mode apply to process teams.")
return

# If no action flags specified, default behavior depends on mode
if not any([args.assign_cost_centers, args.summary_report]):
if args.mode == "apply":
# In apply mode, user likely wants to assign cost centers
print("\n" + "="*60)
print("ℹ️ APPLY MODE - Processing cost center assignments")
print("="*60)
print("💡 Tip: Use --mode plan to preview changes without applying them.\n")
args.assign_cost_centers = True
else:
# In plan mode, show plan
print("\n" + "="*60)
print("ℹ️ PLAN MODE - Showing what would be done (no changes)")
print("="*60)
print("💡 Tip: Use --mode apply --yes to actually sync the assignments.\n")
args.assign_cost_centers = True # Enable preview in plan mode too!

# Generate summary report if requested
if args.summary_report:
logger.info("Generating teams-based cost center summary...")
Expand Down Expand Up @@ -247,10 +265,16 @@ def _handle_teams_mode(args, config: ConfigManager, teams_manager, logger) -> No

# Assign cost centers if requested
if args.assign_cost_centers:
logger.info("Processing team-based cost center assignments...")

print("\n" + "="*60)
if args.mode == "plan":
print("📋 PLAN MODE - Preview Only (No Changes)")
print("="*60)
logger.info("MODE=plan (no changes will be made)")
else:
print("⚡ APPLY MODE - Will Make Changes")
print("="*60)

logger.info("Processing team-based cost center assignments...")

# Build and optionally sync assignments
if args.mode == "plan":
Expand Down
174 changes: 0 additions & 174 deletions scripts/performance_comparison.py

This file was deleted.

Loading
Loading