9797
9898@dataclass
9999class ParsedComment :
100- command : str
101- package : str
100+ command : Optional [ str ] = None
101+ package : Optional [ str ] = None
102102
103103
104104def parse_comment (
@@ -122,7 +122,7 @@ def parse_comment(
122122 """
123123 commands = get_packit_commands_from_comment (comment , packit_comment_command_prefix )
124124 if not commands :
125- return None
125+ return ParsedComment ()
126126
127127 if comment .startswith ("/packit-ci" ):
128128 parser = get_pr_comment_parser_fedora_ci (
@@ -143,7 +143,7 @@ def parse_comment(
143143 except SystemExit :
144144 # tests expect invalid syntax comments be ignored
145145 logger .debug (f"Command { commands } uses unexpected syntax." )
146- return None
146+ return ParsedComment ()
147147
148148
149149def get_handlers_for_command (
@@ -555,7 +555,7 @@ def is_packit_config_present(self) -> bool:
555555 self .event .comment ,
556556 self .service_config .comment_command_prefix ,
557557 )
558- command = arguments .command if arguments else ""
558+ command = arguments .command
559559
560560 if handlers := get_handlers_for_command (command ):
561561 # we require packit config file when event is triggered by /packit command
@@ -599,8 +599,8 @@ def process_fedora_ci_jobs(self) -> list[TaskResults]:
599599 )
600600
601601 # [XXX] if there are ever monorepos in Fedora CI…
602- # monorepo_package = arguments.package if arguments else ""
603- command = arguments .command if arguments else ""
602+ # monorepo_package = arguments.package
603+ command = arguments .command
604604 handlers_triggered_by_job = get_handlers_for_command_fedora_ci (command )
605605
606606 matching_handlers = {
@@ -674,8 +674,8 @@ def process_jobs(self) -> list[TaskResults]:
674674 self .service_config .comment_command_prefix ,
675675 )
676676
677- monorepo_package = arguments .package if arguments else ""
678- command = arguments .command if arguments else ""
677+ monorepo_package = arguments .package
678+ command = arguments .command
679679
680680 if not get_handlers_for_command (command ):
681681 return [
@@ -1018,7 +1018,7 @@ def get_handlers_for_comment_and_rerun_event(self) -> set[type[JobHandler]]:
10181018 self .service_config .comment_command_prefix ,
10191019 )
10201020
1021- command = arguments .command if arguments else ""
1021+ command = arguments .command
10221022 handlers_triggered_by_job = get_handlers_for_command (command )
10231023
10241024 if handlers_triggered_by_job and not isinstance (
0 commit comments