#4402 listBuilds allows empty pattern (not None)
Closed: Dropped by mikem. Opened by tkopecek.

It would make sense to raise an error on empty pattern (and verify also the other options)


Metadata Update from @jcupova:
- Custom field Size adjusted to None

Can someone remind me what prompted this concern?

People are calling it without any filter, thus call ends with OOM (and as they don't know the internals, it is a bit confusing). They would expect - this is a silly thing to do, place at least one filter in place.

People are calling it without any filter, thus call ends with OOM

Ah, I remember the context now.

A user was running a command like koji call listBuilds pattern="$DRAFT_BUILD_NVR" to find related drafts, but accidentally getting blank value for the pattern.

So, this is a bit of a strange case to optimize for. The listBuilds call allows broad queries. It will even let you query all builds in the system (which may even be reasonable on small instances). On a large instance with a typical memory limit, there are many, many ways one could make this query too large (e.g. pattern='g*', or just no options).

In the original discussion, I commented "it's probably reasonable for the api to require the pattern be nonempty". That said, this is an api change. I'm not so sure I was correct about this. A blank pattern is still a pattern. There could be cases where someone has a query with several parameters including a pattern that returns a reasonable number of entries, even if there is an edge case where the pattern is blank.

The list-builds cli command has protections against overbroad queries, but the api itself is intended for more expert use.

dropping this based on the above

Metadata Update from @mikem:
- Issue close_status updated to: Dropped
- Issue status updated to: Closed (was: Open)

/ msg sync

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/4402

Please continue any further discussion there.

Metadata
Related Pull Requests