pre-upload: drop support for COMMIT-QUEUE.ini

We aren't checking this file anymore.

BUG=chromium:1025955
TEST=CQ passes

Change-Id: I8d753b63647715ffd192d42f38f36b21f93ee3e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/repohooks/+/1959697
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/COMMIT-QUEUE.ini b/COMMIT-QUEUE.ini
deleted file mode 100644
index de9e97a..0000000
--- a/COMMIT-QUEUE.ini
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Per-project Commit Queue settings.
-# Documentation: http://goo.gl/4rZhAx
-
-[GENERAL]
-
-# This code is only used by devs and shouldn't impact the CQ.
-submit-in-pre-cq: yes
-
-# Pick a config that does local unittests only.
-pre-cq-configs: amd64-generic-no-vmtest-pre-cq
diff --git a/pre-upload.py b/pre-upload.py
index 90111f4..9dc2527 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -43,7 +43,6 @@
 # The sys.path monkey patching confuses the linter.
 # pylint: disable=wrong-import-position
 from chromite.lib import commandline
-from chromite.lib import constants
 from chromite.lib import cros_build_lib
 from chromite.lib import git
 from chromite.lib import osutils
@@ -796,7 +795,7 @@
       full_details=True)
 
   # Don't yell about changes to whitelisted files...
-  whitelist = ('ChangeLog', 'Manifest', 'metadata.xml', 'COMMIT-QUEUE.ini')
+  whitelist = {'ChangeLog', 'Manifest', 'metadata.xml'}
   affected_path_objs = [x for x in affected_path_objs
                         if os.path.basename(FinalName(x)) not in whitelist]
   if not affected_path_objs:
@@ -1609,31 +1608,6 @@
   return None
 
 
-def _check_cq_ini_well_formed(_project, commit):
-  """Check that any modified COMMIT-QUEUE.ini files are well formed."""
-  pattern = '.*' + constants.CQ_CONFIG_FILENAME
-  files = _filter_files(_get_affected_files(commit, relative=True), (pattern,))
-
-  # TODO(akeshet): Check not only that the file is parseable, but that all the
-  # pre-cq configs it requests are existing ones.
-  for f in files:
-    try:
-      parser = configparser.SafeConfigParser()
-      # Prior to python3, ConfigParser has no read_string method, so we must
-      # pass it either a file path or file like object. And we must use
-      # _get_file_content to fetch file contents to ensure we are examining the
-      # commit diff, rather than whatever's on disk.
-      # TODO(vapier): Once we migrate this to Python 3 only, cut it over.
-      contents = _get_file_content(f, commit)
-      parser.read_file(contents.splitlines())
-    except configparser.Error as e:
-      msg = ('Unable to parse COMMIT-QUEUE.ini file at %s due to %s.' %
-             (f, e))
-      return HookFailure(msg)
-
-  return None
-
-
 def _run_project_hook_script(script, project, commit):
   """Runs a project hook script.
 
@@ -1822,7 +1796,6 @@
 
 # A list of hooks that are not project-specific
 _COMMON_HOOKS = [
-    _check_cq_ini_well_formed,
     _check_cros_license,
     _check_ebuild_eapi,
     _check_ebuild_keywords,
diff --git a/pre-upload_unittest.py b/pre-upload_unittest.py
index f672a7c..e1cbcb5 100755
--- a/pre-upload_unittest.py
+++ b/pre-upload_unittest.py
@@ -445,43 +445,6 @@
     self._testReject('EBUILD foo\n')
 
 
-class CheckConfigParsing(PreUploadTestCase):
-  """Tests _check_cq_ini_well_formed."""
-
-  def setUp(self):
-    self.file_mock = self.PatchObject(pre_upload, '_get_affected_files')
-    self.content_mock = self.PatchObject(pre_upload, '_get_file_content')
-
-  def testIgnoreIrrelevantFile(self):
-    self.file_mock.return_value = ['unrelated_file.ini']
-    self.content_mock.return_value = u'^$malformed gibberish^^&'
-    self.assertIsNone(pre_upload._check_cq_ini_well_formed('PROJECT', 'COMMIT'))
-
-  def testWellformedFile(self):
-    self.file_mock.return_value = ['COMMIT-QUEUE.ini']
-    self.content_mock.return_value = u"""#
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Per-project Commit Queue settings.
-# Documentation: http://goo.gl/4rZhAx
-
-[GENERAL]
-
-# Stages to ignore in the commit queue. If these steps break, your CL will be
-# submitted anyway. Use with caution.
-# The files in here currently only get tested via internal canaries.
-ignored-stages: UNitTest HWTest VMTest UploadPrebuilts Archive"""
-    self.assertIsNone(pre_upload._check_cq_ini_well_formed('PROJECT', 'COMMIT'))
-
-  def testMalformedFile(self):
-    self.file_mock.return_value = ['COMMIT-QUEUE.ini']
-    self.content_mock.return_value = u'^$malformed gibberish^^&'
-    m = pre_upload._check_cq_ini_well_formed('PROJECT', 'COMMIT')
-    self.assertTrue(isinstance(m, pre_upload.HookFailure))
-
-
 class CheckPortageMakeUseVar(PreUploadTestCase):
   """Tests for _check_portage_make_use_var."""