Search in sources :

Example 1 with Glob

use of com.google.copybara.util.Glob in project copybara by google.

the class GitHubPrDestination method newWriter.

@Override
public Writer<GitRevision> newWriter(WriterContext writerContext) throws ValidationException {
    String prBranch = getPullRequestBranchName(writerContext.getOriginalRevision(), writerContext.getWorkflowName(), writerContext.getWorkflowIdentityUser());
    GitHubPrWriteHook gitHubPrWriteHook = writeHook.withUpdatedPrBranch(prBranch);
    GitHubWriterState state = new GitHubWriterState(localRepo, destinationOptions.localRepoPath != null ? prBranch : "copybara/push-" + UUID.randomUUID() + (writerContext.isDryRun() ? "-dryrun" : ""));
    return new WriterImpl<GitHubWriterState>(writerContext.isDryRun(), url, getDestinationRef(), prBranch, partialFetch, /*tagName*/
    null, /*tagMsg*/
    null, generalOptions, gitHubPrWriteHook, state, /*nonFastForwardPush=*/
    true, integrates, destinationOptions.lastRevFirstParent, destinationOptions.ignoreIntegrationErrors, destinationOptions.localRepoPath, destinationOptions.committerName, destinationOptions.committerEmail, destinationOptions.rebaseWhenBaseline(), gitOptions.visitChangePageSize, gitOptions.gitTagOverwrite, checker) {

        @Override
        public ImmutableList<DestinationEffect> write(TransformResult transformResult, Glob destinationFiles, Console console) throws ValidationException, RepoException, IOException {
            ImmutableList.Builder<DestinationEffect> result = ImmutableList.<DestinationEffect>builder().addAll(super.write(transformResult, destinationFiles, console));
            if (writerContext.isDryRun() || state.pullRequestNumber != null) {
                return result.build();
            }
            if (!gitHubDestinationOptions.createPullRequest) {
                console.infoFmt("Please create a PR manually following this link: %s/compare/%s...%s" + " (Only needed once)", asHttpsUrl(), getDestinationRef(), prBranch);
                state.pullRequestNumber = -1L;
                return result.build();
            }
            GitHubApi api = gitHubOptions.newGitHubApi(getProjectName());
            ImmutableList<PullRequest> pullRequests = api.getPullRequests(getProjectName(), PullRequestListParams.DEFAULT.withHead(String.format("%s:%s", ghHost.getUserNameFromUrl(url), prBranch)));
            ChangeMessage msg = ChangeMessage.parseMessage(transformResult.getSummary().trim());
            String title = GitHubPrDestination.this.title == null ? msg.firstLine() : SkylarkUtil.mapLabels(transformResult.getLabelFinder(), GitHubPrDestination.this.title, "title");
            String prBody = GitHubPrDestination.this.body == null ? msg.toString() : SkylarkUtil.mapLabels(transformResult.getLabelFinder(), GitHubPrDestination.this.body, "body");
            for (PullRequest pr : pullRequests) {
                if (pr.getHead().getRef().equals(prBranch)) {
                    if (!pr.isOpen()) {
                        console.warnFmt("Pull request for branch %s already exists as %s/pull/%s, but is closed - " + "reopening.", prBranch, asHttpsUrl(), pr.getNumber());
                        api.updatePullRequest(getProjectName(), pr.getNumber(), new UpdatePullRequest(null, null, OPEN));
                    } else {
                        console.infoFmt("Pull request for branch %s already exists as %s/pull/%s", prBranch, asHttpsUrl(), pr.getNumber());
                    }
                    if (!pr.getBase().getRef().equals(getDestinationRef())) {
                        // TODO(malcon): Update PR or create a new one?
                        console.warnFmt("Current base branch '%s' is different from the PR base branch '%s'", getDestinationRef(), pr.getBase().getRef());
                    }
                    if (updateDescription) {
                        checkCondition(!Strings.isNullOrEmpty(title), "Pull Request title cannot be empty. Either use 'title' field in" + " git.github_pr_destination or modify the message to not be empty");
                        api.updatePullRequest(getProjectName(), pr.getNumber(), new UpdatePullRequest(title, prBody, /*state=*/
                        null));
                    }
                    result.add(new DestinationEffect(DestinationEffect.Type.UPDATED, String.format("Pull Request %s updated", pr.getHtmlUrl()), transformResult.getChanges().getCurrent(), new DestinationEffect.DestinationRef(Long.toString(pr.getNumber()), "pull_request", pr.getHtmlUrl())));
                    return result.build();
                }
            }
            checkCondition(!Strings.isNullOrEmpty(title), "Pull Request title cannot be empty. Either use 'title' field in" + " git.github_pr_destination or modify the message to not be empty");
            PullRequest pr = api.createPullRequest(getProjectName(), new CreatePullRequest(title, prBody, prBranch, getDestinationRef()));
            console.infoFmt("Pull Request %s/pull/%s created using branch '%s'.", asHttpsUrl(), pr.getNumber(), prBranch);
            state.pullRequestNumber = pr.getNumber();
            result.add(new DestinationEffect(DestinationEffect.Type.CREATED, String.format("Pull Request %s created", pr.getHtmlUrl()), transformResult.getChanges().getCurrent(), new DestinationEffect.DestinationRef(Long.toString(pr.getNumber()), "pull_request", pr.getHtmlUrl())));
            return result.build();
        }

        @Override
        public Endpoint getFeedbackEndPoint(Console console) throws ValidationException {
            gitHubOptions.validateEndpointChecker(endpointChecker);
            return new GitHubEndPoint(gitHubOptions.newGitHubApiSupplier(url, endpointChecker, ghHost), url, console, ghHost);
        }
    };
}
Also used : TransformResult(com.google.copybara.TransformResult) ImmutableList(com.google.common.collect.ImmutableList) CreatePullRequest(com.google.copybara.git.github.api.CreatePullRequest) UpdatePullRequest(com.google.copybara.git.github.api.UpdatePullRequest) PullRequest(com.google.copybara.git.github.api.PullRequest) CreatePullRequest(com.google.copybara.git.github.api.CreatePullRequest) WriterImpl(com.google.copybara.git.GitDestination.WriterImpl) GitHubApi(com.google.copybara.git.github.api.GitHubApi) DestinationEffect(com.google.copybara.DestinationEffect) Console(com.google.copybara.util.console.Console) ChangeMessage(com.google.copybara.ChangeMessage) UpdatePullRequest(com.google.copybara.git.github.api.UpdatePullRequest) Glob(com.google.copybara.util.Glob)

