Skip to content

fix: apply merged config to the CODEOWNERS requirement - #928

Open
arpitjain099 wants to merge 1 commit into
ossf:mainfrom
arpitjain099:fix/codeowners-merged-config
Open

arpitjain099 wants to merge 1 commit into
ossf:mainfrom
arpitjain099:fix/codeowners-merged-config

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

check reads oc.RequireCODEOWNERS straight off the org config, so it never goes through mergeConfig. That means requireCODEOWNERS set per repo, either in the org config repo under <repo>/codeowners.yaml or in the checked repo's own .allstar folder, is parsed into mergedConfig.RequireCODEOWNERS and then ignored. Every other policy merges first and reads the merged value, and GetAction in this same file already does.

Switching the one read to mc.RequireCODEOWNERS is the whole fix. mergeConfig still gates the repo's own config on disableRepoOverride, so an org that locks the setting keeps it. Three cases added to TestCheck cover a repo turning the requirement on, a repo turning it off, and the locked case; the first two fail on main. go test ./... passes.

AI assistance was used on this change and is disclosed in the commit trailer.

The CODEOWNERS check reads oc.RequireCODEOWNERS straight off the org config,
so it never goes through mergeConfig. Both repo-level settings, the one in the
org config repo under <repo>/codeowners.yaml and the one in the checked repo's
own .allstar folder, are parsed into mergedConfig.RequireCODEOWNERS and then
ignored. Every other policy merges first and reads the merged value, and
GetAction in this file already does. mergeConfig still gates the repo's own
config on disableRepoOverride, so an org that locks the setting keeps it.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant