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) {
}
}
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();
}
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);
}
}
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);
}
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();
}
Aggregations