Merge branch 'main' into avm99963-monorail

GitOrigin-RevId: 1412a00daa7379d93b6872e9ef7da0a45118b180
diff --git a/businesslogic/work_env.py b/businesslogic/work_env.py
index c7282c0..0854209 100644
--- a/businesslogic/work_env.py
+++ b/businesslogic/work_env.py
@@ -906,6 +906,17 @@
       next_start = end
     return ListResult(config.component_defs[start:end], next_start)
 
+  def GetComponentDef(self, project_id, component_id):
+    # type: (int, int) -> ComponentDef
+    """Returns component def for component id that belongs to the project."""
+    if component_id < 0:
+      raise exceptions.InputException(
+        'Invalid `component_id`: %d' % component_id)
+
+    config = self.GetProjectConfig(project_id)
+    return tracker_bizobj.FindComponentDefByID(component_id, config)
+
+
   def CreateComponentDef(
       self, project_id, path, description, admin_ids, cc_ids, labels):
     # type: (int, str, str, Collection[int], Collection[int], Collection[str])