Update several Repository methods to take keyword-only arguments.

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

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.

Summary ID
Update several Repository methods to take keyword-only arguments.
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.
b0e6db745724d5f680ca53a0b1423bc0540ee054
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (bd76244)