Update several Repository methods to take keyword-only arguments.

Review Request #14033 — Created July 12, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

We have a handful of methods on Repository that takes optional
arguments or options that control behavior, and these are allowed to be
passed as positional arguments. However, doing so makes some wrapping
functions a bit harder to deal with, as they may be dealing with subsets
of these arguments but need to take care to pass everything either as
positional or keyword arguments.

This has led to inconsistencies in unit tests as well, as we have many
spy functions that get parameter names wrong or make assumptions about
positional vs. keyword usage.

These methods have been updated to primarily take keyword-only
arguments. The two notable ones are get_file() and
get_file_exists(), which now require keyword arguments for everything.
As these methods have gotten more complex, and more combinations of
arguments are needed for file lookups (with deprecations planned for
base_commit_id), it's easiest just to ensure that these methods are
always called with explicit arguments going forward.

Positional arguments are still allowed until Review Board 9, but will
emit a deprecation warning.

All unit tests pass. No deprecation warnings were found.

Commits

Files