Repository: dbt-labs/dbt-core

Issue:
[CT-2080] Fix broken types.proto after merge
Types.proto has some bad merges in it, which wasn't noticed since compiling the file does not run as part of testing. 


Discussion:

Resolving patch:
diff --git a/core/dbt/events/proto_types.py b/core/dbt/events/proto_types.py
--- a/core/dbt/events/proto_types.py
+++ b/core/dbt/events/proto_types.py
@@ -963,32 +963,16 @@ class FinishedRunningStatsMsg(betterproto.Message):
 
 
 @dataclass
-class ParseCmdOut(betterproto.Message):
-    """I001"""
-
-    msg: str = betterproto.string_field(1)
-
-
-@dataclass
-class ParseCmdOutMsg(betterproto.Message):
-    info: "EventInfo" = betterproto.message_field(1)
-    data: "ParseCmdOut" = betterproto.message_field(2)
-
-
-@dataclass
-class ParseCmdPerfInfoPath(betterproto.Message):
+class ParsePerfInfoPath(betterproto.Message):
     """I010"""
 
-    info: "EventInfo" = betterproto.message_field(1)
-    path: str = betterproto.string_field(2)
+    path: str = betterproto.string_field(1)
 
 
 @dataclass
-class ParseCmdPerfInfoPathMsg(betterproto.Message):
-    """I010"""
-
+class ParsePerfInfoPathMsg(betterproto.Message):
     info: "EventInfo" = betterproto.message_field(1)
-    data: "ParseCmdPerfInfoPath" = betterproto.message_field(2)
+    data: "ParsePerfInfoPath" = betterproto.message_field(2)
 
 
 @dataclass
@@ -2426,6 +2410,46 @@ class FormattingMsg(betterproto.Message):
     data: "Formatting" = betterproto.message_field(2)
 
 
+@dataclass
+class ServingDocsPort(betterproto.Message):
+    """Z018"""
+
+    address: str = betterproto.string_field(1)
+    port: int = betterproto.int32_field(2)
+
+
+@dataclass
+class ServingDocsPortMsg(betterproto.Message):
+    info: "EventInfo" = betterproto.message_field(1)
+    data: "ServingDocsPort" = betterproto.message_field(2)
+
+
+@dataclass
+class ServingDocsAccessInfo(betterproto.Message):
+    """Z019"""
+
+    port: str = betterproto.string_field(1)
+
+
+@dataclass
+class ServingDocsAccessInfoMsg(betterproto.Message):
+    info: "EventInfo" = betterproto.message_field(1)
+    data: "ServingDocsAccessInfo" = betterproto.message_field(2)
+
+
+@dataclass
+class ServingDocsExitInfo(betterproto.Message):
+    """Z020"""
+
+    pass
+
+
+@dataclass
+class ServingDocsExitInfoMsg(betterproto.Message):
+    info: "EventInfo" = betterproto.message_field(1)
+    data: "ServingDocsExitInfo" = betterproto.message_field(2)
+
+
 @dataclass
 class RunResultWarning(betterproto.Message):
     """Z021"""
diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py
--- a/core/dbt/events/types.py
+++ b/core/dbt/events/types.py
@@ -768,20 +768,11 @@ def message(self) -> str:
 # =======================================================
 
 
-@dataclass
-class ParseCmdOut(InfoLevel, pt.ParseCmdOut):
-    def code(self):
-        return "I001"
-
-    def message(self) -> str:
-        return self.msg
-
-
-# Skipping I002, I003, I004, I005, I006, I007, I008, I009
+# Skipping I001, I002, I003, I004, I005, I006, I007, I008, I009
 
 
 @dataclass
-class ParseCmdPerfInfoPath(InfoLevel, pt.ParseCmdPerfInfoPath):
+class ParsePerfInfoPath(InfoLevel, pt.ParsePerfInfoPath):
     def code(self):
         return "I010"
 
diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py
--- a/core/dbt/parser/manifest.py
+++ b/core/dbt/parser/manifest.py
@@ -26,7 +26,7 @@
 from dbt.events.types import (
     PartialParsingErrorProcessingFile,
     PartialParsingError,
-    ParseCmdPerfInfoPath,
+    ParsePerfInfoPath,
     PartialParsingSkipParsing,
     UnableToPartialParse,
     PartialParsingNotEnabled,
@@ -989,7 +989,7 @@ def process_nodes(self):
     def write_perf_info(self, target_path: str):
         path = os.path.join(target_path, PERF_INFO_FILE_NAME)
         write_file(path, json.dumps(self._perf_info, cls=dbt.utils.JSONEncoder, indent=4))
-        fire_event(ParseCmdPerfInfoPath(path=path))
+        fire_event(ParsePerfInfoPath(path=path))
 
 
 def invalid_target_fail_unless_test(


Test patch:
diff --git a/tests/unit/test_events.py b/tests/unit/test_events.py
--- a/tests/unit/test_events.py
+++ b/tests/unit/test_events.py
@@ -14,6 +14,8 @@
     msg_from_base_event,
 )
 from dbt.events.functions import msg_to_dict, msg_to_json
+from dbt.flags import set_from_args
+from argparse import Namespace
 
 
 # takes in a class and finds any subclasses for it
@@ -170,8 +172,7 @@ def test_event_codes(self):
     types.HooksRunning(num_hooks=0, hook_type=""),
     types.FinishedRunningStats(stat_line="", execution="", execution_time=0),
     # I - Project parsing ======================
-    types.ParseCmdOut(msg="testing"),
-    types.ParseCmdPerfInfoPath(path=""),
+    types.ParsePerfInfoPath(path=""),
     types.GenericTestFileParse(path=""),
     types.MacroFileParse(path=""),
     types.PartialParsingErrorProcessingFile(file=""),
@@ -385,6 +386,7 @@ class TestEventJSONSerialization:
     # event types that take `Any` are not possible to test in this way since some will serialize
     # just fine and others won't.
     def test_all_serializable(self):
+        set_from_args(Namespace(WARN_ERROR=False), None)
         all_non_abstract_events = set(
             get_all_subclasses(BaseEvent),
         )