New issue
Advanced search Search tips

Issue 836032 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 799482



Sign in to add a comment

Owners check for changes to OWNERS files doesn't validate new OWNERS files

Project Member Reported by oksamyt@chromium.org, Apr 23 2018

Issue description

From https://crbug.com/141253#c22:

Is it possible that OldContents() logic doesn't handle the case of adding a new OWNERS file with invalid lines (old content is empty and the new content is not checked for validity)?

The following file passed the presubmit check:
https://cs.chromium.org/chromium/src/components/password_manager/public/interfaces/OWNERS

Subsequent attempts to remove the invalid lines fail the presubmit check with the error:

owners.SyntaxErrorInOwnersFile: /usr/local/google/home/oksamyt/work/chromium/src/components/password_manager/public/interfaces/OWNERS:8 syntax error: "for files:" is not a "set noparent", file include, "*", or an email address.

 
It used to be the case that new OWNERS files were not checked, but not anymore. 

Changes to OWNERS files use the old version to check ownership, so trying to remove the lines would still fail.

I think it would be best to make a CL fixing the OWNERS file and skip presubmit for it.

Dirk, what do you think?

Comment 2 by vabr@chromium.org, Apr 24 2018

The CL fixing the OWNERS and slightly improving the presubmit message which lead to the mess is https://crrev.com/c/1025093
Thank you for the fix vabr@!
ehmaldonado@, I should have clarified: the OWNERS file with invalid lines was added later (2018-01-17, https://crrev.com/f99b788b80d018e18b543314afbeaea9c99304ea) than the OldContents() check (2017-04-17, https://crrev.com/d0573ec067f852c3a967b8e6aa38ad07615a6dc9), so my concern is that it is still possible to add new files with invalid lines (and they need to be cleaned up with presubmits disabled).
oksamyt: Yes, but it was added before we started checking the contents of new OWNERS files (2018-04-19 https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/067ef5d8941a59ca176f5ee63bb02d0e3df947c4) so it shouldn't be possible to add invalid OWNERS anymore :)
Status: WontFix (was: Untriaged)
ehmaldonado@, thank you for the explanation, I didn't see the new check. Will close this ticket since no further changes are needed.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1893a97da066e0f8408172aa3977d6b27b3087d1

commit 1893a97da066e0f8408172aa3977d6b27b3087d1
Author: Vaclav Brozek <vabr@chromium.org>
Date: Wed Apr 25 05:48:05 2018

Fix components/password_manager/public/interfaces/OWNERS

When some Mojo-related OWNERS rules are not added where they should be,
the _CheckIpcOwners check suggests to add what is missing. The output of
that check is vague about what lines are supposed to go into OWNERS.

This way, components/password_manager/public/interfaces/OWNERS got
extended with some garbage text. [1]

This CL removes that text and also improves a little the presubmit
message, which now says how many of the following lines should be added
to the OWNERS file, as well as moves those lines to the very end of
the whole message.

Adding NOPRESUBMIT because the OWNERS syntax check fails on the old
OWNERS file (which this CL is fixing). This is a known issue and was
discussed on the associated bug. The resolution is that since
presubmit should avoid landing a malformed OWNERS in the future, it
is no problem if it fires for old OWNERS.
NOPRESUBMIT=true

[1] https://chromium-review.googlesource.com/c/chromium/src/+/840381/14/components/password_manager/public/interfaces/OWNERS#8

Bug:  836032 
Change-Id: I0c6bdc321de06925d06775a5f1bd034c6c4dc957
Reviewed-on: https://chromium-review.googlesource.com/1025093
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553461}
[modify] https://crrev.com/1893a97da066e0f8408172aa3977d6b27b3087d1/PRESUBMIT.py
[modify] https://crrev.com/1893a97da066e0f8408172aa3977d6b27b3087d1/components/password_manager/public/interfaces/OWNERS

Sign in to add a comment