Example 2 with Glob

use of com.google.copybara.util.Glob in project copybara by google.

the class GitHubPrOrigin method newReader.

@Override
public Reader<GitRevision> newReader(Glob originFiles, Authoring authoring) throws ValidationException {
    return new ReaderImpl(url, originFiles, authoring, gitOptions, gitOriginOptions, generalOptions, /*includeBranchCommitLogs=*/
    false, submoduleStrategy, firstParent, partialFetch, patchTransformation, describeVersion, /*configPath=*/
    null, /*workflowName=*/
    null) {

        /**
         * Disable rebase since this is controlled by useMerge field.
         */
        @Override
        protected void maybeRebase(GitRepository repo, GitRevision ref, Path workdir) throws RepoException, CannotResolveRevisionException {
        }

        @Override
        public Optional<Baseline<GitRevision>> findBaseline(GitRevision startRevision, String label) throws RepoException, ValidationException {
            if (!baselineFromBranch) {
                return super.findBaseline(startRevision, label);
            }
            return findBaselinesWithoutLabel(startRevision, /*limit=*/
            1).stream().map(e -> new Baseline<>(e.getSha1(), e)).findFirst();
        }

        @Override
        public ImmutableList<GitRevision> findBaselinesWithoutLabel(GitRevision startRevision, int limit) throws RepoException, ValidationException {
            String baseline = Iterables.getLast(startRevision.associatedLabels().get(GITHUB_BASE_BRANCH_SHA1), null);
            checkNotNull(baseline, "%s label should be present in %s", GITHUB_BASE_BRANCH_SHA1, startRevision);
            GitRevision baselineRev = getRepository().resolveReference(baseline);
            // Don't skip the first change as it is already the baseline
            BaselinesWithoutLabelVisitor<GitRevision> visitor = new BaselinesWithoutLabelVisitor<>(originFiles, limit, /*skipFirst=*/
            false);
            visitChanges(baselineRev, visitor);
            return visitor.getResult();
        }

        @Override
        public Endpoint getFeedbackEndPoint(Console console) throws ValidationException {
            gitHubOptions.validateEndpointChecker(endpointChecker);
            return new GitHubEndPoint(gitHubOptions.newGitHubApiSupplier(url, endpointChecker, ghHost), url, console, ghHost);
        }

        /**
         * Deal with the case of useMerge. We have a new commit (the merge) and first-parent from that
         * commit doesn't work for this case.
         */
        @Override
        public ChangesResponse<GitRevision> changes(@Nullable GitRevision fromRef, GitRevision toRef) throws RepoException, ValidationException {
            checkCondition(toRef.associatedLabels().containsKey(GITHUB_PR_USE_MERGE), "Cannot determine whether 'use_merge' was set.");
            if (toRef.associatedLabel(GITHUB_PR_USE_MERGE).contains("false")) {
                return super.changes(fromRef, toRef);
            }
            GitLogEntry merge = Iterables.getOnlyElement(getRepository().log(toRef.getSha1()).withLimit(1).run());
            // Fast-forward merge
            if (merge.getParents().size() == 1) {
                return super.changes(fromRef, toRef);
            }
            // HEAD of the Pull Request
            GitRevision gitRevision = merge.getParents().get(1);
            ChangesResponse<GitRevision> prChanges = super.changes(fromRef, gitRevision);
            // origin_files
            if (prChanges.isEmpty()) {
                return prChanges;
            }
            try {
                return ChangesResponse.forChanges(ImmutableList.<Change<GitRevision>>builder().addAll(prChanges.getChanges()).add(change(merge.getCommit())).build());
            } catch (EmptyChangeException e) {
                throw new RepoException("Error getting the merge commit information: " + merge, e);
            }
        }
    };
}
Also used : Path(java.nio.file.Path) GitHubUtil.asHeadRef(com.google.copybara.git.github.util.GitHubUtil.asHeadRef) Origin(com.google.copybara.Origin) CombinedStatus(com.google.copybara.git.github.api.CombinedStatus) Collections2(com.google.common.collect.Collections2) Review(com.google.copybara.git.github.api.Review) ImmutableListMultimap.toImmutableListMultimap(com.google.common.collect.ImmutableListMultimap.toImmutableListMultimap) Matcher(java.util.regex.Matcher) Change(com.google.copybara.Change) BaselinesWithoutLabelVisitor(com.google.copybara.BaselinesWithoutLabelVisitor) CannotResolveRevisionException(com.google.copybara.exception.CannotResolveRevisionException) Endpoint(com.google.copybara.Endpoint) Splitter(com.google.common.base.Splitter) GeneralOptions(com.google.copybara.GeneralOptions) Path(java.nio.file.Path) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) User(com.google.copybara.git.github.api.User) ProfilerTask(com.google.copybara.profiler.Profiler.ProfilerTask) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) Collectors(java.util.stream.Collectors) Collectors.joining(java.util.stream.Collectors.joining) Sets(com.google.common.collect.Sets) Objects(java.util.Objects) List(java.util.List) GitHubApi(com.google.copybara.git.github.api.GitHubApi) PullRequest(com.google.copybara.git.github.api.PullRequest) GitHubUtil.asMergeRef(com.google.copybara.git.github.util.GitHubUtil.asMergeRef) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) AutoValue(com.google.auto.value.AutoValue) Optional(java.util.Optional) Joiner(com.google.common.base.Joiner) AuthorAssociation(com.google.copybara.git.github.api.AuthorAssociation) Iterables(com.google.common.collect.Iterables) CheckRuns(com.google.copybara.git.github.api.CheckRuns) ValidationException.checkCondition(com.google.copybara.exception.ValidationException.checkCondition) RepoException(com.google.copybara.exception.RepoException) SubmoduleStrategy(com.google.copybara.git.GitOrigin.SubmoduleStrategy) HashSet(java.util.HashSet) GitHubUtil(com.google.copybara.git.github.util.GitHubUtil) Label(com.google.copybara.git.github.api.Label) State(com.google.copybara.git.github.api.Status.State) ImmutableList(com.google.common.collect.ImmutableList) Issue(com.google.copybara.git.github.api.Issue) Nullable(javax.annotation.Nullable) GitLogEntry(com.google.copybara.git.GitRepository.GitLogEntry) Uninterruptibles(com.google.common.util.concurrent.Uninterruptibles) EmptyChangeException(com.google.copybara.exception.EmptyChangeException) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) CharMatcher(com.google.common.base.CharMatcher) ValidationException(com.google.copybara.exception.ValidationException) ReaderImpl(com.google.copybara.git.GitOrigin.ReaderImpl) PatchTransformation(com.google.copybara.transform.patch.PatchTransformation) Console(com.google.copybara.util.console.Console) TimeUnit(java.util.concurrent.TimeUnit) Authoring(com.google.copybara.authoring.Authoring) Checker(com.google.copybara.checks.Checker) Glob(com.google.copybara.util.Glob) CheckRun(com.google.copybara.git.github.api.CheckRun) Preconditions(com.google.common.base.Preconditions) Status(com.google.copybara.git.github.api.Status) GitHubHost(com.google.copybara.git.github.util.GitHubHost) GitHubPrUrl(com.google.copybara.git.github.util.GitHubHost.GitHubPrUrl) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) ReaderImpl(com.google.copybara.git.GitOrigin.ReaderImpl) Change(com.google.copybara.Change) RepoException(com.google.copybara.exception.RepoException) Console(com.google.copybara.util.console.Console) BaselinesWithoutLabelVisitor(com.google.copybara.BaselinesWithoutLabelVisitor) EmptyChangeException(com.google.copybara.exception.EmptyChangeException) Nullable(javax.annotation.Nullable) GitLogEntry(com.google.copybara.git.GitRepository.GitLogEntry)

