api: add emerge_and_upload_lints

Lint everything in platform2 with clang-tidy and upload to gs.
Will be used for a dashboard that tracks lints.

BUG=b:259129394
TEST=toolchain__emerge_and_upload_lints in call_scripts

Change-Id: Ib922f70696fe1df6ae53fc107751d20cb4881f9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4112283
Tested-by: Adrian Dole <adriandole@google.com>
Auto-Submit: Adrian Dole <adriandole@google.com>
Commit-Queue: Adrian Dole <adriandole@google.com>
Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org>
diff --git a/api/controller/toolchain.py b/api/controller/toolchain.py
index 5c78247..6e68fd7 100644
--- a/api/controller/toolchain.py
+++ b/api/controller/toolchain.py
@@ -381,6 +381,21 @@
 }
 
 
+@validate.require("sysroot.build_target.name")
+@validate.require("start_time")
+@validate.validation_complete
+def EmergeAndUploadLints(
+    input_proto: toolchain_pb2.DashboardLintRequest,
+    output_proto: toolchain_pb2.DashboardLintResponse,
+    _config,
+):
+    """Lints all platform2 packages and uploads lints to GS"""
+    board = input_proto.sysroot.build_target.name
+    output_proto.gs_path = toolchain.emerge_and_upload_lints(
+        board, input_proto.start_time
+    )
+
+
 @faux.all_empty
 @validate.exists("sysroot.path")
 @validate.require("packages")
@@ -393,7 +408,7 @@
     """Emerge packages with linter features enabled and retrieves all findings.
 
     Args:
-        input_proto: The nput proto with package and sysroot info.
+        input_proto: The input proto with package and sysroot info.
         output_proto: The output proto where findings are stored.
         _config: The API call config (unused).
     """