ProjectResolver.getProjectId now takes no argument (MP-1749)

A ProjectResolver should be able to fetch the ProjectId without the need
of a cluster state. This PR changes the method to take no argument and
fixes cascading changes. It also adds a separate ProjectIdResolver
interface to host the new no-arg getProjectId method. The existing
ProjectResolver interface extends the new interface.

The major impact of the change is for tests and test helpers. It has
been made more obvious that most tests rely on the default project ID.
Previously this was hidden by the no arg `singleProjectOnly()` that just
pops the only project from cluster state. This only project is the
default project anyway in the current tests. The change just made this
fact explicit which I think is not a bad thing. We can definitely tidy
up the tests and test helpers once more pieces fall into places. Happy
to take suggestions.
This commit is contained in:
Yang Wang 2024-11-07 11:21:38 +11:00 committed by GitHub
parent 11d30e7f89
commit 8d376c89ce
32 changed files with 259 additions and 294 deletions

View file

@ -23,4 +23,9 @@ import java.lang.annotation.Target;
{ ElementType.LOCAL_VARIABLE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.MODULE }
)
public @interface FixForMultiProject {
/**
* Some explanation on what and why for the future fix
*/
String description() default "";
}