Example 3 with Glob

use of com.google.copybara.util.Glob in project copybara by google.

the class WorkflowTest method testOnFinishHook_temporaryError.

// Validates that the hook is executed when the workflow throws an exception != VE, and that
// the correct effect is populated
@Test
public void testOnFinishHook_temporaryError() throws Exception {
    options.testingOptions.destination = new RecordsProcessCallDestination() {

        @Override
        public Writer<Revision> newWriter(WriterContext writerContext) {
            return new RecordsProcessCallDestination.WriterImpl(false) {

                @Override
                public ImmutableList<DestinationEffect> write(TransformResult transformResult, Glob destinationFiles, Console console) throws RepoException {
                    throw new RepoException("Repo exception!");
                }
            };
        }
    };
    verifyHookForException(RepoException.class, Type.TEMPORARY_ERROR, "Repo exception!");
}
Also used : RecordsProcessCallDestination(com.google.copybara.testing.RecordsProcessCallDestination) ImmutableList(com.google.common.collect.ImmutableList) TestingConsole(com.google.copybara.util.console.testing.TestingConsole) Console(com.google.copybara.util.console.Console) Glob(com.google.copybara.util.Glob) RepoException(com.google.copybara.exception.RepoException) Test(org.junit.Test)

Example 4 with Glob

