Skip to content

Conversation

jasonwbarnett
Copy link

@jasonwbarnett jasonwbarnett commented Aug 15, 2025

Description

Changes proposed in this pull request:

  • Add OWNER_CHECKER_ALLOW_CROSS_ORG_TEAMS environment variable to allow teams from different organizations to be valid CODEOWNERS
  • When enabled, skips the validation that checks if a team belongs to the same organization as the repository
  • Useful during repository transitions between organizations (e.g., from old-org/repo to new-org/repo)
  • Defaults to false to maintain backward compatibility

Related issue(s)

N/A - Feature request to support organization transitions where teams are defined in the target organization but the repository temporarily resides in a different organization for testing purposes.

@jasonwbarnett jasonwbarnett changed the title feat: allow cross org teams feat: add flag to allow cross-organization teams during org transitions Aug 15, 2025
@jasonwbarnett jasonwbarnett force-pushed the jwb/allow-cross-repo branch 3 times, most recently from c41007a to f0d5edf Compare August 15, 2025 23:06
This allows teams from different organizations to be valid owners, which is
useful during repository transitions between organizations (e.g., from
altana-poc to altana-tech).

When OWNER_CHECKER_ALLOW_CROSS_ORG_TEAMS is set to true, the validator will:
- Skip the check that ensures teams belong to the repository's organization
- Validate that teams actually exist in their respective organizations
- Skip permission checks for cross-org teams (can't verify permissions across orgs)

This allows CODEOWNERS files to reference teams in the target organization
while the repository is temporarily in a different organization for testing.
Teams are still validated for existence, ensuring typos are caught.

Updates:
- Add AllowCrossOrgTeams field to ValidOwnerConfig
- Refactor team validation to fetch teams from the appropriate org
- Skip permission checks for cross-org teams
- Add documentation for the new environment variable
- Update GitHub Action definition with new input parameter
- Add unit tests for the new configuration flag

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant