Conversation
Co-authored-by: zkoppert <[email protected]>
Co-authored-by: zkoppert <[email protected]>
Copilot
AI
changed the title
[WIP] feat: Ability to specify a list of users or team as the owning team
feat: Add ability to specify owning team via OWNING_TEAM environment variable
Sep 30, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new feature to allow explicit specification of repository ownership through the OWNING_TEAM environment variable, providing an alternative to the automatic team determination algorithm.
- Adds
OWNING_TEAMenvironment variable to override the built-in team determination algorithm - Modifies core logic to use explicitly specified team members when provided
- Updates report generation to display appropriate messaging based on team determination method
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| config.py | Adds owning_team field to EnvVars class and parsing logic for comma-separated usernames |
| measure_innersource.py | Implements team override logic to bypass original commit analysis when OWNING_TEAM is set |
| markdown_writer.py | Updates report generation to handle explicit team specification vs algorithm-based determination |
| test_config_owning_team.py | Comprehensive test suite for environment variable parsing with 7 test cases |
| test_markdown_writer_owning_team.py | Test cases for report generation with both team determination methods |
| README.md | Documentation updates including configuration table, algorithm section, and usage examples |
| .env-example | Adds OWNING_TEAM to environment variable template |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Zack Koppert <[email protected]>
This commit fixes an issue in the test where the mock commits setup was causing an infinite loop. The changes include: - Converting mock commits to a proper iterator to match real GitHub API behavior - Fixing environment variable field names to align with actual main function usage - Adding chunk_size to avoid issues in processing loops - Adding additional assertions to verify early function exit Tests that were previously hanging now complete successfully. Signed-off-by: Zack Koppert <[email protected]>
Added test_markdown_writer_original_author_only.py to cover the specific case where an original commit author is provided without a manager, ensuring that the appropriate heading is written to the report markdown file. Signed-off-by: Zack Koppert <[email protected]>
This change improves the clarity and maintainability of the codebase by: - Adding an explicit `team_ownership_explicitly_specified` parameter to track when team ownership is provided explicitly rather than derived from commit history - Updating logic in markdown_writer.py to prioritize this flag when determining report headings - Adding a fallback message for cases where neither original author nor explicit team ownership is specified - Setting flag value in measure_innersource.py based on owning_team parameter - Adding comprehensive tests for the new parameter and updated behavior This change makes the relationship between owning_team and report content more explicit and handles edge cases more gracefully. Signed-off-by: Zack Koppert <[email protected]>
…ficiency This change improves memory usage and scalability for repositories with large commit histories by: - Replacing list(commits) with chunked processing to avoid loading the entire commit history into memory at once - Using iterators directly to find the original commit author instead of loading all commits first - Processing commits in manageable chunks based on the configured chunk_size, similar to how pull requests and issues are already handled - Adding debug logging for commit processing progress This approach ensures consistent memory usage regardless of repository size and prevents potential out-of-memory issues when analyzing repositories with extensive commit histories. Signed-off-by: Zack Koppert <[email protected]>
jmeridth
approved these changes
Oct 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to specify a list of users as the owning team that overrides the built-in algorithm to determine who the owning team members are. This addresses situations where the first commit author doesn't represent the current team or when the org chart is misaligned with actual repository ownership.
Problem
The current team determination algorithm analyzes the first commit author and uses the org chart to build the team list. This can be problematic when:
Solution
Introduces a new optional environment variable
OWNING_TEAMthat accepts a comma-separated list of GitHub usernames:When
OWNING_TEAMis set, the tool:When
OWNING_TEAMis not set, the tool behaves exactly as before, maintaining full backward compatibility.Changes
Configuration (
config.py)owning_team: list[str] | Nonefield toEnvVarsclassNoneCore Logic (
measure_innersource.py)owning_teamconfiguration at start of team determinationoriginal_commit_author/original_commit_author_managertoNoneOWNING_TEAMis not providedReport Generation (
markdown_writer.py)Nonevalues for original commit author and managerDocumentation (
README.md)OWNING_TEAMto configuration options tableTesting
test_config_owning_team.pywith 7 test cases covering various input scenariostest_markdown_writer_owning_team.pywith 2 test cases for report generationExample Usage
Backward Compatibility
✅ Fully backward compatible - existing workflows continue to work unchanged. The new feature is opt-in and only activates when
OWNING_TEAMis explicitly set.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/github/github%2Fmeasure-innersource/languages/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.