use of com.google.copybara.util.Glob in project copybara by google.

the class GerritDestinationTest method gerritSubmit_noChange.

@Test
public void gerritSubmit_noChange() throws Exception {
    options.gerrit.gerritChangeId = null;
    fetch = "master";
    writeFile(workdir, "file", "some content");
    url = BASE_URL + "/foo/bar";
    repoGitDir = gitUtil.mockRemoteRepo("user:SECRET@copybara-not-real.com/foo/bar").getGitDir();
    gitUtil.mockApi(eq("GET"), startsWith(BASE_URL + "/changes/"), mockResponse("[]"));
    AtomicBoolean submitCalled = new AtomicBoolean(false);
    AtomicBoolean reviewCalled = new AtomicBoolean(false);
    gitUtil.mockApi(eq("POST"), matches(BASE_URL + "/changes/.*/revisions/.*/review"), mockResponseWithStatus("", 204, new MockRequestAssertion("Always true with side-effect", s -> {
        reviewCalled.set(true);
        return true;
    })));
    gitUtil.mockApi(eq("POST"), matches(BASE_URL + "/changes/.*/submit"), mockResponseWithStatus("", 204, new MockRequestAssertion("Always true with side-effect", s -> {
        submitCalled.set(true);
        return true;
    })));
    options.setForce(true);
    DummyRevision originRef = new DummyRevision("origin_ref");
    GerritDestination destination = destination("submit = True", "gerrit_submit = True");
    Glob glob = Glob.createGlob(ImmutableList.of("**"), excludedDestinationPaths);
    WriterContext writerContext = new WriterContext("GerritDestinationTest", "test", false, originRef, Glob.ALL_FILES.roots());
    List<DestinationEffect> result = destination.newWriter(writerContext).write(TransformResults.of(workdir, originRef).withSummary("Test message").withIdentity(originRef.asString()), glob, console);
    assertThat(result).hasSize(1);
    assertThat(result.get(0).getErrors()).isEmpty();
    assertThat(submitCalled.get()).isFalse();
    assertThat(reviewCalled.get()).isFalse();
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) WriterContext(com.google.copybara.WriterContext) MockRequestAssertion(com.google.copybara.testing.git.GitTestUtil.MockRequestAssertion) DestinationEffect(com.google.copybara.DestinationEffect) DummyRevision(com.google.copybara.testing.DummyRevision) Glob(com.google.copybara.util.Glob) Test(org.junit.Test)

