Skip to content

feat: multi-org capability #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: multi-org capability #23

wants to merge 2 commits into from

Conversation

amenocal
Copy link
Contributor

@amenocal amenocal commented Jul 29, 2025

This pull request introduces significant enhancements to the gh-repo-stats-plus tool, including support for multi-organization processing, improved state management, and detailed documentation updates. The most important changes are grouped into three themes: new multi-organization features, enhancements to state handling, and updates to documentation and user guidance.

Example on what it looks like (trimmed for brevity):

/gh-repo-stats-plus multi-org* ❯ gh repo-stats-plus repo-stats --org-list org-list.txt 
Version: 0.0.1-development
Starting repo-stats...
Initializing logger with file: /Users/amenocal/Desktop/Dev/github/gh-repo-stats-plus/logs/multi-org-summary-2025-07-31.log
2025-07-31T14:20:03.699Z info: Starting processing of 2 organizations
2025-07-31T14:20:03.701Z info: Organizations to process: TheSandVillages-emu, TheLeafVillages-emu
2025-07-31T14:20:03.701Z info: [1/2] Starting processing for organization: TheSandVillages-emu
...
...
2025-07-31T14:20:23.586Z info: Completed processing 37 repositories. Last cursor: Y3Vyc29yOnYyOpKpd2l0aC13aWtpzjykJzY=, Last repo: with-wiki
Start time: 2025-07-31T14:20:03.708Z
End time: 2025-07-31T14:20:23.585Z
Total elapsed time: 0h 0m 19s
Consecutive successful operations: 37
Total retry attempts: 0
Processing completed successfully: true
2025-07-31T14:20:23.588Z debug: Saved multi-org state to last_known_state.json
...
...
2025-07-31T14:20:33.422Z info: [2/2] Successfully completed processing for organization: TheLeafVillages-emu (2.843s)
2025-07-31T14:20:33.423Z info: 
================================================================================
2025-07-31T14:20:33.423Z info: MULTI-ORG PROCESSING SUMMARY
2025-07-31T14:20:33.423Z info: ================================================================================
2025-07-31T14:20:33.423Z info: Total organizations processed: 2
2025-07-31T14:20:33.423Z info: Successful: 2
2025-07-31T14:20:33.423Z info: Failed: 0
2025-07-31T14:20:33.423Z info: Success rate: 100.0%
2025-07-31T14:20:33.423Z info: 
Detailed Results:
2025-07-31T14:20:33.423Z info:   TheSandVillages-emu: ✅ SUCCESS (21.9s)
2025-07-31T14:20:33.423Z info:   TheLeafVillages-emu: ✅ SUCCESS (2.8s)

Multi-Organization Support

  • Added a new runMultiOrg function to process multiple organizations sequentially, with configurable delays and error resilience (src/main.ts) (F2d3c96eL167R392).
  • Introduced the --org-list option to specify a file containing multiple organization names, along with related options like --delay-between-orgs and --continue-on-error (src/commands/repo-stats-command.ts) [1] [2].

State Management Enhancements

  • Updated state management functions to include organization-specific state handling, ensuring proper tracking and cleanup of completed organization states (src/main.ts) [1] [2] [3].

Documentation Updates

  • Expanded the README with a detailed description of new options, permissions, and output formats, including advanced usage examples for multi-organization processing (README.md).
  • Removed outdated sections and reorganized content for clarity (README.md) [1] [2].

Codebase Improvements

  • Enhanced error handling and validation for required options, ensuring robustness when processing single or multiple organizations (src/main.ts).
  • Refactored key functions to include optional orgName parameters for better modularity and maintainability (src/main.ts) (F2d3c96eL206R532, F2d3c96eL348R599, F2d3c96eL541R744).

These changes collectively improve the tool's functionality and usability, particularly for users managing multiple organizations.

@amenocal amenocal added the enhancement New feature or request label Jul 31, 2025
@scottluskcis scottluskcis linked an issue Aug 1, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to run for an enterprise to include all orgs
1 participant