#2906 lib: return taskLabel for unknown tasks
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue2904  into  master

Download 2906.patch

"malformed task" has been returned for everything unknown, but external
plugins can create completely valid tasks which we can't parse without
those plugins. In such case we want to return at least method/arch info.

Related: https://pagure.io/koji/issue/2904

PR #2906

:thumbsup:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Metadata Update from @jobrauer:
- Pull-request tagged with: testing-done

Commit 99df7063 fixes this pull-request

Pull-Request has been merged by tkopecek

I was using watch_tasks() with a buildContainer task, and it previously showed malformed task.

This PR fixes it.

We've to think about better interfacing of lib and hub/builder plugins. Client lib (web + cli) is simply missing info about those plugins and displays stripped info, while it could have display more.

Is this likely the cause of https://pagure.io/releng/issue/10161 ?

Added comment there.

One thing that stood out to me about this taskLabel method:

def taskLabel(taskInfo):
    try:
        return _taskLabel(taskInfo)
    except Exception:
        return "malformed task"

Catching a bare Exception always stands out to me. It would be nice to narrow the exception we're catching there. It's kind of tricky to know what exception we hit, or what the problem was.

Metadata