Skip to content
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

Prow accepted invalid OWNERS_ALIASES change and broke approvals #360

Open
tuminoid opened this issue Jan 17, 2025 · 4 comments
Open

Prow accepted invalid OWNERS_ALIASES change and broke approvals #360

tuminoid opened this issue Jan 17, 2025 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@tuminoid
Copy link
Contributor

tuminoid commented Jan 17, 2025

Issue

We use OWNERS file that points to aliases listed in OWNERS_ALIASES.

We promoted all of our reviewers to approvers in this PR, which then caused Prow to stop accepting approves, such as here and here.

Expected outcome

When merging PR116, Prow should've labeled the PR as "do-not-merge/invalid-owners-file" and blocked it.

Actual outcome

Prow/tide did not complain, we merged it, and noticed that approving was broken. Had to manually merge a fix PR, which then solved the situation right away.

Looking at the verify-owners_test.go:

  1. It seems it should fail to empty groups. I'm suspecting there is loophole due usage of OWNERS_ALIASES, which is much less tested here.
  2. Another alternative is the use of {} to signal empty group, which is valid YAML, but maybe not expected by Prow?

Logs

There was no error logs in Prow, just regular comment/approval handling logs, that did not indicate OWNERS was broken. It just claimed "comment did not result in approval".

@tuminoid
Copy link
Contributor Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 20, 2025
@nikhilkumar13199
Copy link

Can I assign this to myself? Prima facie, seems like a missed edge case,

@tuminoid
Copy link
Contributor Author

Can I assign this to myself? Prima facie, seems like a missed edge case,

/assign @nikhilkumar13199

Any help would be appreciated, Prow is needing contributors!

@nikhilnishad-goog
Copy link

nikhilnishad-goog commented Feb 3, 2025

I see possible problems. One thing is with {} and without {} seemed to be parsed different by go. Also, we are simply iterating over strings(usernames) in each alias in ParseAliasesConfig and not handling the case where an alias group may be empty (have no users in it). Ideally, we should not accept such empty cases and throw.

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants