Search in sources :

Example 1 with FirestoreProtoClient

use of com.google.startupos.common.firestore.FirestoreProtoClient in project startup-os by google.

the class FirestoreClientTool method run.

void run() {
    authService.refreshToken();
    client = new FirestoreProtoClient(authService.getProjectId(), authService.getToken());
    Executors.newSingleThreadExecutor().execute(() -> testFunctionality());
    try {
        Thread.sleep(100000000);
    } catch (Exception ignored) {
    }
}
Also used : FirestoreProtoClient(com.google.startupos.common.firestore.FirestoreProtoClient) IOException(java.io.IOException)

Example 2 with FirestoreProtoClient

use of com.google.startupos.common.firestore.FirestoreProtoClient in project startup-os by google.

the class ReviewerJob method main.

public static void main(String[] args) throws Exception {
    Flags.parse(args, ReviewerJob.class.getPackage(), ReviewerMetadataUpdaterTask.class.getPackage(), InitCommand.class.getPackage(), LocalServer.class.getPackage(), CodeReviewService.class.getPackage());
    FirestoreProtoClient client = new FirestoreProtoClient(serviceAccountJson.get());
    DaggerReviewerJob_JobComponent.builder().setFirestoreProtoClient(client).build().getJob().run();
}
Also used : LocalServer(com.google.startupos.tools.reviewer.local_server.LocalServer) InitCommand(com.google.startupos.tools.reviewer.aa.commands.InitCommand) ReviewerMetadataUpdaterTask(com.google.startupos.tools.reviewer.job.tasks.ReviewerMetadataUpdaterTask) CodeReviewService(com.google.startupos.tools.reviewer.local_server.service.CodeReviewService) FirestoreProtoClient(com.google.startupos.common.firestore.FirestoreProtoClient)

Example 3 with FirestoreProtoClient

use of com.google.startupos.common.firestore.FirestoreProtoClient in project startup-os by google.

the class ReviewerMetadataUpdaterTaskTool method main.

public static void main(String[] args) {
    Flags.parseCurrentPackage(args);
    System.out.println(serviceAccountJson.get());
    FirestoreProtoClient client = new FirestoreProtoClient(serviceAccountJson.get());
    ReviewerMetadataUpdaterTask reviewerMetadataUpdaterTask = DaggerReviewerMetadataUpdaterTaskTool_ReviewerMetadataUpdaterTaskToolComponent.builder().setFirestoreProtoClient(client).build().getReviewerMetadataUpdaterTask();
    try {
        ReviewerConfig startupOsReviewerConfig = reviewerMetadataUpdaterTask.getRemoteReviewerConfig(reviewerMetadataUpdaterTask.getRemoteStartupOsReviewerConfigPath());
        ReviewerConfig hasadnaReviewerConfig = reviewerMetadataUpdaterTask.getRemoteReviewerConfig(reviewerMetadataUpdaterTask.getRemoteHasadnaReviewerConfigPath());
        ReviewerConfig mergedReviewerConfig = reviewerMetadataUpdaterTask.mergeReviewerConfigData(startupOsReviewerConfig, hasadnaReviewerConfig);
        System.out.println("Merged ReviewerConfig:\n" + mergedReviewerConfig.toString());
    } catch (IOException e) {
        System.out.println(e);
    }
}
Also used : ReviewerConfig(com.google.startupos.tools.reviewer.ReviewerProtos.ReviewerConfig) IOException(java.io.IOException) FirestoreProtoClient(com.google.startupos.common.firestore.FirestoreProtoClient)

Example 4 with FirestoreProtoClient

use of com.google.startupos.common.firestore.FirestoreProtoClient in project startup-os by google.

the class SubmitterTaskTool method run.

void run() {
    client = new FirestoreProtoClient(authService.getProjectId(), authService.getToken());
    int id = 1234;
    client.setProtoDocument(ReviewerConstants.DIFF_COLLECTION + "/" + id, Diff.newBuilder().setId(id).setStatus(Diff.Status.SUBMITTING).addCiResponse(CiResponse.newBuilder().addResult(TargetResult.newBuilder().setStatus(TargetResult.Status.SUCCESS).build()).build()).build());
    System.exit(0);
}
Also used : FirestoreProtoClient(com.google.startupos.common.firestore.FirestoreProtoClient)

Example 5 with FirestoreProtoClient

use of com.google.startupos.common.firestore.FirestoreProtoClient in project startup-os by google.

the class CodeReviewService method createDiff.

@Override
public void createDiff(CreateDiffRequest req, StreamObserver<Empty> responseObserver) {
    checkAuth();
    FirestoreProtoClient client = new FirestoreProtoClient(authService.getProjectId(), authService.getToken());
    String diffPath = fileUtils.joinToAbsolutePath(ReviewerConstants.DIFF_COLLECTION);
    Diff diff = req.getDiff().toBuilder().setAuthor(Author.newBuilder().setEmail(authService.getUserEmail()).build()).build();
    client.setProtoDocument(diffPath, String.valueOf(diff.getId()), diff);
    responseObserver.onNext(Empty.getDefaultInstance());
    responseObserver.onCompleted();
}
Also used : Diff(com.google.startupos.tools.reviewer.local_server.service.Protos.Diff) TextDiff(com.google.startupos.common.Protos.TextDiff) FirestoreProtoClient(com.google.startupos.common.firestore.FirestoreProtoClient)

Aggregations

FirestoreProtoClient (com.google.startupos.common.firestore.FirestoreProtoClient)8 IOException (java.io.IOException)3 TextDiff (com.google.startupos.common.Protos.TextDiff)2 Diff (com.google.startupos.tools.reviewer.local_server.service.Protos.Diff)2 ReviewerConfig (com.google.startupos.tools.reviewer.ReviewerProtos.ReviewerConfig)1 InitCommand (com.google.startupos.tools.reviewer.aa.commands.InitCommand)1 ReviewerMetadataUpdaterTask (com.google.startupos.tools.reviewer.job.tasks.ReviewerMetadataUpdaterTask)1 LocalServer (com.google.startupos.tools.reviewer.local_server.LocalServer)1 CodeReviewService (com.google.startupos.tools.reviewer.local_server.service.CodeReviewService)1 DiffNumberResponse (com.google.startupos.tools.reviewer.local_server.service.Protos.DiffNumberResponse)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1