feat: support multiple remotes
This MR extends on !356 (merged) and !358 (merged) and migrates all extension commands to the new way of invoking them. This new way consists of a method called runWithValidProject
which wraps around each command. This method ensures that there is a repository with GitLab project and only then invokes the command. This reduces the need for each command to validate that there is a valid repository.
Each such command now implements the ProjectCommand
interface:
export type GitLabRepository = Omit<WrappedRepository, 'getProject'> & {
remote: GitRemote;
getProject: () => Promise<GitLabProject>;
};
type ProjectCommand = (gitlabRepository: GitLabRepository) => Promise<void>;
There is no change from the user perspective except for the scenario when the repository contains multiple remotes. In that case, we'll let the user decide which remote to use (see !356 (merged)).
This MR removes the Open current pipeline
command which has been broken for months and there are good alternatives for the users.
Related to #459 (closed)