Example 5 with Glob

use of com.google.copybara.util.Glob in project copybara by google.

the class GerritDestinationTest method testReviewerFieldWithLabel.

@Test
public void testReviewerFieldWithLabel() throws Exception {
    pushToRefsFor = "master%label=Foo";
    writeFile(workdir, "file", "some content");
    fetch = "master";
    options.setForce(true);
    url = "https://localhost:33333/foo/bar";
    mockNoChangesFound();
    DummyRevision originRef = new DummyRevision("origin_ref");
    GerritDestination destination = destination("submit = False", "reviewers = [\"${SOME_REVIEWER}\"]");
    Glob glob = Glob.createGlob(ImmutableList.of("**"), excludedDestinationPaths);
    WriterContext writerContext = new WriterContext("GerritDestination", "TEST", false, new DummyRevision("test"), Glob.ALL_FILES.roots());
    List<DestinationEffect> result = destination.newWriter(writerContext).write(TransformResults.of(workdir, originRef).withSummary("Test message").withIdentity(originRef.asString()).withLabelFinder(e -> e.equals("SOME_REVIEWER") ? ImmutableList.of("foo@example.com") : ImmutableList.of()), glob, console);
    assertThat(result).hasSize(1);
    assertThat(result.get(0).getErrors()).isEmpty();
    assertPushRef("refs/for/master%label=Foo,hashtag=copybara_id_origin_ref_commiter@email," + "r=foo@example.com");
}
Also used : GitTestUtil(com.google.copybara.testing.git.GitTestUtil) LowLevelHttpRequest(com.google.api.client.http.LowLevelHttpRequest) Validator(com.google.copybara.testing.git.GitTestUtil.Validator) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ZonedDateTime(java.time.ZonedDateTime) DestinationEffect(com.google.copybara.DestinationEffect) WriterContext(com.google.copybara.WriterContext) TransformWork(com.google.copybara.TransformWork) Author(com.google.copybara.authoring.Author) GitTestUtil.getGitEnv(com.google.copybara.testing.git.GitTestUtil.getGitEnv) ChangeIdPolicy(com.google.copybara.git.GerritDestination.ChangeIdPolicy) GitTesting(com.google.copybara.git.testing.GitTesting) Path(java.nio.file.Path) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) DEFAULT_TIMEOUT(com.google.copybara.util.CommandRunner.DEFAULT_TIMEOUT) Type(com.google.copybara.DestinationEffect.Type) ImmutableSet(com.google.common.collect.ImmutableSet) ArgumentMatchers.startsWith(org.mockito.ArgumentMatchers.startsWith) DummyEndpoint(com.google.copybara.testing.DummyEndpoint) SkylarkTestExecutor(com.google.copybara.testing.SkylarkTestExecutor) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) FileSubjects.assertThatPath(com.google.copybara.testing.FileSubjects.assertThatPath) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) ZoneId(java.time.ZoneId) ALWAYS_TRUE(com.google.copybara.testing.git.GitTestUtil.ALWAYS_TRUE) CheckerException(com.google.copybara.checks.CheckerException) List(java.util.List) GitTestUtil.mockResponseAndValidateRequest(com.google.copybara.testing.git.GitTestUtil.mockResponseAndValidateRequest) ArgumentMatchers.matches(org.mockito.ArgumentMatchers.matches) LabelFinder(com.google.copybara.LabelFinder) GitRepository.newBareRepo(com.google.copybara.git.GitRepository.newBareRepo) RedundantChangeException(com.google.copybara.exception.RedundantChangeException) Pattern(java.util.regex.Pattern) GitTestUtil.mockResponse(com.google.copybara.testing.git.GitTestUtil.mockResponse) Joiner(com.google.common.base.Joiner) Writer(com.google.copybara.Destination.Writer) Iterables(com.google.common.collect.Iterables) DummyRevision(com.google.copybara.testing.DummyRevision) GitTestUtil.mockResponseWithStatus(com.google.copybara.testing.git.GitTestUtil.mockResponseWithStatus) Assert.assertThrows(org.junit.Assert.assertThrows) DummyOrigin(com.google.copybara.testing.DummyOrigin) RunWith(org.junit.runner.RunWith) RepoException(com.google.copybara.exception.RepoException) OptionsBuilder(com.google.copybara.testing.OptionsBuilder) MockRequestAssertion(com.google.copybara.testing.git.GitTestUtil.MockRequestAssertion) MessageType(com.google.copybara.util.console.Message.MessageType) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Hashing(com.google.common.hash.Hashing) Changes(com.google.copybara.Changes) ChangeMessage(com.google.copybara.ChangeMessage) Strings(com.google.common.base.Strings) Answer(org.mockito.stubbing.Answer) ImmutableList(com.google.common.collect.ImmutableList) Metadata(com.google.copybara.Metadata) TransformResults(com.google.copybara.testing.TransformResults) GerritApiException(com.google.copybara.git.gerritapi.GerritApiException) MigrationInfo(com.google.copybara.MigrationInfo) PathSubject(com.google.copybara.testing.FileSubjects.PathSubject) Before(org.junit.Before) GitLogEntry(com.google.copybara.git.GitRepository.GitLogEntry) TestingConsole(com.google.copybara.util.console.testing.TestingConsole) Files(java.nio.file.Files) UTF_8(java.nio.charset.StandardCharsets.UTF_8) DummyChecker(com.google.copybara.testing.DummyChecker) ValidationException(com.google.copybara.exception.ValidationException) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) GerritWriteHook(com.google.copybara.git.GerritDestination.GerritWriteHook) Glob(com.google.copybara.util.Glob) Message(com.google.copybara.util.console.Message) GitTestUtil.writeFile(com.google.copybara.testing.git.GitTestUtil.writeFile) GerritMessageInfo(com.google.copybara.git.GerritDestination.GerritMessageInfo) WriterContext(com.google.copybara.WriterContext) DestinationEffect(com.google.copybara.DestinationEffect) DummyRevision(com.google.copybara.testing.DummyRevision) Glob(com.google.copybara.util.Glob) Test(org.junit.Test)

Aggregations

Glob (com.google.copybara.util.Glob)24 Test (org.junit.Test)20 DummyRevision (com.google.copybara.testing.DummyRevision)17 WriterContext (com.google.copybara.WriterContext)15 ImmutableList (com.google.common.collect.ImmutableList)12 DestinationEffect (com.google.copybara.DestinationEffect)12 ValidationException (com.google.copybara.exception.ValidationException)11 RepoException (com.google.copybara.exception.RepoException)10 MockRequestAssertion (com.google.copybara.testing.git.GitTestUtil.MockRequestAssertion)10 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)10 TestingConsole (com.google.copybara.util.console.testing.TestingConsole)9 ImmutableSetMultimap (com.google.common.collect.ImmutableSetMultimap)8 Iterables (com.google.common.collect.Iterables)8 GitLogEntry (com.google.copybara.git.GitRepository.GitLogEntry)8 Path (java.nio.file.Path)8 Joiner (com.google.common.base.Joiner)7 ImmutableSet (com.google.common.collect.ImmutableSet)7 ChangeMessage (com.google.copybara.ChangeMessage)7 CheckerException (com.google.copybara.checks.CheckerException)7 LowLevelHttpRequest (com.google.api.client.http.LowLevelHttpRequest)6