Packit-service: parsing comments w/o packit command ends with ValueError

Created on 9 Mar 2020  路  3Comments  路  Source: packit/packit-service

Sentry Issue: RED-HAT-0P-2AY

ValueError: not enough values to unpack (expected at least 1, got 0)
  File "packit_service/worker/tasks.py", line 42, in process_message
    return SteveJobs().process_message(event=event, topic=topic)
  File "packit_service/worker/jobs.py", line 281, in process_message
    jobs_results[job_type] = self.process_comment_jobs(event_object)
  File "packit_service/worker/jobs.py", line 167, in process_comment_jobs
    str(event.comment)
  File "packit_service/worker/jobs.py", line 143, in find_packit_command
    (packit_mark, *packit_command) = comment[cmd_start_index:].split(maxsplit=3)

This error means that there is no packit command in the comment, so we can ignore it.

GSOC bug good-first-issue

All 3 comments

Introduced with #433

How to reproduce:

REQUESTED_PULL_REQUEST_COMMENT = "/packit"
comment = "xyz "
cmd_start_index = comment.find(REQUESTED_PULL_REQUEST_COMMENT)  # -1
(packit_mark, *packit_command) = comment[cmd_start_index:].split(maxsplit=3)  # []
ValueError: not enough values to unpack (expected at least 1, got 0)

Will fix this tonight

@IceWreck thanks

Was this page helpful?
0 / 5 - 0 ratings