├── third_party ├── BUILD └── maven │ ├── BUILD │ ├── org │ ├── json │ │ └── BUILD │ ├── jsoup │ │ └── BUILD │ ├── yaml │ │ └── BUILD │ ├── javassist │ │ └── BUILD │ ├── objenesis │ │ └── BUILD │ ├── threeten │ │ └── BUILD │ ├── antlr │ │ └── BUILD │ ├── hamcrest │ │ └── BUILD │ ├── codehaus │ │ └── mojo │ │ │ └── BUILD │ ├── mockito │ │ └── BUILD │ ├── apache │ │ ├── commons │ │ │ └── BUILD │ │ ├── ant │ │ │ └── BUILD │ │ ├── pdfbox │ │ │ └── BUILD │ │ └── httpcomponents │ │ │ └── BUILD │ ├── slf4j │ │ └── BUILD │ └── checkerframework │ │ └── BUILD │ ├── com │ ├── jcraft │ │ └── BUILD │ ├── squareup │ │ ├── okio │ │ │ └── BUILD │ │ ├── BUILD │ │ └── okhttp │ │ │ └── BUILD │ ├── google │ │ ├── code │ │ │ ├── gson │ │ │ │ └── BUILD │ │ │ └── findbugs │ │ │ │ └── BUILD │ │ ├── re2j │ │ │ └── BUILD │ │ ├── j2objc │ │ │ └── BUILD │ │ ├── jimfs │ │ │ └── BUILD │ │ ├── auto │ │ │ ├── BUILD │ │ │ ├── factory │ │ │ │ └── BUILD │ │ │ ├── service │ │ │ │ └── BUILD │ │ │ └── value │ │ │ │ └── BUILD │ │ ├── apis │ │ │ └── BUILD │ │ ├── googlejavaformat │ │ │ └── BUILD │ │ ├── oauth_client │ │ │ └── BUILD │ │ ├── protobuf │ │ │ └── BUILD │ │ ├── flogger │ │ │ └── BUILD │ │ ├── auth │ │ │ └── BUILD │ │ ├── errorprone │ │ │ └── BUILD │ │ ├── api_client │ │ │ └── BUILD │ │ └── firebase │ │ │ └── BUILD │ ├── fasterxml │ │ └── jackson │ │ │ └── core │ │ │ └── BUILD │ └── puppycrawl │ │ └── tools │ │ └── BUILD │ ├── antlr │ └── BUILD │ ├── javax │ ├── inject │ │ └── BUILD │ └── annotation │ │ └── BUILD │ ├── info │ └── picocli │ │ └── BUILD │ ├── commons_logging │ └── BUILD │ ├── net │ ├── sf │ │ └── saxon │ │ │ └── BUILD │ └── bytebuddy │ │ └── BUILD │ ├── commons_codec │ └── BUILD │ ├── commons_collections │ └── BUILD │ ├── junit │ └── BUILD │ └── commons_beanutils │ └── BUILD ├── .bazelversion ├── reviewer-ci.sh ├── tools ├── protoc │ ├── .gitignore │ ├── package.json │ └── README.md ├── workspacerun │ ├── .gitignore │ ├── apps.json │ ├── package.json │ └── README.md ├── reviewer │ ├── local_server │ │ ├── web_login │ │ │ ├── .gitignore │ │ │ ├── .firebaserc │ │ │ ├── README.md │ │ │ └── firebase.json │ │ └── service │ │ │ ├── tests │ │ │ ├── get_diff_request.json │ │ │ ├── get_diff_files_request.json │ │ │ └── get_text_diff_request.json │ │ │ └── auth_service.proto │ ├── webapp │ │ ├── functions │ │ │ ├── .gitignore │ │ │ └── package.json │ │ ├── src │ │ │ ├── app │ │ │ │ ├── shared │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── speech-arrow │ │ │ │ │ │ ├── speech-arrow.component.html │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── toolbar │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── toolbar.component.html │ │ │ │ │ │ └── toolbar.component.ts │ │ │ │ │ ├── diff-status │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── diff-status.component.scss │ │ │ │ │ │ ├── diff-status.component.html │ │ │ │ │ │ ├── diff-status.component.ts │ │ │ │ │ │ └── status-list.ts │ │ │ │ │ ├── page-loading │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── page-loading.component.scss │ │ │ │ │ │ ├── page-loading.component.html │ │ │ │ │ │ └── page-loading.component.ts │ │ │ │ │ ├── thread │ │ │ │ │ │ ├── new-thread │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ ├── new-thread.component.scss │ │ │ │ │ │ │ ├── new-thread.component.ts │ │ │ │ │ │ │ └── new-thread.component.html │ │ │ │ │ │ ├── thread-reply │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ └── thread-reply.component.scss │ │ │ │ │ │ ├── thread-comments │ │ │ │ │ │ │ ├── comment-menu │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── comment-menu.component.html │ │ │ │ │ │ │ │ └── comment-menu.component.ts │ │ │ │ │ │ │ ├── thread-edit-comment │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── thread-edit-comment.component.scss │ │ │ │ │ │ │ │ └── thread-edit-comment.component.html │ │ │ │ │ │ │ ├── thread-comments.interface.ts │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ └── thread-comments.component.scss │ │ │ │ │ │ ├── delete-comment-dialog │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ ├── delete-comment-dialog.component.scss │ │ │ │ │ │ │ ├── delete-comment-dialog.component.html │ │ │ │ │ │ │ └── delete-comment-dialog.component.ts │ │ │ │ │ │ ├── thread.component.scss │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── thread.component.html │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── thread.service.ts │ │ │ │ │ ├── select-dashboard │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── select-dashboard.component.ts │ │ │ │ │ │ ├── select-dashboard.component.html │ │ │ │ │ │ └── select-dashboard.component.scss │ │ │ │ │ ├── code-changes │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── services │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── basic-styles.scss │ │ │ │ │ │ └── code-changes.interface.ts │ │ │ │ │ ├── pipes │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── directives │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── focus.directive.ts │ │ │ │ │ │ └── html.directive.ts │ │ │ │ ├── routes │ │ │ │ │ ├── diff │ │ │ │ │ │ ├── diff-discussion │ │ │ │ │ │ │ ├── diff-discussion.component.scss │ │ │ │ │ │ │ ├── code-threads │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── code-threads.component.scss │ │ │ │ │ │ │ │ └── code-threads.component.html │ │ │ │ │ │ │ ├── diff-threads │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── diff-threads.component.scss │ │ │ │ │ │ │ │ └── diff-threads.component.html │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ ├── diff-discussion.component.html │ │ │ │ │ │ │ └── diff-discussion.component.ts │ │ │ │ │ │ ├── diff-files │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ └── diff-files.component.scss │ │ │ │ │ │ ├── diff-header │ │ │ │ │ │ │ ├── user-popup │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── user-popup.component.html │ │ │ │ │ │ │ │ └── user-popup.component.scss │ │ │ │ │ │ │ ├── reply-popup │ │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ │ ├── add-user-popup │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ └── add-user-popup.component.html │ │ │ │ │ │ │ ├── diff-header-content │ │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ │ ├── diff-header-titlebar │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ └── diff-header-titlebar.component.scss │ │ │ │ │ │ │ ├── diff-header.component.html │ │ │ │ │ │ │ ├── diff-header.component.ts │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── delete-diff-dialog │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ ├── delete-diff-dialog.component.scss │ │ │ │ │ │ │ └── delete-diff-dialog.component.html │ │ │ │ │ │ ├── diff-routing.module.ts │ │ │ │ │ │ ├── diff.component.html │ │ │ │ │ │ └── diff.module.ts │ │ │ │ │ ├── login │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── login.component.html │ │ │ │ │ │ └── login.component.ts │ │ │ │ │ ├── page-not-found │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── page-not-found.component.ts │ │ │ │ │ ├── file-changes │ │ │ │ │ │ ├── commit-menu │ │ │ │ │ │ │ ├── commit-popup │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── commit-popup.component.html │ │ │ │ │ │ │ │ ├── commit-popup.component.ts │ │ │ │ │ │ │ │ └── commit-popup.component.scss │ │ │ │ │ │ │ ├── drag-element │ │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ │ ├── drag-element.component.html │ │ │ │ │ │ │ │ ├── drag-element.component.scss │ │ │ │ │ │ │ │ └── drag-element.component.ts │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── file-changes-routing.module.ts │ │ │ │ │ │ └── file-changes.module.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── log │ │ │ │ │ │ ├── log.module.ts │ │ │ │ │ │ ├── log-routing.module.ts │ │ │ │ │ │ ├── log.component.html │ │ │ │ │ │ └── log.component.scss │ │ │ │ │ └── diffs │ │ │ │ │ │ ├── diffs-routing.module.ts │ │ │ │ │ │ ├── diffs.module.ts │ │ │ │ │ │ └── diffs.component.scss │ │ │ │ ├── app.component.html │ │ │ │ ├── import │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── firebase │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── firebase.module.ts │ │ │ │ │ └── material.module.ts │ │ │ │ ├── core │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── services │ │ │ │ │ │ ├── mock │ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ │ ├── auth-mock.guard.ts │ │ │ │ │ │ │ ├── auth-mock.service.ts │ │ │ │ │ │ │ └── firebase-mock.service.ts │ │ │ │ │ │ ├── document-event.service.ts │ │ │ │ │ │ ├── encoding.service.ts │ │ │ │ │ │ ├── auth.guard.ts │ │ │ │ │ │ ├── exception.service.ts │ │ │ │ │ │ ├── tests │ │ │ │ │ │ │ └── encoding.service.spec.ts │ │ │ │ │ │ └── highlight.service.ts │ │ │ │ │ └── core.module.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.module.ts │ │ │ │ └── app-testing-module.spec.ts │ │ │ ├── polyfills.ts │ │ │ ├── styles │ │ │ │ ├── var.scss │ │ │ │ ├── styles.scss │ │ │ │ ├── themes │ │ │ │ │ ├── index.scss │ │ │ │ │ ├── ci.scss │ │ │ │ │ ├── material.scss │ │ │ │ │ └── notification.scss │ │ │ │ ├── shared │ │ │ │ │ ├── index.scss │ │ │ │ │ ├── body.scss │ │ │ │ │ ├── app.scss │ │ │ │ │ └── mat.scss │ │ │ │ └── variables │ │ │ │ │ └── fonts.scss │ │ │ ├── environments │ │ │ │ ├── environment.ts │ │ │ │ ├── environment.prod.ts │ │ │ │ └── global-registry.ts │ │ │ ├── favicon.ico │ │ │ ├── assets │ │ │ │ ├── logo.png │ │ │ │ ├── expand-up.png │ │ │ │ ├── expand-down.png │ │ │ │ ├── fonts │ │ │ │ │ └── opensans │ │ │ │ │ │ ├── opensans.eot │ │ │ │ │ │ ├── opensans.ttf │ │ │ │ │ │ ├── opensans.woff │ │ │ │ │ │ └── opensans.woff2 │ │ │ │ ├── ic-add-issue.svg │ │ │ │ ├── ic-add-comment.svg │ │ │ │ ├── status │ │ │ │ │ ├── ic-submitted.svg │ │ │ │ │ ├── ic-review-not-started.svg │ │ │ │ │ ├── ic-reverted.svg │ │ │ │ │ ├── ic-submitting.svg │ │ │ │ │ ├── ic-reverting.svg │ │ │ │ │ ├── ic-under-review.svg │ │ │ │ │ ├── ic-needs-more-work.svg │ │ │ │ │ └── ic-accepted.svg │ │ │ │ ├── decoration-2.svg │ │ │ │ ├── ic-add-person.svg │ │ │ │ ├── decoration-1.svg │ │ │ │ └── ic-search.svg │ │ │ ├── tsconfig.app.json │ │ │ ├── tsconfig.spec.json │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ ├── test.ts │ │ │ └── karma.conf.js │ │ ├── .firebaserc │ │ ├── proto.json │ │ ├── .editorconfig │ │ ├── firebase.json │ │ ├── firestore.rules │ │ ├── .gitignore │ │ └── tsconfig.json │ ├── job │ │ └── tasks │ │ │ ├── submitter.proto │ │ │ └── Task.java │ ├── aa │ │ ├── config.proto │ │ └── commands │ │ │ └── checks │ │ │ └── FixCommandCheck.java │ ├── dockerfile │ ├── rules_updater │ │ ├── README.md │ │ └── BUILD │ ├── remote_server │ │ ├── messages.proto │ │ ├── BUILD │ │ └── README.md │ ├── global_registry.prototxt │ ├── ReviewerConstants.java │ └── docker-compose.yaml ├── checkstyle │ ├── BUILD │ ├── checkstyle.sh │ ├── license-header.txt │ └── check-for-missing-targets.sh ├── proto_tool │ ├── README.md │ └── BUILD ├── build_file_generator │ └── tests │ │ └── resources │ │ ├── another_proto.proto │ │ └── test_proto.proto ├── bazel_tools │ ├── tsfmt.sh │ ├── buildozer.sh │ ├── buildifier.sh │ ├── unused_deps.sh │ └── shfmt.sh ├── pre-commit.sh ├── deps │ ├── update_maven_deps.sh │ ├── dependencies.proto │ └── add_maven_deps.sh ├── grpcwebproxy.sh ├── formatter │ ├── clang-format.sh │ └── BUILD ├── grpc_java_plugin.sh ├── protoc.sh ├── completion.sh ├── fix_formatting.sh └── bazel ├── .gitignore ├── test.sh ├── third_party_deps.zip ├── BUILD ├── examples ├── android │ └── res │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ │ ├── values │ │ ├── strings.xml │ │ └── dimens.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── layout │ │ └── activity_main.xml ├── errorprone │ └── README.md ├── proto_vs_json │ ├── data.proto │ └── BUILD └── dagger │ ├── example1 │ ├── BUILD │ ├── Class1Interface.java │ ├── App.java │ ├── SomeComponent.java │ ├── Class1Module.java │ └── Class2.java │ └── example2 │ ├── BUILD │ ├── Class2Interface.java │ ├── Class1Interface.java │ ├── App.java │ ├── SomeComponent.java │ ├── Class2Module.java │ └── Class1Module.java ├── .bazelrc ├── common ├── tests │ ├── resources │ │ ├── BUILD_diff.txt │ │ ├── BUILD_before.txt │ │ ├── MixedChangesAtTheMiddle_diff_prototxt.txt │ │ ├── MixedChangesAtTheBeginning_diff_prototxt.txt │ │ ├── BUILD_after.txt │ │ ├── MixedChangesAtTheEnd_diff_prototxt.txt │ │ ├── License_after.txt │ │ ├── License_before.txt │ │ └── License_diff.txt │ └── file_utils_test.proto ├── grpc_auth │ ├── messages.proto │ ├── GrpcAuthService.java │ ├── README.md │ └── ClientAuthInterceptor.java ├── firestore │ ├── ProtoEventListener.java │ ├── tests │ │ └── BUILD │ └── MessageWithId.java ├── flags │ ├── flags.proto │ ├── BUILD │ ├── UsagePrinter.java │ ├── tests │ │ ├── FlagTestClass.java │ │ └── BUILD │ └── FlagDesc.java └── CommonComponent.java ├── AUTHORS ├── tutorials └── proto_rename │ ├── person.proto │ └── BUILD ├── commands.txt ├── crystals_game.txt └── CONTRIBUTING.md /third_party/BUILD: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.bazelversion: -------------------------------------------------------------------------------- 1 | 0.24.0 2 | -------------------------------------------------------------------------------- /reviewer-ci.sh: -------------------------------------------------------------------------------- 1 | ./test.sh 2 | -------------------------------------------------------------------------------- /tools/protoc/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /tools/workspacerun/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/web_login/.gitignore: -------------------------------------------------------------------------------- 1 | .firebase 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/functions/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | bazel-* 3 | *.iml 4 | .project 5 | .ijwb 6 | .cache 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/index.ts: -------------------------------------------------------------------------------- 1 | export * from './shared.module'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/diff-discussion.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Test all targets 4 | tools/build_or_test.sh test 5 | -------------------------------------------------------------------------------- /third_party_deps.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/third_party_deps.zip -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/login/index.ts: -------------------------------------------------------------------------------- 1 | export * from './login.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js/dist/zone'; 2 | import 'hammerjs'; 3 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/service/tests/get_diff_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "diff_id":"82" 3 | } 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/speech-arrow/speech-arrow.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/toolbar/index.ts: -------------------------------------------------------------------------------- 1 | export * from './toolbar.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/diff-status/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-status.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-files/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-files.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/page-not-found/index.ts: -------------------------------------------------------------------------------- 1 | export * from './page-not-found.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/page-loading/index.ts: -------------------------------------------------------------------------------- 1 | export * from './page-loading.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/speech-arrow/index.ts: -------------------------------------------------------------------------------- 1 | export * from './speech-arrow.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/new-thread/index.ts: -------------------------------------------------------------------------------- 1 | export * from './new-thread.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/var.scss: -------------------------------------------------------------------------------- 1 | @import './variables/colors'; 2 | @import './variables/fonts'; 3 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "startupos-5f279" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/select-dashboard/index.ts: -------------------------------------------------------------------------------- 1 | export * from './select-dashboard.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-reply/index.ts: -------------------------------------------------------------------------------- 1 | export * from './thread-reply.component'; 2 | -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- 1 | exports_files([ 2 | "dependencies.yaml", 3 | "WORKSPACE", 4 | "reviewer_config.prototxt", 5 | ]) 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/import/index.ts: -------------------------------------------------------------------------------- 1 | export * from './material.module'; 2 | export * from './firebase'; 3 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/user-popup/index.ts: -------------------------------------------------------------------------------- 1 | export * from './user-popup.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | }; 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/delete-diff-dialog/index.ts: -------------------------------------------------------------------------------- 1 | export * from './delete-diff-dialog.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/reply-popup/index.ts: -------------------------------------------------------------------------------- 1 | export * from './reply-popup.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /tools/checkstyle/BUILD: -------------------------------------------------------------------------------- 1 | exports_files([ 2 | "checkstyle.sh", 3 | "license-header.txt", 4 | "config.xml", 5 | ]) 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/code-threads/index.ts: -------------------------------------------------------------------------------- 1 | export * from './code-threads.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/diff-threads/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-threads.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/add-user-popup/index.ts: -------------------------------------------------------------------------------- 1 | export * from './add-user-popup.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/page-loading/page-loading.component.scss: -------------------------------------------------------------------------------- 1 | .page-loading { 2 | margin-top: 25vh; 3 | } 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/comment-menu/index.ts: -------------------------------------------------------------------------------- 1 | export * from './comment-menu.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/favicon.ico -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/styles.scss: -------------------------------------------------------------------------------- 1 | @import './var'; 2 | @import './themes/index'; 3 | @import './shared/index'; 4 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/web_login/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "web-login-startupos" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/import/firebase/index.ts: -------------------------------------------------------------------------------- 1 | export * from './firebase.module'; 2 | export * from './global-registry'; 3 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/commit-popup/index.ts: -------------------------------------------------------------------------------- 1 | export * from './commit-popup.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/drag-element/index.ts: -------------------------------------------------------------------------------- 1 | export * from './drag-element.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/delete-comment-dialog/index.ts: -------------------------------------------------------------------------------- 1 | export * from './delete-comment-dialog.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/service/tests/get_diff_files_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "workspace": "reviewer2", 3 | "diff_id": 82 4 | } 5 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/diff-header-content/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-header-content.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/diff-header-titlebar/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-header-titlebar.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/logo.png -------------------------------------------------------------------------------- /tools/workspacerun/apps.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "protoc", 4 | "path": "startup-os/tools/protoc/protoc.js" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './core.module'; 2 | export * from './services'; 3 | export * from './proto'; 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/thread-edit-comment/index.ts: -------------------------------------------------------------------------------- 1 | export * from './thread-edit-comment.component'; 2 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/expand-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/expand-up.png -------------------------------------------------------------------------------- /examples/android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/examples/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/android/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/examples/android/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/examples/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/expand-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/expand-down.png -------------------------------------------------------------------------------- /examples/android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/examples/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/themes/index.scss: -------------------------------------------------------------------------------- 1 | @import './material'; 2 | @import './highlightjs'; 3 | @import './notification'; 4 | @import './ci'; 5 | -------------------------------------------------------------------------------- /.bazelrc: -------------------------------------------------------------------------------- 1 | build --proto_compiler //external:proto_compiler \ 2 | --proto_toolchain_for_java //external:proto_java_toolchain 3 | test --test_output=errors 4 | -------------------------------------------------------------------------------- /third_party/maven/BUILD: -------------------------------------------------------------------------------- 1 | exports_files( 2 | ["package-lock.bzl"], 3 | licenses = ["permissive"], 4 | visibility = ["//visibility:public"], 5 | ) 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/shared/index.scss: -------------------------------------------------------------------------------- 1 | @import './body'; 2 | @import './app'; 3 | @import './mat'; 4 | @import './panels'; 5 | @import './buttons'; 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/thread-comments.interface.ts: -------------------------------------------------------------------------------- 1 | export interface CommentExpandedMap { 2 | [id: string]: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/fonts/opensans/opensans.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/fonts/opensans/opensans.eot -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/fonts/opensans/opensans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/fonts/opensans/opensans.ttf -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/fonts/opensans/opensans.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/fonts/opensans/opensans.woff -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/fonts/opensans/opensans.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/startup-os/HEAD/tools/reviewer/webapp/src/assets/fonts/opensans/opensans.woff2 -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/mock/index.ts: -------------------------------------------------------------------------------- 1 | export * from './firebase-mock.service'; 2 | export * from './auth-mock.service'; 3 | export * from './auth-mock.guard'; 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/code-changes/index.ts: -------------------------------------------------------------------------------- 1 | export * from './code-changes.component'; 2 | export * from './code-changes.interface'; 3 | export * from './services'; 4 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/pipes/index.ts: -------------------------------------------------------------------------------- 1 | export * from './time.pipe'; 2 | 3 | import { TimePipe } from './time.pipe'; 4 | export const PipeList = [ 5 | TimePipe, 6 | ]; 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/diff-status/diff-status.component.scss: -------------------------------------------------------------------------------- 1 | .diff-status { 2 | display: flex; 3 | align-items: center; 4 | >img { 5 | margin-right: 7px; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/drag-element/drag-element.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/web_login/README.md: -------------------------------------------------------------------------------- 1 | # Firestore web login for StartupOS local server 2 | 3 | ### Setting 4 | Port and config: `./index.html` 5 | 6 | ### Deploy 7 | ``` 8 | firebase deploy 9 | ``` 10 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | }) 7 | export class AppComponent { } 8 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/page-loading/page-loading.component.html: -------------------------------------------------------------------------------- 1 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/thread-edit-comment/thread-edit-comment.component.scss: -------------------------------------------------------------------------------- 1 | @import '../../index'; 2 | 3 | .comment-buttons { 4 | display: flex; 5 | justify-content: flex-end; 6 | } 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/diff-status/diff-status.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{ statusList[diff.getStatus()].label }} 4 |
5 | -------------------------------------------------------------------------------- /tools/proto_tool/README.md: -------------------------------------------------------------------------------- 1 | # ProtoLoader 2 | 3 | This class is intended to enable dynamic usage of `*.proto` files to transform 4 | `*.prototxt` to `*.protobin`. It does so by utilizing `protoc`, Java Compiler API and `URLClassLoader`. 5 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { ServiceList } from './services'; 4 | 5 | @NgModule({ 6 | providers: [...ServiceList], 7 | }) 8 | export class CoreModule { } 9 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/diff-header-titlebar/diff-header-titlebar.component.scss: -------------------------------------------------------------------------------- 1 | .titlebar { 2 | >.title { 3 | margin-right: 30px; 4 | >span { 5 | margin-right: 5px; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | template: '

Page not found

', 5 | }) 6 | export class PageNotFoundComponent { } 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/proto.json: -------------------------------------------------------------------------------- 1 | { 2 | "exportPath": "src/app/core/proto", 3 | "protoList": [ 4 | "startup-os/tools/reviewer/local_server/service/code_review.proto", 5 | "startup-os/tools/reviewer/reviewer_registry.proto" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/variables/fonts.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: opensans; 3 | src: url("/assets/fonts/opensans/opensans.ttf"); 4 | font-style: normal; 5 | } 6 | 7 | $font-1: opensans, sans-serif; 8 | $default-font: $font-1; 9 | -------------------------------------------------------------------------------- /examples/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Hello StartupOS 3 | 4 | Hello world! 5 | StartupOSHello 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/themes/ci.scss: -------------------------------------------------------------------------------- 1 | .ci-passed { 2 | color: #12a736; 3 | } 4 | 5 | .ci-failed { 6 | color: #db4040; 7 | } 8 | 9 | .ci-running { 10 | color: #1545bd; 11 | } 12 | 13 | .ci-outdated { 14 | color: #808080; 15 | } 16 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /examples/android/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/drag-element/drag-element.component.scss: -------------------------------------------------------------------------------- 1 | .drag-element { 2 | $size: 14px; 3 | height: $size; 4 | width: $size; 5 | background: #ffc84b; 6 | } 7 | .circle { 8 | border-radius: 50%; 9 | } 10 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff/diff.module'; 2 | export * from './diffs/diffs.module'; 3 | export * from './file-changes/file-changes.module'; 4 | export * from './log/log.module'; 5 | export * from './login'; 6 | export * from './page-not-found'; 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/shared/body.scss: -------------------------------------------------------------------------------- 1 | // General setting of body and html 2 | 3 | body { 4 | position: absolute; 5 | width: 100%; 6 | color: #2a2a2a; 7 | margin: 0px; 8 | font-family: $default-font; 9 | } 10 | html { 11 | overflow-y: scroll; 12 | } 13 | -------------------------------------------------------------------------------- /third_party/maven/org/json/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "json", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/json/json", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/reviewer/job/tasks/submitter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message SubmitterMergeResult { 4 | enum MergeStatus { 5 | SUCCESSFUL = 0; 6 | MERGE_FAILED = 1; 7 | COMMIT_OUT_OF_DATE = 2; 8 | } 9 | 10 | MergeStatus status = 1; 11 | string message = 2; 12 | } 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread.component.scss: -------------------------------------------------------------------------------- 1 | @import './index'; 2 | 3 | .thread { 4 | $border-width: 1px; 5 | border-radius: $border-radius + $border-width; 6 | max-width: 1400px; 7 | border: $border-width solid $border-color; 8 | margin: 0 22px; 9 | } 10 | -------------------------------------------------------------------------------- /third_party/maven/com/jcraft/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "jsch", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/jcraft/jsch", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/org/jsoup/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "jsoup", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/jsoup/jsoup", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/code-changes/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from './line.service'; 2 | export * from './comments.service'; 3 | export * from './changes.service'; 4 | export * from './template.service'; 5 | export * from './blocks.service'; 6 | export * from './section.service'; 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/environments/global-registry.ts: -------------------------------------------------------------------------------- 1 | export const id: string = 'startup_os'; 2 | // tslint:disable-next-line 3 | export const globalRegistryUrl: string = 'https://firestore.googleapis.com/v1beta1/projects/startupos-5f279/databases/(default)/documents/reviewer/registry_binary'; 4 | -------------------------------------------------------------------------------- /tools/workspacerun/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "workspacerun", 3 | "description": "Workspace apps runner", 4 | "version": "1.0.5", 5 | "scripts": { 6 | "start": "node index.js" 7 | }, 8 | "bin":{ 9 | "workspacerun": "index.js" 10 | }, 11 | "license": "MIT" 12 | } 13 | -------------------------------------------------------------------------------- /third_party/maven/org/yaml/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "snakeyaml", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/yaml/snakeyaml", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/checkstyle/checkstyle.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | COMMAND="{command}" 4 | ALLOW_FAILURE="{allow_failure}" 5 | 6 | echo "ALLOW_FAILURE IS $ALLOW_FAILURE" 7 | 8 | ${COMMAND} 9 | result=$? 10 | 11 | if [[ ${ALLOW_FAILURE} -eq 1 ]]; then 12 | exit 0 13 | fi 14 | 15 | exit ${result} 16 | -------------------------------------------------------------------------------- /tools/protoc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "protoc", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "protoc": "node protoc.js" 6 | }, 7 | "devDependencies": { 8 | "fs-extra": "^7.0.1", 9 | "google-protobuf": "^3.7.0-rc.2", 10 | "ts-protoc-gen": "^0.9.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/diff-threads/diff-threads.component.scss: -------------------------------------------------------------------------------- 1 | .cr-header { 2 | padding: 10px 22px; 3 | font-size: 15px; 4 | font-weight: 600; 5 | } 6 | .threads { 7 | padding: 14px 0; 8 | >.thread { 9 | margin-bottom: 14px; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /third_party/maven/antlr/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "antlr", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnantlr/antlr", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/com/squareup/okio/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "okio", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/squareup/okio/okio", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/org/javassist/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "javassist", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/javassist/javassist", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/org/objenesis/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "objenesis", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/objenesis/objenesis", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/com/google/code/gson/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "gson", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/code/gson/gson", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/javax/inject/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "javax_inject", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnjavax/inject/javax_inject", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/com/google/re2j/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "re2j", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/re2j/re2j", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/info/picocli/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "picocli", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvninfo/picocli/picocli", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/build_file_generator/tests/resources/another_proto.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.test.another_package; 4 | 5 | option java_package = "com.test.another.javapackage"; 6 | option java_outer_classname = "Protos"; 7 | 8 | message TestMessage { 9 | int32 id = 1; 10 | string content = 2; 11 | } -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/new-thread/new-thread.component.scss: -------------------------------------------------------------------------------- 1 | @import '../index'; 2 | 3 | .new-thread { 4 | flex-direction: column; 5 | border-radius: $border-radius; 6 | border: none; 7 | >.comment-buttons { 8 | display: flex; 9 | justify-content: flex-end; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common/tests/resources/BUILD_diff.txt: -------------------------------------------------------------------------------- 1 | @@ -9,5 +9,7 @@ java_library( 2 | ":diff_match_patch", 3 | ":text_difference_java_proto", 4 | "//third_party/maven/com/google/guava", 5 | + "//third_party/maven/javax/inject:javax_inject", 6 | + "//common/repo:repo_java_proto", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /third_party/maven/com/google/code/findbugs/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "jsr305", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/code/findbugs/jsr305", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/com/squareup/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "javapoet", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/squareup/javapoet", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/commons_logging/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "commons_logging", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncommons_logging/commons_logging", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/net/sf/saxon/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "Saxon_HE", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnnet/sf/saxon/Saxon_HE", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/org/threeten/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "threetenbp", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/threeten/threetenbp", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/org/antlr/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "antlr4_runtime", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/antlr/antlr4_runtime", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/commons_codec/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "commons_codec", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncommons_codec/commons_codec", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/org/hamcrest/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "hamcrest_core", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/hamcrest/hamcrest_core", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/reviewer/aa/config.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package com.google.startupos.tools.reviewer.aa; 3 | 4 | option java_package = "com.google.startupos.tools.reviewer.aa"; 5 | option java_outer_classname = "Protos"; 6 | 7 | /* Config protos. */ 8 | message Config { 9 | // Base folder 10 | string base_path = 1; 11 | } 12 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/directives/index.ts: -------------------------------------------------------------------------------- 1 | export * from './html.directive'; 2 | export * from './focus.directive'; 3 | 4 | import { FocusDirective } from './focus.directive'; 5 | import { HtmlDirective } from './html.directive'; 6 | export const DirectiveList = [ 7 | HtmlDirective, 8 | FocusDirective, 9 | ]; 10 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/delete-comment-dialog/delete-comment-dialog.component.scss: -------------------------------------------------------------------------------- 1 | .title { 2 | display: flex; 3 | justify-content: center; 4 | margin-bottom: 23px; 5 | >div { 6 | width: 298px; 7 | text-align: center; 8 | } 9 | } 10 | .buttons { 11 | display: flex; 12 | justify-content: center; 13 | } 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the list of StartupOS authors for copyright purposes. 2 | # 3 | # This does not necessarily list everyone who has contributed code, since in 4 | # some cases, their employer may be the copyright holder. To see the full list 5 | # of contributors, see the revision history in source control. 6 | Google Inc. 7 | The Public Knowledge Workshop 8 | -------------------------------------------------------------------------------- /third_party/maven/com/google/j2objc/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "j2objc_annotations", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/j2objc/j2objc_annotations", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/com/fasterxml/jackson/core/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "jackson_core", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/fasterxml/jackson/core/jackson_core", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /third_party/maven/commons_collections/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "commons_collections", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncommons_collections/commons_collections", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/code-changes/basic-styles.scss: -------------------------------------------------------------------------------- 1 | .left-file { 2 | background: #ffeef0; 3 | } 4 | .right-file { 5 | background: #e6ffed; 6 | } 7 | .placeholder { 8 | background: #ebebeb; 9 | } 10 | .comments { 11 | background: #ebebeb; 12 | } 13 | .common-line { 14 | background: white; 15 | } 16 | pre { 17 | margin: 0; 18 | } 19 | -------------------------------------------------------------------------------- /third_party/maven/org/codehaus/mojo/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "animal_sniffer_annotations", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/codehaus/mojo/animal_sniffer_annotations", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/mock/auth-mock.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate } from '@angular/router'; 3 | import { Observable, of } from 'rxjs'; 4 | 5 | @Injectable() 6 | export class AuthGuard implements CanActivate { 7 | canActivate(): Observable { 8 | return of(true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/page-loading/page-loading.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'page-loading', 5 | templateUrl: './page-loading.component.html', 6 | styleUrls: ['./page-loading.component.scss'], 7 | }) 8 | export class PageLoadingComponent { 9 | @Input() isLoading: boolean; 10 | } 11 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /common/tests/resources/BUILD_before.txt: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | java_library( 4 | name = "text_differencer", 5 | srcs = [ 6 | "TextDifferencer.java", 7 | ], 8 | deps = [ 9 | ":diff_match_patch", 10 | ":text_difference_java_proto", 11 | "//third_party/maven/com/google/guava", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/maven/junit/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "junit", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnjunit/junit", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/org/hamcrest:hamcrest_core", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /tools/reviewer/dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for alpine-java-git 2 | # Build using: 3 | # docker build --tag gcr.io/startup-os/alpine-java-git - < dockerfile 4 | # Push using: 5 | # docker push gcr.io/startup-os/alpine-java-git 6 | 7 | FROM openjdk:8u181-jdk-alpine3.8 8 | 9 | RUN apk --update add git openssh && \ 10 | rm -rf /var/lib/apt/lists/* && \ 11 | rm /var/cache/apk/* 12 | -------------------------------------------------------------------------------- /tools/reviewer/rules_updater/README.md: -------------------------------------------------------------------------------- 1 | # rules-updater 2 | 3 | ## Purpose 4 | 5 | `rules_updater` is a tool to generate Firestore rules according 6 | to users in prototxt-stored `ReviewerConfig` 7 | 8 | ## How to run 9 | 10 | `bazel run //tools/reviewer/rules_updater:rules_updater -- 11 | --config reviewer_config.prototxt 12 | --output tools/reviewer/webapp/firestore.rules` 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/ic-add-issue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /third_party/maven/com/google/jimfs/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "jimfs", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/jimfs/jimfs", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/guava", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/ic-add-comment.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /common/grpc_auth/messages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.google.startupos.common.grpc_auth; 4 | 5 | option java_package = "com.google.startupos.common.grpc_auth"; 6 | option java_outer_classname = "Protos"; 7 | 8 | service GrpcAuthTest { rpc getNextNumber(Request) returns (Response); } 9 | 10 | message Request { int32 number = 1; } 11 | 12 | message Response { int32 number = 1; } 13 | -------------------------------------------------------------------------------- /common/tests/resources/MixedChangesAtTheMiddle_diff_prototxt.txt: -------------------------------------------------------------------------------- 1 | left_file_contents: "With Change." 2 | right_file_contents: "With a Change." 3 | left_diff_line { 4 | text: "With Change." 5 | type: DELETE 6 | } 7 | right_diff_line { 8 | text: "With a Change." 9 | type: ADD 10 | word_change { 11 | text: "a " 12 | type: ADD 13 | start_index: 5 14 | end_index: 7 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /third_party/maven/com/google/auto/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "auto_common", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/auto/auto_common", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/guava", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /third_party/maven/com/squareup/okhttp/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "okhttp", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/squareup/okhttp/okhttp", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/squareup/okio", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /examples/android/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/diff-header.component.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-submitted.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "./dist/reviewer", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ], 9 | "rewrites": [ 10 | { 11 | "source": "**", 12 | "destination": "/index.html" 13 | } 14 | ] 15 | }, 16 | "firestore": { 17 | "rules": "firestore.rules" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/decoration-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/ic-add-person.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/bazel_tools/tsfmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running tsfmt 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | BINARY=$(find . -name "cli-macos" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | BINARY=$(find . -name "cli-linux" | head -n1) 11 | else 12 | echo "tsfmt does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | ${BINARY} -r $* 17 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/log/log.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { SharedModule } from '@/shared'; 4 | import { LogRoutingModule } from './log-routing.module'; 5 | import { LogComponent } from './log.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | SharedModule, 10 | LogRoutingModule, 11 | ], 12 | declarations: [LogComponent], 13 | }) 14 | export class LogModule { } 15 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/shared/app.scss: -------------------------------------------------------------------------------- 1 | // Small global classes 2 | 3 | body { 4 | textarea { 5 | font-family: $default-font; 6 | border: solid 1px #c1c1c1; 7 | } 8 | 9 | .bold { 10 | font-weight: 600; 11 | } 12 | 13 | .approved { 14 | color: #0d912c; 15 | } 16 | 17 | .ellipsis { 18 | white-space: nowrap; 19 | overflow: hidden; 20 | text-overflow: ellipsis; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/pre-commit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Pre-commit hook for StartupOS 4 | # Run it before committing to perform several quality checks 5 | # so you won't fail early on review 6 | # Either do it manually or by creating a symlink 7 | # To do this, execute, from repo root 8 | # ln -s $(pwd)/tools/pre-commit.sh $(pwd)/.git/hooks/pre-commit 9 | 10 | bazel version 11 | tools/checkstyle/check-for-missing-targets.sh 12 | exit $? 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/drag-element/drag-element.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'drag-element', 5 | templateUrl: './drag-element.component.html', 6 | styleUrls: ['./drag-element.component.scss'], 7 | }) 8 | export class DragElementComponent { 9 | isPopup: boolean = false; 10 | 11 | @Input() isCircle: boolean; 12 | } 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-review-not-started.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/deps/update_maven_deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script for updating Maven deps after modifying or deleting a dependency in dependencies.yaml. 4 | # Usage: tools/deps/update_maven_deps.sh 5 | 6 | bazel run //tools:bazel_deps -- generate -r $(pwd) -s third_party/maven/package-lock.bzl -d dependencies.yaml 7 | 8 | # Fix formatting for BUILD files 9 | bazel run //tools/formatter -- --path $(pwd)/third_party --build &>/dev/null 10 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/decoration-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/themes/material.scss: -------------------------------------------------------------------------------- 1 | @import '~@angular/material/theming'; 2 | @include mat-core(); 3 | 4 | $material-primary: mat-palette($mat-light-blue, 500); 5 | $material-accent: mat-palette($mat-amber, 400); 6 | $material-warn: mat-palette($mat-blue, 800); 7 | 8 | $material-theme: mat-light-theme( 9 | $material-primary, $material-accent, $material-warn 10 | ); 11 | @include angular-material-theme($material-theme); 12 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/commit-popup/commit-popup.component.html: -------------------------------------------------------------------------------- 1 |
2 | 9 | 10 |
{{ getId(commitInfo.id) }}
11 |
{{ commitInfo.timestamp | date:'h:mm a, MMM d' }}
12 |
13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/log/log-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { LogComponent } from './log.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: LogComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | }) 14 | export class LogRoutingModule { } 15 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { DiffComponent } from './diff.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: DiffComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | }) 14 | export class DiffRoutingModule { } 15 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diffs/diffs-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { DiffsComponent } from './diffs.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: DiffsComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | }) 14 | export class DiffsRoutingModule { } 15 | -------------------------------------------------------------------------------- /common/tests/resources/MixedChangesAtTheBeginning_diff_prototxt.txt: -------------------------------------------------------------------------------- 1 | left_file_contents: "No Change." 2 | right_file_contents: "With Change." 3 | left_diff_line { 4 | text: "No Change." 5 | type: DELETE 6 | word_change { 7 | text: "No" 8 | type: DELETE 9 | end_index: 2 10 | } 11 | } 12 | right_diff_line { 13 | text: "With Change." 14 | type: ADD 15 | word_change { 16 | text: "With" 17 | type: ADD 18 | end_index: 4 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /third_party/maven/com/google/apis/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "google_api_services_storage", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/apis/google_api_services_storage", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/api_client:google_api_client", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diffs/diffs.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { SharedModule } from '@/shared'; 4 | import { DiffsRoutingModule } from './diffs-routing.module'; 5 | import { DiffsComponent } from './diffs.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | SharedModule, 10 | DiffsRoutingModule, 11 | ], 12 | declarations: [ 13 | DiffsComponent, 14 | ], 15 | }) 16 | export class DiffsModule { } 17 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-reverted.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-submitting.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeReviews 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /common/tests/file_utils_test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.google.startupos.common.tests; 4 | 5 | option java_package = "com.google.startupos.common.tests"; 6 | option java_outer_classname = "Protos"; 7 | 8 | message TestMessage { 9 | enum BooleanEnum { 10 | UNKNOWN = 0; 11 | YES = 1; 12 | NO = 2; 13 | } 14 | int32 int32_field = 1; 15 | string string_field = 2; 16 | map map_field = 3; 17 | BooleanEnum enum_field = 4; 18 | } 19 | -------------------------------------------------------------------------------- /common/tests/resources/BUILD_after.txt: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | java_library( 4 | name = "text_differencer", 5 | srcs = [ 6 | "TextDifferencer.java", 7 | ], 8 | deps = [ 9 | ":diff_match_patch", 10 | ":text_difference_java_proto", 11 | "//third_party/maven/com/google/guava", 12 | "//third_party/maven/javax/inject:javax_inject", 13 | "//common/repo:repo_java_proto", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /third_party/maven/commons_beanutils/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "commons_beanutils", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncommons_beanutils/commons_beanutils", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/commons_collections", 14 | "//third_party/maven/commons_logging", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /tools/bazel_tools/buildozer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running buildozer 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | BINARY=$(find . -iwholename "*buildozer_osx/file/downloaded" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | BINARY=$(find . -iwholename "*buildozer/file/downloaded" | head -n1) 11 | else 12 | echo "Buildozer does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | ${BINARY} $* 17 | -------------------------------------------------------------------------------- /tools/reviewer/remote_server/messages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.google.startupos.tools.reviewer.remove_server; 4 | 5 | option java_package = "com.google.startupos.tools.reviewer.remote_server"; 6 | option java_outer_classname = "Protos"; 7 | 8 | message InitialAuthRequest { string code = 1; } 9 | 10 | message RefreshTokenRequest { string refresh_token = 1; } 11 | 12 | message AuthResponse { 13 | string access_token = 1; 14 | string refresh_token = 2; 15 | } 16 | -------------------------------------------------------------------------------- /tutorials/proto_rename/person.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.google.startupos.tutorials.proto_rename; 4 | 5 | option java_package = "com.google.startupos.tutorials.proto_rename"; 6 | option java_outer_classname = "Protos"; 7 | 8 | message Person { 9 | string name = 1; 10 | int32 id = 2; 11 | 12 | enum FavoritePizzaTopping { 13 | MUSHROOMS = 0; 14 | OLIVES_AND_PINEAPLE = 1; 15 | } 16 | 17 | FavoritePizzaTopping favorite_pizza_topping = 3; 18 | } 19 | -------------------------------------------------------------------------------- /tools/bazel_tools/buildifier.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running buildifier 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | BINARY=$(find . -iwholename "*buildifier_osx/file/downloaded" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | BINARY=$(find . -iwholename "*buildifier/file/downloaded" | head -n1) 11 | else 12 | echo "Buildifier does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | ${BINARY} $* 17 | -------------------------------------------------------------------------------- /tools/bazel_tools/unused_deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running unused_deps 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | BINARY=$(find . -iwholename "*unused_deps_osx/file/downloaded" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | BINARY=$(find . -iwholename "*unused_deps/file/downloaded" | head -n1) 11 | else 12 | echo "unused_deps does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | ${BINARY} $* 17 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/file-changes-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { FileChangesComponent } from './file-changes.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: FileChangesComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule], 13 | }) 14 | export class FileChangesRoutingModule { } 15 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/diff-status/diff-status.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | import { Diff } from '@/core/proto'; 4 | import { Status, statusList } from './status-list'; 5 | 6 | @Component({ 7 | selector: 'diff-status', 8 | templateUrl: './diff-status.component.html', 9 | styleUrls: ['./diff-status.component.scss'], 10 | }) 11 | export class DiffStatusComponent { 12 | statusList: Status[] = statusList; 13 | @Input() diff: Diff; 14 | } 15 | -------------------------------------------------------------------------------- /third_party/maven/com/google/googlejavaformat/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "google_java_format", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/googlejavaformat/google_java_format", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/errorprone:javac_shaded", 14 | "//third_party/maven/com/google/guava", 15 | ], 16 | ) 17 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/index.ts: -------------------------------------------------------------------------------- 1 | export * from './commit-menu.component'; 2 | export * from './drag-element'; 3 | export * from './commit-popup'; 4 | 5 | import { CommitMenuComponent } from './commit-menu.component'; 6 | import { CommitPopupComponent } from './commit-popup'; 7 | import { DragElementComponent } from './drag-element'; 8 | export const CommitMenuComponentList = [ 9 | CommitMenuComponent, 10 | DragElementComponent, 11 | CommitPopupComponent, 12 | ]; 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/shared/mat.scss: -------------------------------------------------------------------------------- 1 | // Custom material settings 2 | 3 | body { 4 | .mat-header-row { 5 | min-height: 32px; 6 | } 7 | 8 | .mat-checkbox { 9 | font-family: $default-font; 10 | .mat-checkbox-frame, 11 | .mat-checkbox-background { 12 | transform: scale(.9); 13 | } 14 | .mat-checkbox-frame { 15 | background: white; 16 | border-width: 1px; 17 | } 18 | } 19 | 20 | .mat-table { 21 | font-family: $default-font; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/tests/resources/MixedChangesAtTheEnd_diff_prototxt.txt: -------------------------------------------------------------------------------- 1 | left_file_contents: "Change at end." 2 | right_file_contents: "Change at end!" 3 | left_diff_line { 4 | text: "Change at end." 5 | type: DELETE 6 | word_change { 7 | text: "." 8 | type: DELETE 9 | start_index: 13 10 | end_index: 14 11 | } 12 | } 13 | right_diff_line { 14 | text: "Change at end!" 15 | type: ADD 16 | word_change { 17 | text: "!" 18 | type: ADD 19 | start_index: 13 20 | end_index: 14 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /third_party/maven/org/mockito/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "mockito_core", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/mockito/mockito_core", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/net/bytebuddy:byte_buddy", 14 | "//third_party/maven/net/bytebuddy:byte_buddy_agent", 15 | "//third_party/maven/org/objenesis", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /tools/grpcwebproxy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Wrapper script for running grpcwebproxy 3 | platform=$(uname) 4 | if [ "$platform" == "Darwin" ]; then 5 | BINARY=$(pwd)/bazel-out/host/bin/tools/grpcwebproxy.runfiles/grpcwebproxy_osx/file/grpcwebproxy_osx 6 | elif [ "$platform" == "Linux" ]; then 7 | BINARY=$(pwd)/bazel-out/host/bin/tools/grpcwebproxy.runfiles/grpcwebproxy_linux/file/grpcwebproxy_linux 8 | else 9 | echo "grpcwebproxy does not have a binary for $platform" 10 | exit 1 11 | fi 12 | $BINARY "$@" 13 | -------------------------------------------------------------------------------- /tools/formatter/clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running clang_format 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | BINARY=$(find . -iwholename "*clang_format_bin_osx/file/downloaded" | head -n1) 9 | echo "BINARY IS $BINARY" 10 | elif [[ "$platform" == "Linux" ]]; then 11 | BINARY=$(find . -iwholename "*clang_format_bin/file/downloaded" | head -n1) 12 | else 13 | echo "clang_format does not have a binary for $platform" 14 | exit 1 15 | fi 16 | 17 | ${BINARY} $* 18 | -------------------------------------------------------------------------------- /tools/grpc_java_plugin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running grpc_java_plugin 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | PLUGIN_BINARY=$(find . -iwholename "*grpc_java_plugin_osx/file/downloaded" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | PLUGIN_BINARY=$(find . -iwholename "*grpc_java_plugin_linux/file/downloaded" | head -n1) 11 | else 12 | echo "grpc_java_plugin does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | ${PLUGIN_BINARY} "$@" 17 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/directives/focus.directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Directive, 3 | ElementRef, 4 | Input, 5 | OnInit, 6 | } from '@angular/core'; 7 | 8 | // Focuses an element 9 | @Directive({ 10 | selector: '[focus]', 11 | }) 12 | export class FocusDirective implements OnInit { 13 | @Input('focus') isFocused: boolean; 14 | 15 | constructor(private hostElement: ElementRef) { } 16 | 17 | ngOnInit() { 18 | if (this.isFocused) { 19 | this.hostElement.nativeElement.focus(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/login/login.component.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/firestore.rules: -------------------------------------------------------------------------------- 1 | service cloud.firestore { 2 | match /databases/{database}/documents { 3 | match /{document=**} { 4 | allow read, write: if request.auth.uid != null; 5 | } 6 | match /reviewer/config { 7 | allow read: if true; 8 | } 9 | match /reviewer/config_binary { 10 | allow read: if true; 11 | } 12 | match /reviewer/registry { 13 | allow read: if true; 14 | } 15 | match /reviewer/registry_binary { 16 | allow read: if true; 17 | } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/delete-comment-dialog/delete-comment-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Are you sure you want to delete the selected comment?
3 |
4 |
5 | 10 | 15 |
16 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/styles/themes/notification.scss: -------------------------------------------------------------------------------- 1 | .cr-snack-success { 2 | background-color: #37d437; 3 | .mat-simple-snackbar { 4 | color: black; 5 | } 6 | } 7 | 8 | .cr-snack-info { 9 | background-color: #9da1f1; 10 | .mat-simple-snackbar { 11 | color: black; 12 | } 13 | } 14 | 15 | .cr-snack-warning { 16 | background-color: #ffc944; 17 | .mat-simple-snackbar { 18 | color: black; 19 | } 20 | } 21 | 22 | .cr-snack-error { 23 | background-color: #e83636; 24 | .mat-simple-snackbar { 25 | color: black; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tools/protoc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running protoc 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | ARCHIVE=$(find . -iwholename "*protoc_bin_osx/file/downloaded" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | ARCHIVE=$(find . -iwholename "*protoc_bin/file/downloaded" | head -n1) 11 | else 12 | echo "protoc does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | if [[ ! -f bin/protoc ]]; then 17 | unzip ${ARCHIVE} bin/protoc >/dev/null 18 | fi 19 | 20 | bin/protoc "$@" 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-reverting.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/web_login/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "./", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/*.md" 8 | ], 9 | "headers": [ 10 | { 11 | "source": "/*", 12 | "headers": [ 13 | { 14 | "key": "Cache-Control", 15 | "value": "max-age=600" 16 | } 17 | ] 18 | } 19 | ], 20 | "rewrites": [ 21 | { 22 | "source": "**", 23 | "destination": "/index.html" 24 | } 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "scripts": { 5 | "serve": "firebase serve --only functions", 6 | "shell": "firebase functions:shell", 7 | "start": "npm run shell", 8 | "deploy": "firebase deploy --only functions", 9 | "logs": "firebase functions:log" 10 | }, 11 | "dependencies": { 12 | "cors": "^2.8.4", 13 | "firebase-admin": "~6.0.0", 14 | "firebase-functions": "^2.0.3", 15 | "request": "^2.88.0" 16 | }, 17 | "private": true 18 | } 19 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-under-review.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/service/tests/get_text_diff_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "left_file":{ 3 | "filename":"tools/reviewer/local_server/service/CodeReviewService.java", 4 | "workspace":"demo-workspace", 5 | "repo_id":"startup-os", 6 | "commit_id":"78a77921e1ef0dadef99a1913245a8c82fb40205" 7 | }, 8 | "right_file":{ 9 | "filename":"tools/reviewer/local_server/service/CodeReviewService.java", 10 | "commit_id":"e99c050568a5f21292490718aebe77b9ee4eca3e", 11 | "repo_id":"startup-os", 12 | "action": "MODIFY" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /third_party/maven/com/google/oauth_client/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "google_oauth_client", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/oauth_client/google_oauth_client", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/code/findbugs:jsr305", 14 | "//third_party/maven/com/google/guava", 15 | "//third_party/maven/com/google/http_client:google_http_client", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /tools/build_file_generator/tests/resources/test_proto.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.test.package; 4 | 5 | option java_package = "com.test.javapackage"; 6 | option java_outer_classname = "Protos"; 7 | 8 | import "tools/build_file_generator/tests/resources/another_proto.proto"; 9 | 10 | service FileService { rpc getFile(FileRequest) returns (FileResponse); } 11 | 12 | message FileRequest { string filename = 1; } 13 | 14 | message FileResponse { 15 | string content = 1; 16 | int64 size = 2; 17 | } 18 | 19 | enum BooleanEnum { 20 | FALSE = 0; 21 | TRUE = 1; 22 | } 23 | -------------------------------------------------------------------------------- /tools/completion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$(basename -- "$0")" == "completion.sh" ]]; then 4 | echo "Don't run $0, source it" >&2 5 | exit 1 6 | fi 7 | 8 | platform=$(uname) 9 | if [ "$platform" == "Darwin" ]; then 10 | echo "Current OS is macOS, we assume you installed bazel via Homebrew" 11 | source $(brew --prefix)/etc/bash_completion.d/bazel-complete.bash 12 | elif [ "$platform" == "Linux" ]; then 13 | echo "Current OS is Linux, we assume you installed bazel via APT" 14 | source /etc/bash_completion.d/bazel 15 | else 16 | echo "Unknown platform" 17 | exit 1 18 | fi 19 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | /node_modules 4 | /dist 5 | /src/app/core/proto 6 | 7 | # extra 8 | chrome-profiler-events.json 9 | speed-measure-plugin.json 10 | /.idea 11 | .project 12 | .classpath 13 | .c9/ 14 | *.launch 15 | .settings/ 16 | *.sublime-workspace 17 | .vscode/* 18 | .history/* 19 | /.sass-cache 20 | /connect.lock 21 | /coverage 22 | /libpeerconnection.log 23 | npm-debug.log 24 | yarn-error.log 25 | testem.log 26 | /typings 27 | .DS_Store 28 | Thumbs.db 29 | /tmp 30 | /out-tsc 31 | .firebase 32 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/toolbar/toolbar.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Reviewer 5 |
6 | 7 | 11 |
12 | 17 |
18 |
19 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/index.ts: -------------------------------------------------------------------------------- 1 | export * from './thread-comments.component'; 2 | export * from './thread-edit-comment'; 3 | export * from './comment-menu'; 4 | export * from './thread-comments.interface'; 5 | 6 | import { CommentMenuComponent } from './comment-menu'; 7 | import { ThreadCommentsComponent } from './thread-comments.component'; 8 | import { ThreadEditCommentComponent } from './thread-edit-comment'; 9 | export const ThreadCommentsComponentList = [ 10 | ThreadCommentsComponent, 11 | ThreadEditCommentComponent, 12 | CommentMenuComponent, 13 | ]; 14 | -------------------------------------------------------------------------------- /tools/reviewer/global_registry.prototxt: -------------------------------------------------------------------------------- 1 | reviewer_config { 2 | id: "startup_os" 3 | display_name: "StartupOS" 4 | config_repo: "https://github.com/google/startup-os" 5 | webapp_url: "https://startupos-5f279.firebaseapp.com" 6 | default_port: 7000 7 | firebase_config { 8 | api_key: "AIzaSyAn-A7YXlqR2JNOvlbhkVwcnsOigmphQIw" 9 | auth_domain: "startupos-5f279.firebaseapp.com" 10 | database_url: "https://startupos-5f279.firebaseio.com" 11 | project_id: "startupos-5f279" 12 | storage_bucket: "startupos-5f279.appspot.com" 13 | messaging_sender_id: "160348327132" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/grpc_auth/GrpcAuthService.java: -------------------------------------------------------------------------------- 1 | package com.google.startupos.common.grpc_auth; 2 | 3 | import com.google.startupos.common.grpc_auth.Protos.Request; 4 | import com.google.startupos.common.grpc_auth.Protos.Response; 5 | import io.grpc.stub.StreamObserver; 6 | 7 | public class GrpcAuthService extends GrpcAuthTestGrpc.GrpcAuthTestImplBase { 8 | @Override 9 | public void getNextNumber(Request request, StreamObserver responseObserver) { 10 | responseObserver.onNext(Response.newBuilder().setNumber(request.getNumber() + 1).build()); 11 | responseObserver.onCompleted(); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /third_party/maven/org/apache/commons/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "commons_csv", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/apache/commons/commons_csv", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "commons_lang3", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//visibility:public", 21 | ], 22 | exports = [ 23 | "//external:jar/mvnorg/apache/commons/commons_lang3", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/document-event.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Subject } from 'rxjs'; 3 | 4 | @Injectable() 5 | export class DocumentEventService { 6 | mouseup = new Subject(); 7 | keydown = new Subject(); 8 | 9 | constructor() { 10 | document.onmouseup = (event: MouseEvent) => { 11 | if (event.button === 0) { // left mouse button 12 | this.mouseup.next(); 13 | } 14 | }; 15 | document.onkeydown = (event: KeyboardEvent) => { 16 | this.keydown.next(event); 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/mock/auth-mock.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable, of } from 'rxjs'; 3 | 4 | @Injectable() 5 | export class AuthMockService { 6 | isOnline: boolean; 7 | 8 | constructor() { 9 | this.isOnline = true; 10 | } 11 | 12 | getUsername(userEmail: string): string { 13 | return 'testuser'; 14 | } 15 | 16 | logInWithGoogle(): Observable { 17 | this.isOnline = true; 18 | return of(); 19 | } 20 | 21 | logOut(): Observable { 22 | this.isOnline = false; 23 | return of(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/mock/firebase-mock.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable, of } from 'rxjs'; 3 | 4 | import { Diff } from '@/core/proto'; 5 | 6 | @Injectable() 7 | export class FirebaseMockService { 8 | getDiffs(): Observable { 9 | return of([new Diff()]); 10 | } 11 | 12 | getDiff(id: string): Observable { 13 | return of(new Diff()); 14 | } 15 | 16 | updateDiff(diff: Diff): Observable { 17 | return of(); 18 | } 19 | 20 | removeDiff(id: string): Observable { 21 | return of(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/directives/html.directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Directive, 3 | ElementRef, 4 | Input, 5 | OnChanges, 6 | SimpleChanges, 7 | } from '@angular/core'; 8 | 9 | // Sets the element's HTML 10 | @Directive({ 11 | selector: '[HTML]', 12 | }) 13 | export class HtmlDirective implements OnChanges { 14 | @Input() HTML: string; 15 | 16 | constructor( 17 | private elementRef: ElementRef, 18 | ) { } 19 | 20 | ngOnChanges(changes: SimpleChanges): void { 21 | if ('HTML' in changes) { 22 | this.elementRef.nativeElement.innerHTML = this.HTML; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/file-changes.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { SharedModule } from '@/shared'; 4 | import { CommitMenuComponentList } from './commit-menu'; 5 | import { FileChangesRoutingModule } from './file-changes-routing.module'; 6 | import { FileChangesComponent } from './file-changes.component'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | SharedModule, 11 | FileChangesRoutingModule, 12 | ], 13 | declarations: [ 14 | FileChangesComponent, 15 | ...CommitMenuComponentList, 16 | ], 17 | }) 18 | export class FileChangesModule { } 19 | -------------------------------------------------------------------------------- /third_party/maven/javax/annotation/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "javax_annotation_api", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnjavax/annotation/javax_annotation_api", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "jsr250_api", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//third_party/maven:__subpackages__", 21 | ], 22 | exports = [ 23 | "//external:jar/mvnjavax/annotation/jsr250_api", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /third_party/maven/net/bytebuddy/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "byte_buddy", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnnet/bytebuddy/byte_buddy", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "byte_buddy_agent", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//third_party/maven:__subpackages__", 21 | ], 22 | exports = [ 23 | "//external:jar/mvnnet/bytebuddy/byte_buddy_agent", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/encoding.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class EncodingService { 5 | encodeUint8ArrayToBase64String(binary: Uint8Array): string { 6 | return btoa(String.fromCharCode.apply(null, binary)); 7 | } 8 | 9 | decodeBase64StringToUint8Array(base64: string): Uint8Array { 10 | const raw: string = window.atob(base64); 11 | const uint8Array = new Uint8Array(new ArrayBuffer(raw.length)); 12 | for (let i = 0; i < raw.length; i++) { 13 | uint8Array[i] = raw.charCodeAt(i); 14 | } 15 | return uint8Array; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/diff-header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | import { Diff } from '@/core/proto'; 4 | 5 | // The component implements header of the diff 6 | // How it looks: https://i.imgur.com/m6lZUjR.jpg 7 | @Component({ 8 | selector: 'diff-header', 9 | templateUrl: './diff-header.component.html', 10 | }) 11 | export class DiffHeaderComponent { 12 | isReplyPopupDisplayed: boolean = false; 13 | @Input() diff: Diff; 14 | 15 | toggleReplyPopup(isReplyPopupDisplayed: boolean) { 16 | this.isReplyPopupDisplayed = isReplyPopupDisplayed; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/commit-popup/commit-popup.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | export interface CommitInfo { 4 | id: string; 5 | timestamp: number; 6 | offset: number; 7 | isVisible: boolean; 8 | isInit: boolean; 9 | } 10 | 11 | @Component({ 12 | selector: 'commit-popup', 13 | templateUrl: './commit-popup.component.html', 14 | styleUrls: ['./commit-popup.component.scss'], 15 | }) 16 | export class CommitPopupComponent { 17 | @Input() commitInfo: CommitInfo; 18 | 19 | getId(id: string): string { 20 | return id || 'Uncommited'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/deps/dependencies.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.google.startupos.tools.deps; 4 | 5 | option java_package = "com.google.startupos.tools.deps"; 6 | option java_outer_classname = "Protos"; 7 | 8 | message DependencySource { 9 | string sha1 = 1; 10 | string url = 2; 11 | string repository = 3; 12 | string sha256 = 4; 13 | } 14 | 15 | message Dependency { 16 | string artifact = 1; 17 | string lang = 2; 18 | string sha1 = 3; 19 | string repository = 4; 20 | string name = 5; 21 | string actual = 6; 22 | string bind = 7; 23 | string sha256 = 8; 24 | string url = 9; 25 | DependencySource source = 10; 26 | } 27 | -------------------------------------------------------------------------------- /third_party/maven/org/slf4j/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "slf4j_api", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/slf4j/slf4j_api", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "slf4j_simple", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//visibility:public", 21 | ], 22 | exports = [ 23 | "//external:jar/mvnorg/slf4j/slf4j_simple", 24 | ], 25 | runtime_deps = [ 26 | ":slf4j_api", 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /tools/bazel_tools/shfmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for running shfmt 4 | 5 | platform=$(uname) 6 | 7 | if [[ "$platform" == "Darwin" ]]; then 8 | BINARY=$(find . -iwholename "*shfmt_osx/file/downloaded" | head -n1) 9 | elif [[ "$platform" == "Linux" ]]; then 10 | BINARY=$(find . -iwholename "*shfmt/file/downloaded" | head -n1) 11 | else 12 | echo "shfmt does not have a binary for $platform" 13 | exit 1 14 | fi 15 | 16 | # Follow Google's style when formatting scripts 17 | # (-i 2) Indent with 2 spaces 18 | # (-ci) switch cases will be indented 19 | # (-w) write result to file instead of stdout 20 | ${BINARY} -i 2 -ci -w $* 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/thread-edit-comment/thread-edit-comment.component.html: -------------------------------------------------------------------------------- 1 | 2 | 8 |
9 | 10 | 15 | 16 | 21 |
22 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-needs-more-work.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { FirebaseConfig } from '@/core/proto'; 5 | import { GlobalRegistry } from '@/import'; 6 | import { AppModule } from './app/app.module'; 7 | import { environment } from './environments/environment'; 8 | 9 | if (environment.production) { 10 | enableProdMode(); 11 | } 12 | 13 | GlobalRegistry.getConfig().subscribe((firebaseConfig: FirebaseConfig) => { 14 | window['firebaseConfig'] = firebaseConfig.toObject(); 15 | platformBrowserDynamic().bootstrapModule(AppModule); 16 | }); 17 | -------------------------------------------------------------------------------- /third_party/maven/org/checkerframework/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "checker_compat_qual", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/checkerframework/checker_compat_qual", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "checker_qual", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//third_party/maven:__subpackages__", 21 | ], 22 | exports = [ 23 | "//external:jar/mvnorg/checkerframework/checker_qual", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/delete-diff-dialog/delete-diff-dialog.component.scss: -------------------------------------------------------------------------------- 1 | .title { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | margin-bottom: 10px; 6 | >div { 7 | margin-bottom: 8px; 8 | } 9 | } 10 | .diff-id { 11 | margin-bottom: 10px; 12 | >input { 13 | height: 30px; 14 | border-radius: 8px; 15 | border: solid 1px #8d8d8d; 16 | outline: none; 17 | padding: 1px 5px; 18 | font-size: 14px; 19 | } 20 | >.wrong-id { 21 | border-color: red; 22 | border-width: 2px; 23 | padding: 0 4px; 24 | } 25 | } 26 | .workspace { 27 | margin-bottom: 20px; 28 | } 29 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | import { AuthService } from '@/core'; 5 | 6 | @Component({ 7 | selector: 'cr-login', 8 | templateUrl: './login.component.html', 9 | styleUrls: ['./login.component.scss'], 10 | }) 11 | export class LoginComponent { 12 | constructor( 13 | private authService: AuthService, 14 | private router: Router, 15 | ) { } 16 | 17 | loginUsingGoogle(): void { 18 | this.authService.logInWithGoogle().subscribe(() => { 19 | this.router.navigate(['/diffs']); 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /third_party/maven/com/puppycrawl/tools/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "checkstyle", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/puppycrawl/tools/checkstyle", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/antlr", 14 | "//third_party/maven/com/google/guava", 15 | "//third_party/maven/commons_beanutils", 16 | "//third_party/maven/info/picocli", 17 | "//third_party/maven/net/sf/saxon:Saxon_HE", 18 | "//third_party/maven/org/antlr:antlr4_runtime", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/diff-threads/diff-threads.component.html: -------------------------------------------------------------------------------- 1 |
2 | General discussions {{ discussionService.getHeader(threads) }} 3 |
4 |
5 | 6 |
7 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/ic-search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/delete-comment-dialog/delete-comment-dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { MatDialogRef } from '@angular/material'; 3 | 4 | @Component({ 5 | selector: 'delete-comment-dialog', 6 | templateUrl: './delete-comment-dialog.component.html', 7 | styleUrls: ['./delete-comment-dialog.component.scss'], 8 | }) 9 | export class DeleteCommentDialogComponent { 10 | constructor(private dialogRef: MatDialogRef) { } 11 | 12 | close(): void { 13 | this.dialogRef.close(false); 14 | } 15 | 16 | delete(): void { 17 | this.dialogRef.close(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "src", 5 | "paths": { 6 | "@/*": ["app/*"], 7 | "src/*": ["./*"] 8 | }, 9 | "outDir": "./dist/out-tsc", 10 | "sourceMap": true, 11 | "declaration": false, 12 | "module": "es2015", 13 | "moduleResolution": "node", 14 | "newLine": "LF", 15 | "emitDecoratorMetadata": true, 16 | "experimentalDecorators": true, 17 | "importHelpers": true, 18 | "target": "es5", 19 | "typeRoots": [ 20 | "node_modules/@types" 21 | ], 22 | "lib": [ 23 | "es2018", 24 | "dom" 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /third_party/maven/org/apache/ant/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "ant", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/apache/ant/ant", 11 | ], 12 | runtime_deps = [ 13 | ":ant_launcher", 14 | ], 15 | ) 16 | 17 | java_library( 18 | name = "ant_launcher", 19 | licenses = [ 20 | "permissive", 21 | ], 22 | visibility = [ 23 | "//third_party/maven:__subpackages__", 24 | ], 25 | exports = [ 26 | "//external:jar/mvnorg/apache/ant/ant_launcher", 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /common/tests/resources/License_after.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * Hi to all Reviewer testers! :D 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/assets/status/ic-accepted.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /common/tests/resources/License_before.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * A change to demonstrate new commit menu, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /tools/reviewer/local_server/service/auth_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_package = "com.google.startupos.tools.reviewer.local_server.service"; 4 | 5 | option java_outer_classname = "AuthProtos"; 6 | 7 | package com.google.startupos.tools.reviewer.local_server.service; 8 | 9 | service AuthService { 10 | rpc postAuthData(AuthDataRequest) returns (AuthDataResponse); 11 | } 12 | 13 | message AuthDataRequest { 14 | string projectId = 1; 15 | string apiKey = 2; 16 | string jwtToken = 3; 17 | string refreshToken = 4; 18 | } 19 | 20 | // TODO: Use Empty: 21 | // https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto 22 | message AuthDataResponse {} 23 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/code-threads/code-threads.component.scss: -------------------------------------------------------------------------------- 1 | .cr-header { 2 | padding: 10px 22px; 3 | font-size: 15px; 4 | font-weight: 600; 5 | } 6 | .file-groups { 7 | padding: 14px 0; 8 | >.file-group { 9 | >.filename { 10 | margin-bottom: 10px; 11 | margin-left: 22px; 12 | font-size: 14px; 13 | font-weight: 600; 14 | cursor: pointer; 15 | display: block; 16 | text-decoration: none; 17 | color: #1a1a1a; 18 | } 19 | >.thread { 20 | margin-bottom: 14px; 21 | } 22 | >.hr { 23 | margin: 14px 0; 24 | height: 1px; 25 | background: #d8d8d8; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tools/checkstyle/license-header.txt: -------------------------------------------------------------------------------- 1 | ^\W* 2 | ^\W*Copyright 20[0-9]{2} The StartupOS Authors. 3 | ^\W* 4 | ^\W*Licensed under the Apache License, Version 2.0 \(the "License"\); 5 | ^\W*you may not use this file except in compliance with the License. 6 | ^\W*You may obtain a copy of the License at 7 | ^\W* 8 | ^\W*https://www.apache.org/licenses/LICENSE-2.0 9 | ^\W* 10 | ^\W*Unless required by applicable law or agreed to in writing, software 11 | ^\W*distributed under the License is distributed on an "AS IS" BASIS, 12 | ^\W*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ^\W*See the License for the specific language governing permissions and 14 | ^\W*limitations under the License. 15 | ^\W* -------------------------------------------------------------------------------- /common/tests/resources/License_diff.txt: -------------------------------------------------------------------------------- 1 | @@ -5,11 +5,11 @@ 2 | * you may not use this file except in compliance with the License. 3 | * You may obtain a copy of the License at 4 | * 5 | - * https://www.apache.org/licenses/LICENSE-2.0 6 | + * Hi to all Reviewer testers! :D 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | - * A change to demonstrate new commit menu, either express or implied. 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-discussion.component'; 2 | export * from './code-threads'; 3 | export * from './diff-threads'; 4 | export * from './discussion.service'; 5 | 6 | import { CodeThreadsComponent } from './code-threads'; 7 | import { DiffDiscussionComponent } from './diff-discussion.component'; 8 | import { DiffThreadsComponent } from './diff-threads'; 9 | export const DiffDiscussionComponentList = [ 10 | DiffDiscussionComponent, 11 | CodeThreadsComponent, 12 | DiffThreadsComponent, 13 | ]; 14 | 15 | import { ThreadStateService } from './thread-state.service'; 16 | export const DiffDiscussionServiceList = [ 17 | ThreadStateService, 18 | ]; 19 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/new-thread/new-thread.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Output } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'new-thread', 6 | templateUrl: './new-thread.component.html', 7 | styleUrls: ['./new-thread.component.scss'], 8 | }) 9 | export class NewThreadComponent { 10 | textarea = new FormControl(); 11 | 12 | @Output() closeEmitter = new EventEmitter(); 13 | @Output() addEmitter = new EventEmitter(); 14 | 15 | addComment(): void { 16 | this.addEmitter.emit(this.textarea.value); 17 | } 18 | 19 | closeThread(): void { 20 | this.closeEmitter.emit(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diffs/diffs.component.scss: -------------------------------------------------------------------------------- 1 | .dashboard { 2 | >.diff-group { 3 | >.diff-group-title { 4 | >.group-name { 5 | font-weight: bold; 6 | margin-right: 5px; 7 | } 8 | } 9 | >.diff { 10 | display: flex; 11 | padding: 10px 23px; 12 | border-bottom: 1px solid #d8d8d8; 13 | text-decoration: none; 14 | color: #1a1a1a; 15 | >div { 16 | font-size: 14px; 17 | } 18 | } 19 | .column-id { width: 8%; } 20 | .column-author, 21 | .column-status { width: 11%; } 22 | .column-action, 23 | .column-reviewers, 24 | .column-workspace { width: 15%; } 25 | .column-description { width: 25%; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/errorprone/README.md: -------------------------------------------------------------------------------- 1 | # Error-prone 2 | [error-prone](http://errorprone.info/) is a library intended to 3 | prevent commonly-made Java mistakes. It also makes it easy to 4 | integrate custom-built checks. 5 | 6 | # StringFmtInPrintMethodsCheck 7 | Checks that `System.<>.printf(<>)` is called instead of 8 | `System.<>.print(String.format(<>))`. Adapted from 9 | [MyCustomCheck](https://github.com/google/error-prone/blob/master/examples/plugin/bazel/java/com/google/errorprone/sample/MyCustomCheck.java) 10 | example in `error-prone` 11 | 12 | # ProtobufCheck 13 | Checks that `.getDefaultInstance()` is called instead of 14 | `.newBuilder().build()` on 15 | [protobuf](https://github.com/google/protobuf/tree/master/java) 16 | messages -------------------------------------------------------------------------------- /third_party/maven/com/google/auto/factory/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "auto_factory", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/auto/factory/auto_factory", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/auto:auto_common", 14 | "//third_party/maven/com/google/auto/value:auto_value", 15 | "//third_party/maven/com/google/googlejavaformat:google_java_format", 16 | "//third_party/maven/com/google/guava", 17 | "//third_party/maven/com/squareup:javapoet", 18 | "//third_party/maven/javax/inject:javax_inject", 19 | ], 20 | ) 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { AngularFireAuth } from '@angular/fire/auth'; 3 | import { CanActivate } from '@angular/router'; 4 | import { Observable } from 'rxjs'; 5 | import { map } from 'rxjs/operators'; 6 | import * as firebase from 'firebase/app'; 7 | 8 | @Injectable() 9 | export class AuthGuard implements CanActivate { 10 | constructor(private angularFireAuth: AngularFireAuth) { } 11 | 12 | canActivate(): Observable { 13 | return this.angularFireAuth.authState.pipe( 14 | map((userData: firebase.User) => { 15 | const isAuthorized: boolean = !!userData; 16 | return isAuthorized; 17 | }), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import { getTestBed } from '@angular/core/testing'; 4 | import { 5 | BrowserDynamicTestingModule, 6 | platformBrowserDynamicTesting, 7 | } from '@angular/platform-browser-dynamic/testing'; 8 | import 'zone.js/dist/zone-testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting(), 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/comment-menu/comment-menu.component.html: -------------------------------------------------------------------------------- 1 | 6 | 22 | -------------------------------------------------------------------------------- /tools/reviewer/rules_updater/BUILD: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTO-GENERATED 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 6 | 7 | java_binary( 8 | name = "rules_updater", 9 | srcs = ["RulesUpdater.java"], 10 | main_class = "com.google.startupos.tools.reviewer.rules_updater.RulesUpdater", 11 | deps = [ 12 | "//common", 13 | "//common:dagger_with_annotation_processor", 14 | "//common/flags", 15 | "//third_party/maven/com/google/flogger:flogger_system_backend", 16 | "//tools/reviewer:reviewer_java_proto", 17 | ], 18 | ) 19 | 20 | checkstyle_test( 21 | name = "rules_updater-checkstyle", 22 | target = ":rules_updater", 23 | ) 24 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-files/diff-files.component.scss: -------------------------------------------------------------------------------- 1 | .files { 2 | >.file { 3 | padding: 12px 23px; 4 | display: flex; 5 | background: #ecf8ff; 6 | border-top: 1px solid #808080; 7 | a { 8 | text-decoration: none; 9 | color: #1a1a1a; 10 | font-size: 14px; 11 | font-weight: 600; 12 | &:hover { 13 | text-decoration: underline; 14 | } 15 | } 16 | } 17 | >.file:last-child { 18 | border-bottom: 1px solid #808080; 19 | } 20 | >.expanded { 21 | border-top: 2px solid #808080; 22 | border-bottom: 2px solid #808080; 23 | } 24 | .column-file { width: 60%; } 25 | .column-comments, 26 | .column-modified, 27 | .column-delta, 28 | .column-reviewed { width: 10%; } 29 | } 30 | -------------------------------------------------------------------------------- /examples/proto_vs_json/data.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package com.google.startupos.proto_vs_json; 3 | 4 | option java_package = "com.google.startupos.examples.proto_vs_json"; 5 | option java_outer_classname = "Protos"; 6 | 7 | message Book { 8 | string name = 1; 9 | string author = 2; 10 | } 11 | 12 | message Person { 13 | enum PizzaTopping { 14 | PIZZA_TOPPING_NOT_SET = 0; 15 | PEPPERONI = 1; 16 | MUSHROOMS = 2; 17 | ONIONS = 3; 18 | BACON = 4; 19 | EXTRA_CHEESE = 5; 20 | BLACK_OLIVES = 6; 21 | GREEN_PEPPERS = 7; 22 | PINEAPPLE = 8; 23 | } 24 | 25 | string name = 1; 26 | string favorite_beatles_song = 2; 27 | int32 lucky_number = 3; 28 | repeated PizzaTopping favorite_pizza_topping = 4; 29 | repeated Book book_read = 5; 30 | } 31 | -------------------------------------------------------------------------------- /third_party/maven/org/apache/pdfbox/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "fontbox", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/apache/pdfbox/fontbox", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/commons_logging", 14 | ], 15 | ) 16 | 17 | java_library( 18 | name = "pdfbox", 19 | licenses = [ 20 | "permissive", 21 | ], 22 | visibility = [ 23 | "//visibility:public", 24 | ], 25 | exports = [ 26 | "//external:jar/mvnorg/apache/pdfbox/pdfbox", 27 | ], 28 | runtime_deps = [ 29 | ":fontbox", 30 | "//third_party/maven/commons_logging", 31 | ], 32 | ) 33 | -------------------------------------------------------------------------------- /commands.txt: -------------------------------------------------------------------------------- 1 | # Fix formatting of BUILD file with `buildifier` 2 | # (https://github.com/bazelbuild/buildtools/tree/master/buildifier) 3 | # Note that all paths should be absolute 4 | bazel run //tools:buildifier -- -mode=fix `pwd`/… 5 | 6 | # Find unused dependencies with `unused_deps` 7 | # (https://github.com/bazelbuild/buildtools/blob/master/unused_deps/) 8 | bazel run //tools:unused_deps -- 9 | 10 | # Bash completion 11 | # This assumes you've installed `bazel` via APT or Homebrew 12 | # To enable bundled-in autocomplete for `bazel`, run completion.sh 13 | # completion.sh present at https://github.com/google/startup-os/tree/master/tools 14 | sh tools/completion.sh 15 | 16 | # To show logs for passing tests, add this to `bazel test`: --test_output=all 17 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/new-thread/new-thread.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 10 |
11 | 12 | 17 | 18 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /examples/dagger/example1/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 4 | 5 | java_library( 6 | name = "example1_lib", 7 | srcs = glob(["**/*.java"]), 8 | deps = [ 9 | "//common:dagger_with_annotation_processor", 10 | "//third_party/maven/javax/inject:javax_inject", 11 | ], 12 | ) 13 | 14 | checkstyle_test( 15 | name = "example1_lib-checkstyle", 16 | target = ":example1_lib", 17 | ) 18 | 19 | java_binary( 20 | name = "example1", 21 | jvm_flags = [ 22 | "-Xms32m", 23 | "-Xmx128m", 24 | ], 25 | main_class = "com.google.startupos.examples.dagger.example1.App", 26 | tags = ["checkstyle_ignore"], 27 | runtime_deps = [":example1_lib"], 28 | ) 29 | -------------------------------------------------------------------------------- /examples/dagger/example2/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 4 | 5 | java_library( 6 | name = "example2_lib", 7 | srcs = glob(["**/*.java"]), 8 | deps = [ 9 | "//common:dagger_with_annotation_processor", 10 | "//third_party/maven/javax/inject:javax_inject", 11 | ], 12 | ) 13 | 14 | checkstyle_test( 15 | name = "example2_lib-checkstyle", 16 | target = ":example2_lib", 17 | ) 18 | 19 | java_binary( 20 | name = "example2", 21 | jvm_flags = [ 22 | "-Xms32m", 23 | "-Xmx128m", 24 | ], 25 | main_class = "com.google.startupos.examples.dagger.example2.App", 26 | tags = ["checkstyle_ignore"], 27 | runtime_deps = [":example2_lib"], 28 | ) 29 | -------------------------------------------------------------------------------- /third_party/maven/com/google/protobuf/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "protobuf_java", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/protobuf/protobuf_java", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "protobuf_java_util", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//visibility:public", 21 | ], 22 | exports = [ 23 | "//external:jar/mvncom/google/protobuf/protobuf_java_util", 24 | ], 25 | runtime_deps = [ 26 | ":protobuf_java", 27 | "//third_party/maven/com/google/code/gson", 28 | "//third_party/maven/com/google/guava", 29 | ], 30 | ) 31 | -------------------------------------------------------------------------------- /tools/proto_tool/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 2 | 3 | java_binary( 4 | name = "proto_tool", 5 | srcs = [ 6 | "ProtoLoader.java", 7 | "ProtoTool.java", 8 | ], 9 | data = [ 10 | "//tools:protoc", 11 | ], 12 | main_class = "com.google.startupos.tools.proto_tool.ProtoTool", 13 | deps = [ 14 | "//common/flags", 15 | "//third_party/maven/com/google/flogger", 16 | "//third_party/maven/com/google/flogger:flogger_system_backend", 17 | "//third_party/maven/com/google/protobuf:protobuf_java", 18 | "//third_party/maven/com/google/protobuf:protobuf_java_util", 19 | ], 20 | ) 21 | 22 | checkstyle_test( 23 | name = "proto_tool-checkstyle", 24 | target = ":proto_tool", 25 | ) 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/toolbar/toolbar.component.ts: -------------------------------------------------------------------------------- 1 | import { AuthService } from '@/core'; 2 | import { Component } from '@angular/core'; 3 | 4 | import { SelectDashboardService, UserService } from '@/core/services'; 5 | 6 | @Component({ 7 | selector: 'cr-toolbar', 8 | templateUrl: './toolbar.component.html', 9 | styleUrls: ['./toolbar.component.scss'], 10 | }) 11 | export class ToolbarComponent { 12 | constructor( 13 | public authService: AuthService, 14 | public userService: UserService, 15 | public selectDashboardService: SelectDashboardService, 16 | ) { } 17 | 18 | logout(): void { 19 | this.authService.logOut().subscribe(); 20 | } 21 | 22 | home(): void { 23 | this.selectDashboardService.selectDashboard(this.userService.email); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | Extra actions 14 |
15 |
16 | 21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/index.ts: -------------------------------------------------------------------------------- 1 | export * from './thread.component'; 2 | export * from './thread-comments'; 3 | export * from './thread-reply'; 4 | export * from './new-thread'; 5 | export * from './delete-comment-dialog'; 6 | export * from './thread.service'; 7 | 8 | import { DeleteCommentDialogComponent } from './delete-comment-dialog'; 9 | import { NewThreadComponent } from './new-thread'; 10 | import { ThreadCommentsComponentList } from './thread-comments'; 11 | import { ThreadReplyComponent } from './thread-reply'; 12 | import { ThreadComponent } from './thread.component'; 13 | export const ThreadComponentComponentList = [ 14 | ThreadComponent, 15 | ...ThreadCommentsComponentList, 16 | ThreadReplyComponent, 17 | DeleteCommentDialogComponent, 18 | NewThreadComponent, 19 | ]; 20 | -------------------------------------------------------------------------------- /examples/android/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /third_party/maven/com/google/flogger/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "flogger", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/flogger/flogger", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/code/findbugs:jsr305", 14 | ], 15 | ) 16 | 17 | java_library( 18 | name = "flogger_system_backend", 19 | licenses = [ 20 | "permissive", 21 | ], 22 | visibility = [ 23 | "//visibility:public", 24 | ], 25 | exports = [ 26 | "//external:jar/mvncom/google/flogger/flogger_system_backend", 27 | ], 28 | runtime_deps = [ 29 | ":flogger", 30 | "//third_party/maven/com/google/code/findbugs:jsr305", 31 | ], 32 | ) 33 | -------------------------------------------------------------------------------- /tools/reviewer/job/tasks/Task.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.tools.reviewer.job.tasks; 18 | 19 | public interface Task extends Runnable { 20 | Boolean shouldRun(); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/exception.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | import { NotificationService } from './notification.service'; 5 | 6 | @Injectable() 7 | export class ExceptionService { 8 | constructor( 9 | private router: Router, 10 | private notificationService: NotificationService, 11 | ) { } 12 | 13 | // Diff not found. 14 | // Show error message and open root 15 | diffNotFound(): void { 16 | this.notificationService.error('Diff not found'); 17 | this.router.navigate(['/']); 18 | } 19 | 20 | // File not found. 21 | // Show error message and open diff 22 | fileNotFound(diffId: number): void { 23 | this.notificationService.error('File not found'); 24 | this.router.navigate(['/diff/' + diffId]); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/dagger/example2/Class2Interface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example2; 18 | 19 | interface Class2Interface { 20 | void printClass1ObjectStatus(); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/tests/encoding.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { Author } from '@/core/proto'; 2 | import { EncodingService } from '../encoding.service'; 3 | 4 | describe('EncodingService', () => { 5 | let encodingService: EncodingService; 6 | beforeEach(() => { 7 | encodingService = new EncodingService(); 8 | }); 9 | 10 | it('should encode and decode', () => { 11 | const author = new Author(); 12 | author.setEmail('test@email.com'); 13 | author.setNeedsAttention(true); 14 | 15 | const base64: string = encodingService.encodeUint8ArrayToBase64String( 16 | author.serializeBinary(), 17 | ); 18 | const binary: Uint8Array = encodingService.decodeBase64StringToUint8Array(base64); 19 | const author2: Author = Author.deserializeBinary(binary); 20 | 21 | expect(author).toEqual(author2); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /common/firestore/ProtoEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.common.firestore; 18 | 19 | public interface ProtoEventListener { 20 | void onEvent(T value, RuntimeException error); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/file-changes/commit-menu/commit-popup/commit-popup.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | position: absolute; 3 | top: 17px; 4 | >.commit-popup { 5 | $left: 22px; 6 | $speech-arrow: 15px; 7 | margin-top: $speech-arrow; 8 | min-width: 170px; 9 | position: relative; 10 | z-index: 2; 11 | background: white; 12 | padding: 20px; 13 | border: solid 2px #8c8c8c; 14 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.5); 15 | border-radius: 8px; 16 | >.commit-id { 17 | color: #232323; 18 | font-size: 14px; 19 | } 20 | >.time { 21 | color: #434343; 22 | font-size: 12px; 23 | margin-top: 9px; 24 | } 25 | >speech-arrow { 26 | line-height: $speech-arrow; 27 | top: -$speech-arrow; 28 | left: $left; 29 | position: absolute; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tools/deps/add_maven_deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script for adding a new Maven dependency. 4 | 5 | # Usage format: tools/deps/add_maven_dep.sh 6 | # Example: tools/deps/add_maven_dep.sh junit:junit:4.12 7 | # Example: tools/deps/add_maven_dep.sh junit:junit:4.12 org.json:json:20180130 8 | 9 | # Add dependencies to dependencies.yaml: 10 | for MAVEN_ARTIFACT in "$@"; do 11 | echo "Adding $MAVEN_ARTIFACT dependency" 12 | bazel run //tools:bazel_deps -- add-dep --deps $(pwd)/dependencies.yaml --lang java $MAVEN_ARTIFACT 13 | done 14 | 15 | # Update package-lock.bzl and regenerate third_party/maven dependencies: 16 | bazel run //tools:bazel_deps -- generate -r $(pwd) -s third_party/maven/package-lock.bzl -d dependencies.yaml 17 | 18 | # Fix formatting for BUILD files 19 | bazel run //tools/formatter -- --path $(pwd)/third_party --build &>/dev/null 20 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 11 | 12 | 13 | 19 | 20 | 21 | 26 |
27 | -------------------------------------------------------------------------------- /examples/dagger/example1/Class1Interface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example1; 18 | 19 | interface Class1Interface { 20 | void setTrue(); 21 | 22 | void setFalse(); 23 | 24 | boolean getBooleanValue(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /examples/dagger/example2/Class1Interface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example2; 18 | 19 | interface Class1Interface { 20 | void setTrue(); 21 | 22 | void setFalse(); 23 | 24 | boolean getBooleanValue(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/select-dashboard/select-dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { UserService } from '@/core'; 4 | import { SelectDashboardService } from '@/core/services'; 5 | 6 | @Component({ 7 | selector: 'select-dashboard', 8 | templateUrl: './select-dashboard.component.html', 9 | styleUrls: ['./select-dashboard.component.scss'], 10 | }) 11 | export class SelectDashboardComponent { 12 | isVisible: boolean = false; 13 | 14 | constructor( 15 | public userService: UserService, 16 | public selectDashboardService: SelectDashboardService, 17 | ) { } 18 | 19 | show(): void { 20 | this.isVisible = true; 21 | } 22 | 23 | hide(): void { 24 | this.isVisible = false; 25 | } 26 | 27 | openDashboard(email: string): void { 28 | this.selectDashboardService.selectDashboard(email); 29 | this.hide(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/index.ts: -------------------------------------------------------------------------------- 1 | export * from './diff-header.component'; 2 | export * from './diff-header-titlebar'; 3 | export * from './diff-header-content'; 4 | export * from './user-popup'; 5 | export * from './reply-popup'; 6 | export * from './add-user-popup'; 7 | 8 | import { AddUserPopupComponent } from './add-user-popup'; 9 | import { DiffHeaderContentComponent } from './diff-header-content'; 10 | import { DiffHeaderTitlebarComponent } from './diff-header-titlebar'; 11 | import { DiffHeaderComponent } from './diff-header.component'; 12 | import { ReplyPopupComponent } from './reply-popup'; 13 | import { UserPopupComponent } from './user-popup'; 14 | export const DiffHeaderComponentList = [ 15 | DiffHeaderComponent, 16 | DiffHeaderTitlebarComponent, 17 | DiffHeaderContentComponent, 18 | UserPopupComponent, 19 | ReplyPopupComponent, 20 | AddUserPopupComponent, 21 | ]; 22 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/user-popup/user-popup.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 11 | 12 | {{ email }} 13 | 21 | 29 |
30 |
31 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 4 | 5 | import { AppRoutingModule } from '@/app-routing.module'; 6 | import { AppComponent } from '@/app.component'; 7 | import { CoreModule } from '@/core'; 8 | import { FirebaseModule } from '@/import'; 9 | import { LoginComponent, PageNotFoundComponent } from '@/routes'; 10 | import { SharedModule } from '@/shared'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent, 15 | PageNotFoundComponent, 16 | LoginComponent, 17 | ], 18 | imports: [ 19 | BrowserModule, 20 | BrowserAnimationsModule, 21 | AppRoutingModule, 22 | CoreModule, 23 | SharedModule, 24 | FirebaseModule, 25 | ], 26 | bootstrap: [AppComponent], 27 | }) 28 | export class AppModule { } 29 | -------------------------------------------------------------------------------- /common/flags/flags.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package com.google.startupos.common.flags; 3 | 4 | option java_package = "com.google.startupos.common.flags"; 5 | option java_outer_classname = "Proto"; 6 | option java_multiple_files = true; 7 | 8 | message FlagData { 9 | string name = 1; 10 | string className = 2; 11 | // For boolean flags, --flag_name means true and --noflag_name means false. 12 | bool isBooleanFlag = 3; 13 | string description = 4; 14 | // The default value is a toString() of the given default value. It should 15 | // be parsable back to the same value (of the original type). 16 | string default = 5; 17 | string value = 6; 18 | // Since proto3 doesn't have a hasValue() method, we can't know if a flag was 19 | // set to empty or not set at all. That's why we need this boolean. 20 | bool hasValue = 7; 21 | // Throw exception if flag has no value 22 | bool required = 8; 23 | bool isListFlag = 9; 24 | } 25 | -------------------------------------------------------------------------------- /common/CommonComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.common; 18 | 19 | import dagger.Component; 20 | import javax.inject.Singleton; 21 | 22 | @Singleton 23 | @Component(modules = CommonModule.class) 24 | public interface CommonComponent { 25 | FileUtils getFileUtils(); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/index.scss: -------------------------------------------------------------------------------- 1 | $border-color: #8d8d8d; 2 | $hr-color: #cccccc; 3 | $border-radius: 7px; 4 | $top-radius: #{$border-radius} #{$border-radius} 0px 0px; 5 | $bottom-radius: 0px 0px #{$border-radius} #{$border-radius}; 6 | 7 | .comment { 8 | display: flex; 9 | padding: 7px 19px 7px 11px; 10 | >.header { 11 | width: 132px; 12 | margin-right: 10px; 13 | } 14 | } 15 | .resolved-comment { 16 | background: #f2faff; 17 | } 18 | .unresolved-comment { 19 | background: #d6f0ff; 20 | } 21 | .edit-comment { 22 | background: #86d1ff; 23 | } 24 | textarea { 25 | padding: 8px 10px; 26 | font-size: 14px; 27 | background: white; 28 | vertical-align: bottom; 29 | margin-bottom: 10px; 30 | border-radius: 8px; 31 | outline: none; 32 | resize: none; 33 | &:focus { 34 | box-shadow: 0 0 0 1px #ff7300; 35 | } 36 | } 37 | .comment-buttons { 38 | button { 39 | margin-left: 19px; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | import { Diff, Thread } from '@/core/proto'; 4 | 5 | @Injectable() 6 | export class ThreadService { 7 | // Searches a thread in a diff by thread id 8 | getThread(diff: Diff, thread: Thread): Thread { 9 | const diffThread: Thread = this.getThreadFromList(diff.getDiffThreadList(), thread); 10 | if (diffThread) { 11 | return diffThread; 12 | } 13 | const codeThread: Thread = this.getThreadFromList(diff.getCodeThreadList(), thread); 14 | if (codeThread) { 15 | return codeThread; 16 | } 17 | } 18 | 19 | // Searches a thread in thread list by thread id 20 | private getThreadFromList(threadList: Thread[], targetThread: Thread): Thread { 21 | for (const thread of threadList) { 22 | if (thread.getId() === targetThread.getId()) { 23 | return thread; 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tutorials/proto_rename/BUILD: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTO-GENERATED 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 6 | 7 | proto_library( 8 | name = "person_proto", 9 | srcs = ["person.proto"], 10 | ) 11 | 12 | java_proto_library( 13 | name = "person_java_proto", 14 | deps = [":person_proto"], 15 | ) 16 | 17 | java_binary( 18 | name = "person_tool", 19 | srcs = ["PersonTool.java"], 20 | main_class = "com.google.startupos.tutorials.proto_rename.PersonTool", 21 | deps = [ 22 | ":person_java_proto", 23 | "//common", 24 | "//common:dagger_with_annotation_processor", 25 | "//third_party/maven/com/google/flogger:flogger_system_backend", 26 | "//third_party/maven/javax/inject:javax_inject", 27 | ], 28 | ) 29 | 30 | checkstyle_test( 31 | name = "person_tool-checkstyle", 32 | target = ":person_tool", 33 | ) 34 | -------------------------------------------------------------------------------- /crystals_game.txt: -------------------------------------------------------------------------------- 1 | A simple game, to help grow the community around the project. The game has no UI and is all based on the text files in the repo. 2 | Every developer gets "crystals" for working on the project. The developer also writes things that they are willing to trade for crystals - for example, how to cook a particular meal, or sharing knowledge about a particular subject, or things like on Fiverr. 3 | The crystals and the offering of the developers are written in a file, one per developer. If someone wants to trade, they can change "reviewer_config" file, then do a PR and offer a trade. A test makes sure that the correct amount of crystals was added and removed. In the PR description they write what was exchanged. People can then look at the GitHub history to see what people exchanged in the past, which is interesting, and also get ideas. 4 | We don't know if this game will be good or lame, so it's more like an experiment at this point. It may need some tweaking. 5 | 6 | -------------------------------------------------------------------------------- /third_party/maven/com/google/auth/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "google_auth_library_credentials", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/auth/google_auth_library_credentials", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "google_auth_library_oauth2_http", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//visibility:public", 21 | ], 22 | exports = [ 23 | "//external:jar/mvncom/google/auth/google_auth_library_oauth2_http", 24 | ], 25 | runtime_deps = [ 26 | ":google_auth_library_credentials", 27 | "//third_party/maven/com/google/guava", 28 | "//third_party/maven/com/google/http_client:google_http_client", 29 | "//third_party/maven/com/google/http_client:google_http_client_jackson2", 30 | ], 31 | ) 32 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/core/services/highlight.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import * as hljs from 'highlight.js'; 3 | 4 | @Injectable() 5 | export class HighlightService { 6 | highlight(code: string, language: string): string { 7 | return hljs.highlight(language, code, true).value; 8 | } 9 | 10 | // Replace html special chars with html entities 11 | htmlSpecialChars(code: string): string { 12 | const findSpecialChars: RegExp = /[&<>"'`=\/]/g; 13 | return code.replace(findSpecialChars, (char: string) => { 14 | switch (char) { 15 | case '&': return '&'; 16 | case '<': return '<'; 17 | case '>': return '>'; 18 | case '"': return '"'; 19 | case "'": return '''; 20 | case '/': return '/'; 21 | case '`': return '`'; 22 | case '=': return '='; 23 | default: return char; 24 | } 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/dagger/example1/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example1; 18 | 19 | public class App { 20 | public static void main(String[] args) { 21 | SomeComponent someComponent = DaggerSomeComponent.builder().build(); 22 | someComponent.getClass2Object().run(); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /examples/dagger/example2/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example2; 18 | 19 | public class App { 20 | public static void main(String[] args) { 21 | SomeComponent someComponent = DaggerSomeComponent.builder().build(); 22 | someComponent.getClass3Object().run(); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-reply/thread-reply.component.scss: -------------------------------------------------------------------------------- 1 | @import '../index'; 2 | 3 | .reply { 4 | min-height: 52px; 5 | border-radius: $bottom-radius; 6 | border: none; 7 | >.header { 8 | display: flex; 9 | align-items: flex-end; 10 | >.line-number { 11 | span { 12 | color: #232323; 13 | font-size: 12px; 14 | } 15 | } 16 | } 17 | >.message { 18 | display: flex; 19 | flex-direction: column; 20 | justify-content: center; 21 | >.action-panel { 22 | display: flex; 23 | justify-content: flex-end; 24 | align-items: center; 25 | >.resolve-checkbox { 26 | user-select: none; 27 | font-size: 14px; 28 | font-weight: 600; 29 | } 30 | >.comment-buttons { 31 | >.resolve-status { 32 | font-size: 14px; 33 | font-weight: 600; 34 | color: #24678f; 35 | } 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/delete-diff-dialog/delete-diff-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Are you absolutely sure?
3 |
This action cannot be undone!
4 |
5 |
6 | 14 |
15 |
16 | Also delete workspace 20 |
21 |
22 | 27 | 32 |
33 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/comment-menu/comment-menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Input, Output } from '@angular/core'; 2 | 3 | // Button interface to delete/edit a comment 4 | @Component({ 5 | selector: 'comment-menu', 6 | templateUrl: './comment-menu.component.html', 7 | styleUrls: ['./comment-menu.component.scss'], 8 | }) 9 | export class CommentMenuComponent { 10 | @Input() isMenuVisible: boolean = false; 11 | @Output() editEmitter = new EventEmitter(); 12 | @Output() deleteEmitter = new EventEmitter(); 13 | @Output() toggleEmitter = new EventEmitter(); 14 | 15 | toggle(): void { 16 | this.isMenuVisible = !this.isMenuVisible; 17 | this.toggleEmitter.emit(this.isMenuVisible); 18 | } 19 | 20 | edit(): void { 21 | this.editEmitter.emit(); 22 | this.toggle(); 23 | } 24 | 25 | delete(): void { 26 | this.toggle(); 27 | this.deleteEmitter.emit(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/dagger/example1/SomeComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example1; 18 | 19 | import dagger.Component; 20 | import javax.inject.Singleton; 21 | 22 | @Singleton 23 | @Component(modules = {Class1Module.class}) 24 | public interface SomeComponent { 25 | Class2 getClass2Object(); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /examples/dagger/example2/SomeComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example2; 18 | 19 | import dagger.Component; 20 | import javax.inject.Singleton; 21 | 22 | @Singleton 23 | @Component(modules = {Class2Module.class}) 24 | public interface SomeComponent { 25 | Class3 getClass3Object(); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /tools/reviewer/aa/commands/checks/FixCommandCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.tools.reviewer.aa.commands.checks; 18 | 19 | public interface FixCommandCheck { 20 | // returns whether the check identified 21 | // something wrong with the codebase 22 | boolean perform(); 23 | 24 | String name(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/select-dashboard/select-dashboard.component.html: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 19 |
20 |
21 | 24 |
25 |
26 |
27 | 28 |
29 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/log/log.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |
7 |
8 | Diff {{ diff.getId() }} 12 | by 13 | {{ getAuthor() }} 17 |
18 | 19 |
20 | 21 | 22 |
23 |
24 | {{ repoId }}: 25 | {{ status.message }} 26 |
27 |
28 | 29 | 30 |
{{ log }}
31 |
32 | -------------------------------------------------------------------------------- /examples/dagger/example2/Class2Module.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example2; 18 | 19 | import dagger.Binds; 20 | import dagger.Module; 21 | 22 | @Module(includes = Class1Module.class) 23 | abstract class Class2Module { 24 | @Binds 25 | abstract Class2Interface provideClass2Interface(Class2Impl class2Object); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /tools/fix_formatting.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Run it before committing to verify whether all files 4 | # are properly formatted so you won't fail early on review 5 | # Execute from repo root or, if using aa from base/head/startup-os 6 | 7 | RED=$(tput setaf 1) 8 | RESET=$(tput sgr0) 9 | 10 | bazel run //tools:bazel_deps -- format-deps \ 11 | --overwrite \ 12 | --deps $(pwd)/dependencies.yaml 13 | 14 | bazel run //tools/formatter -- \ 15 | --path $(pwd) \ 16 | --java --python --proto --cpp --build --sh --ts \ 17 | --ignore_directories $(find $(pwd) -name node_modules -type d | paste -s -d , -) \ 18 | &>/dev/null 19 | 20 | # Prints out an error only if both conditions are satisfied: 21 | # * we are on CircleCI 22 | # * working tree contains unstaged changes 23 | # When ran locally it silently fixes everything. 24 | if [[ ! -z "$CIRCLECI" && ! -z $(git status -s) ]]; then 25 | echo "$RED[!] Source files are not formatted$RESET" 26 | echo "Please run ''$0'' to fix it" 27 | exit 1 28 | fi 29 | -------------------------------------------------------------------------------- /tools/reviewer/remote_server/BUILD: -------------------------------------------------------------------------------- 1 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 2 | 3 | proto_library( 4 | name = "messages_proto", 5 | srcs = ["messages.proto"], 6 | ) 7 | 8 | java_proto_library( 9 | name = "messages_java_proto", 10 | deps = [":messages_proto"], 11 | ) 12 | 13 | java_binary( 14 | name = "remote_server", 15 | srcs = ["RemoteServer.java"], 16 | main_class = "com.google.startupos.tools.reviewer.remote_server.RemoteServer", 17 | deps = [ 18 | ":messages_java_proto", 19 | "//common/flags", 20 | "//third_party/maven/com/google/flogger", 21 | "//third_party/maven/com/google/flogger:flogger_system_backend", 22 | "//third_party/maven/com/google/protobuf:protobuf_java", 23 | "//third_party/maven/com/google/protobuf:protobuf_java_util", 24 | "//third_party/maven/org/json", 25 | ], 26 | ) 27 | 28 | checkstyle_test( 29 | name = "remote_server-checkstyle", 30 | target = ":remote_server", 31 | ) 32 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/diff-discussion.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | Discussion 5 |
6 |
7 | 13 |
14 |
15 |
16 | 17 | 22 | 23 | 24 | 29 |
30 |
31 | No Discussion yet 32 |
33 | -------------------------------------------------------------------------------- /tools/workspacerun/README.md: -------------------------------------------------------------------------------- 1 | # workspacerun 2 | Workspace apps runner 3 | 4 | ## How to add workspacerun to your project 5 | Run from your project: 6 | ``` 7 | npm i workspacerun --save-dev 8 | ``` 9 | 10 | ## How to publish new version to npm 11 | If you're admin of the package: 12 | ``` 13 | npm publish 14 | ``` 15 | 16 | If you're not admin: 17 | * Ask one of the npm package admins to publish 18 | or 19 | * Ask one of the npm package admins to add you as package admin 20 | [Managing npm team access](https://docs.npmjs.com/managing-team-access-to-org-packages) 21 | 22 | ## workspacerun apps 23 | json file with apps map is located here: 24 | ``` 25 | startup-os/tools/workspacerun/apps.json 26 | ``` 27 | Example of structure of map point: 28 | ``` 29 | { 30 | // Name of an app 31 | "name": "protoc", 32 | // Relative path to the app 33 | "path": "startup-os/tools/protoc/protoc.js" 34 | } 35 | ``` 36 | 37 | ## Running 38 | Run from your project: `workspacerun ` 39 | Example: `workspacerun protoc` 40 | -------------------------------------------------------------------------------- /examples/dagger/example1/Class1Module.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example1; 18 | 19 | import dagger.Module; 20 | import dagger.Provides; 21 | import javax.inject.Singleton; 22 | 23 | @Module 24 | class Class1Module { 25 | @Provides 26 | @Singleton 27 | Class1Interface provideAImpl() { 28 | return new Class1Impl(); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /examples/dagger/example2/Class1Module.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example2; 18 | 19 | import dagger.Module; 20 | import dagger.Provides; 21 | import javax.inject.Singleton; 22 | 23 | @Module 24 | class Class1Module { 25 | @Provides 26 | @Singleton 27 | Class1Interface provideAImpl() { 28 | return new Class1Impl(); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tools/bazel: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Wrapper script for downloading and running specific bazel version 4 | 5 | RED=$(tput setaf 1) 6 | GREEN=$(tput setaf 2) 7 | RESET=$(tput sgr0) 8 | 9 | REPOSITORY_ROOT=$(git rev-parse --show-toplevel) 10 | 11 | BAZEL_VERSION=$(cat $REPOSITORY_ROOT/.bazelversion) 12 | PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') 13 | BAZEL_BINARY_URL="https://releases.bazel.build/$BAZEL_VERSION/release/bazel-$BAZEL_VERSION-$PLATFORM-x86_64" 14 | BAZEL_BINARY="$HOME/.startupos/bazel-$BAZEL_VERSION" 15 | 16 | if [[ "$PLATFORM" != "darwin" ]] && [[ "$PLATFORM" != "linux" ]]; then 17 | echo "$RED[!] bazel wrapper cannot download a binary for $PLATFORM""$RESET" 18 | exit 1 19 | fi 20 | 21 | if [[ ! -x ${BAZEL_BINARY} ]]; then 22 | echo "$GREEN""Downloading bazel binary""$RESET" 23 | rm -f $(dirname ${BAZEL_BINARY})/bazel* 24 | mkdir -p $(dirname ${BAZEL_BINARY}) 25 | wget ${BAZEL_BINARY_URL} --output-document ${BAZEL_BINARY} 26 | chmod +x ${BAZEL_BINARY} 27 | fi 28 | 29 | ${BAZEL_BINARY} "$@" 30 | exit $? 31 | -------------------------------------------------------------------------------- /third_party/maven/com/google/auto/service/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "auto_service", 3 | exported_plugins = [ 4 | ":auto_service_plugin", 5 | ], 6 | licenses = [ 7 | "permissive", 8 | ], 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | exports = [ 13 | "//external:jar/mvncom/google/auto/service/auto_service", 14 | ], 15 | runtime_deps = [ 16 | "//third_party/maven/com/google/auto:auto_common", 17 | "//third_party/maven/com/google/guava", 18 | ], 19 | ) 20 | 21 | java_plugin( 22 | name = "auto_service_plugin", 23 | licenses = [ 24 | "permissive", 25 | ], 26 | processor_class = "com.google.auto.service.processor.AutoServiceProcessor", 27 | visibility = [ 28 | "//visibility:public", 29 | ], 30 | deps = [ 31 | "//external:jar/mvncom/google/auto/service/auto_service", 32 | "//third_party/maven/com/google/auto:auto_common", 33 | "//third_party/maven/com/google/guava", 34 | ], 35 | ) 36 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/code-threads/code-threads.component.html: -------------------------------------------------------------------------------- 1 |
2 | Code discussions {{ discussionService.getHeader(threads) }} 3 |
4 |
5 | 6 |
7 | {{ getFileLabel(fileGroup) }} 11 | 12 |
13 | 20 |
21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /third_party/maven/com/google/errorprone/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "error_prone_annotations", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/errorprone/error_prone_annotations", 11 | ], 12 | ) 13 | 14 | java_library( 15 | name = "error_prone_ant", 16 | licenses = [ 17 | "permissive", 18 | ], 19 | visibility = [ 20 | "//visibility:public", 21 | ], 22 | exports = [ 23 | "//external:jar/mvncom/google/errorprone/error_prone_ant", 24 | ], 25 | runtime_deps = [ 26 | "//third_party/maven/org/apache/ant", 27 | ], 28 | ) 29 | 30 | java_library( 31 | name = "javac_shaded", 32 | licenses = [ 33 | "permissive", 34 | ], 35 | visibility = [ 36 | "//third_party/maven:__subpackages__", 37 | ], 38 | exports = [ 39 | "//external:jar/mvncom/google/errorprone/javac_shaded", 40 | ], 41 | ) 42 | -------------------------------------------------------------------------------- /common/flags/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 4 | 5 | java_library( 6 | name = "flags", 7 | srcs = [ 8 | "ClassScanner.java", 9 | "Flag.java", 10 | "FlagDesc.java", 11 | "Flags.java", 12 | "GflagsParser.java", 13 | "UsagePrinter.java", 14 | ], 15 | deps = [ 16 | ":flags_java_proto", 17 | "//third_party/maven/com/google/code/findbugs:jsr305", 18 | "//third_party/maven/com/google/flogger", 19 | "//third_party/maven/com/google/guava", 20 | "//third_party/maven/javax/annotation:javax_annotation_api", 21 | "//third_party/maven/org/javassist", 22 | ], 23 | ) 24 | 25 | checkstyle_test( 26 | name = "flags-checkstyle", 27 | target = ":flags", 28 | ) 29 | 30 | proto_library( 31 | name = "flags_proto", 32 | srcs = ["flags.proto"], 33 | ) 34 | 35 | java_proto_library( 36 | name = "flags_java_proto", 37 | deps = [":flags_proto"], 38 | ) 39 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/import/material.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { NgModule } from '@angular/core'; 3 | import { 4 | MatButtonModule, 5 | MatCardModule, 6 | MatCheckboxModule, 7 | MatDialogModule, 8 | MatFormFieldModule, 9 | MatIconModule, 10 | MatInputModule, 11 | MatListModule, 12 | MatProgressSpinnerModule, 13 | MatSelectModule, 14 | MatSnackBarModule, 15 | MatTableModule, 16 | MatToolbarModule, 17 | MatTooltipModule, 18 | } from '@angular/material'; 19 | 20 | const MaterialImports = [ 21 | CommonModule, 22 | MatButtonModule, 23 | MatCardModule, 24 | MatFormFieldModule, 25 | MatIconModule, 26 | MatInputModule, 27 | MatListModule, 28 | MatProgressSpinnerModule, 29 | MatSnackBarModule, 30 | MatToolbarModule, 31 | MatTableModule, 32 | MatDialogModule, 33 | MatCheckboxModule, 34 | MatSelectModule, 35 | MatTooltipModule, 36 | ]; 37 | 38 | @NgModule({ 39 | imports: MaterialImports, 40 | exports: MaterialImports, 41 | }) 42 | export class MaterialModule { } 43 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/log/log.component.scss: -------------------------------------------------------------------------------- 1 | $border: 1px solid #c1c1c1; 2 | 3 | .log-page { 4 | >.titlebar { 5 | border-bottom: $border; 6 | >.title { 7 | margin-right: 30px; 8 | >span { 9 | margin-left: 5px; 10 | } 11 | >.diff { 12 | outline: none; 13 | cursor: pointer; 14 | user-select: none; 15 | text-decoration: none; 16 | color: black; 17 | &:hover { 18 | text-decoration: underline; 19 | } 20 | } 21 | } 22 | } 23 | >.header-menu { 24 | display: flex; 25 | padding: 10px 23px; 26 | align-items: center; 27 | background: #f3f3f3; 28 | border-bottom: $border; 29 | >.ci-status { 30 | >span { 31 | color: #808080; 32 | } 33 | } 34 | } 35 | >.log { 36 | background: #212121; 37 | color: white; 38 | margin: 10px 23px; 39 | padding: 10px 23px; 40 | font-size: 13px; 41 | white-space: pre-wrap; 42 | word-wrap: break-word; 43 | width: 900px; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution, 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | -------------------------------------------------------------------------------- /third_party/maven/com/google/auto/value/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "auto_value", 3 | exported_plugins = [ 4 | ":auto_value_plugin", 5 | ], 6 | licenses = [ 7 | "permissive", 8 | ], 9 | visibility = [ 10 | "//visibility:public", 11 | ], 12 | exports = [ 13 | "//external:jar/mvncom/google/auto/value/auto_value", 14 | ], 15 | ) 16 | 17 | java_plugin( 18 | name = "auto_value_plugin", 19 | licenses = [ 20 | "permissive", 21 | ], 22 | processor_class = "com.google.auto.value.processor.AutoValueProcessor", 23 | visibility = [ 24 | "//visibility:public", 25 | ], 26 | deps = [ 27 | "//external:jar/mvncom/google/auto/value/auto_value", 28 | ], 29 | ) 30 | 31 | java_library( 32 | name = "auto_value_annotations", 33 | licenses = [ 34 | "permissive", 35 | ], 36 | visibility = [ 37 | "//visibility:public", 38 | ], 39 | exports = [ 40 | "//external:jar/mvncom/google/auto/value/auto_value_annotations", 41 | ], 42 | ) 43 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/thread/thread-comments/thread-comments.component.scss: -------------------------------------------------------------------------------- 1 | @import '../index'; 2 | 3 | .comment { 4 | border-bottom: 1px solid $hr-color; 5 | >.header { 6 | >.username { 7 | span { 8 | font-size: 14px; 9 | font-weight: 600; 10 | } 11 | } 12 | >.time { 13 | margin-top: 5px; 14 | opacity: 0.7; 15 | font-size: 13px; 16 | } 17 | } 18 | >.content { 19 | width: calc(100% - 132px - 10px); 20 | >.read-mode { 21 | >.message { 22 | >span { 23 | font-size: 14px; 24 | } 25 | >.edited { 26 | color: #808080; 27 | } 28 | } 29 | >.ellipsis { 30 | >span { 31 | color: #808080; 32 | } 33 | } 34 | >comment-menu { 35 | height: 24px; 36 | } 37 | } 38 | >thread-edit-comment { 39 | display: flex; 40 | flex-direction: column; 41 | justify-content: center; 42 | } 43 | } 44 | } 45 | .comment:first-child { 46 | border-radius: $top-radius; 47 | } 48 | -------------------------------------------------------------------------------- /examples/proto_vs_json/BUILD: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTO-GENERATED 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 6 | 7 | proto_library( 8 | name = "data_proto", 9 | srcs = ["data.proto"], 10 | ) 11 | 12 | java_proto_library( 13 | name = "data_java_proto", 14 | deps = [":data_proto"], 15 | ) 16 | 17 | java_binary( 18 | name = "proto_vs_json_tool", 19 | srcs = ["ProtoVsJsonTool.java"], 20 | main_class = "com.google.startupos.examples.proto_vs_json.ProtoVsJsonTool", 21 | deps = [ 22 | ":data_java_proto", 23 | "//common", 24 | "//common:dagger_with_annotation_processor", 25 | "//common/flags", 26 | "//third_party/maven/com/google/flogger:flogger_system_backend", 27 | "//third_party/maven/com/google/protobuf:protobuf_java_util", 28 | "//third_party/maven/javax/inject:javax_inject", 29 | ], 30 | ) 31 | 32 | checkstyle_test( 33 | name = "proto_vs_json_tool-checkstyle", 34 | target = ":proto_vs_json_tool", 35 | ) 36 | -------------------------------------------------------------------------------- /third_party/maven/com/google/api_client/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "google_api_client", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//third_party/maven:__subpackages__", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/api_client/google_api_client", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/guava", 14 | "//third_party/maven/com/google/http_client:google_http_client_jackson2", 15 | "//third_party/maven/com/google/oauth_client:google_oauth_client", 16 | ], 17 | ) 18 | 19 | java_library( 20 | name = "google_api_client_gson", 21 | licenses = [ 22 | "permissive", 23 | ], 24 | visibility = [ 25 | "//third_party/maven:__subpackages__", 26 | ], 27 | exports = [ 28 | "//external:jar/mvncom/google/api_client/google_api_client_gson", 29 | ], 30 | runtime_deps = [ 31 | ":google_api_client", 32 | "//third_party/maven/com/google/http_client:google_http_client_gson", 33 | ], 34 | ) 35 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/add-user-popup/add-user-popup.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
6 | 13 | 14 | 17 |
18 | 23 | 28 |
29 |
30 | Email is invalid 31 |
32 |
33 | 34 |
35 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-header/user-popup/user-popup.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | position: relative; 3 | >.frame { 4 | position: absolute; 5 | $left: 22px; 6 | left: -$left; 7 | >.user-popup { 8 | $speech-arrow: 15px; 9 | margin-top: $speech-arrow; 10 | position: relative; 11 | display: flex; 12 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.5); 13 | background: white; 14 | border: solid 2px #8c8c8c; 15 | border-radius: 8px; 16 | padding: 18px 25px; 17 | flex-direction: column; 18 | align-items: center; 19 | z-index: 1; 20 | >.user-email { 21 | color: #777777; 22 | font-size: 15px; 23 | white-space: nowrap; 24 | } 25 | >.mat-button { 26 | width: 100%; 27 | font-size: 14px; 28 | color: #434343; 29 | margin-top: 16px; 30 | } 31 | >speech-arrow { 32 | line-height: $speech-arrow; 33 | top: -$speech-arrow; 34 | left: $left; 35 | position: absolute; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/dagger/example1/Class2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.examples.dagger.example1; 18 | 19 | import javax.inject.Inject; 20 | 21 | class Class2 { 22 | private final Class1Interface class1Object; 23 | 24 | @Inject 25 | Class2(Class1Interface class1Object) { 26 | this.class1Object = class1Object; 27 | } 28 | 29 | public void run() { 30 | class1Object.setTrue(); 31 | class1Object.setFalse(); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /tools/checkstyle/check-for-missing-targets.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script verifies that all Java targets except those having assigned `checkstyle_ignore` tag 4 | # do have a accompanying Checkstyle target 5 | 6 | # [1] Get all Java targets except those having assigned `checkstyle_ignore` tag 7 | bazel query 'kind(java_*, //...) - kind(java_proto_library, //...) - //third_party/... - attr("tags", "checkstyle_ignore", //...)' | sort >/tmp/all_java_targets 8 | # [2] Get all checkstyle targets' names, replace '-checkstyle' with nothing so it matches Java target name 9 | bazel query 'kind(checkstyle_test, //...)' | sed -e 's|-checkstyle||g' | sort >/tmp/checkstyle_covered_java_targets 10 | 11 | # [3] Targets in [1] which are not in [2] 12 | NON_COVERED_JAVA_TARGETS=$(comm -23 /tmp/all_java_targets /tmp/checkstyle_covered_java_targets) 13 | 14 | # Having non-empty [3] is an error 15 | if [[ ! -z "$NON_COVERED_JAVA_TARGETS" ]]; then 16 | echo "$(tput setaf 1)[!] These java targets do not have accompanying checkstyle targets:"$(tput sgr0) 17 | echo ${NON_COVERED_JAVA_TARGETS} 18 | exit 1 19 | fi 20 | -------------------------------------------------------------------------------- /tools/formatter/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 4 | 5 | java_binary( 6 | name = "formatter", 7 | srcs = ["FormatterTool.java"], 8 | main_class = "com.google.startupos.tools.formatter.FormatterTool", 9 | runtime_deps = [ 10 | ":clang_format", 11 | "//tools:buildifier", 12 | "//tools:shfmt", 13 | "//tools:tsfmt", 14 | ], 15 | deps = [ 16 | "//common/flags", 17 | "//third_party/maven/com/google/flogger:flogger_system_backend", 18 | "//third_party/maven/com/google/googlejavaformat:google_java_format", 19 | "//third_party/maven/com/google/guava", 20 | "//third_party/maven/org/slf4j:slf4j_simple", 21 | ], 22 | ) 23 | 24 | checkstyle_test( 25 | name = "formatter-checkstyle", 26 | target = ":formatter", 27 | ) 28 | 29 | sh_binary( 30 | name = "clang_format", 31 | srcs = ["clang-format.sh"], 32 | data = [ 33 | "@clang_format_bin//file", 34 | "@clang_format_bin_osx//file", 35 | ], 36 | ) 37 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/import/firebase/firebase.module.ts: -------------------------------------------------------------------------------- 1 | import { FactoryProvider, NgModule } from '@angular/core'; 2 | import { AngularFireModule, FirebaseOptionsToken } from '@angular/fire'; 3 | import { AngularFireAuth, AngularFireAuthModule } from '@angular/fire/auth'; 4 | import { AngularFireDatabase } from '@angular/fire/database'; 5 | import { AngularFirestoreModule } from '@angular/fire/firestore'; 6 | import firebase from '@firebase/app'; 7 | 8 | import { FirebaseConfig } from '@/core/proto'; 9 | 10 | const CustomFirebaseInit: FactoryProvider = { 11 | provide: FirebaseOptionsToken, 12 | deps: [], 13 | useFactory: () => { 14 | const firebaseConfig: FirebaseConfig.AsObject = window['firebaseConfig']; 15 | return firebase.initializeApp(firebaseConfig); 16 | }, 17 | }; 18 | 19 | @NgModule({ 20 | imports: [ 21 | AngularFireModule, 22 | ], 23 | exports: [ 24 | AngularFirestoreModule, 25 | AngularFireAuthModule, 26 | ], 27 | providers: [ 28 | AngularFireDatabase, 29 | AngularFireAuth, 30 | CustomFirebaseInit, 31 | ], 32 | }) 33 | export class FirebaseModule { } 34 | -------------------------------------------------------------------------------- /common/flags/UsagePrinter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.common.flags; 18 | 19 | import java.io.PrintStream; 20 | import java.util.Map; 21 | 22 | class UsagePrinter { 23 | static void printUsage(Map flags, PrintStream out) { 24 | for (String flagName : flags.keySet()) { 25 | FlagData flagData = flags.get(flagName); 26 | out.println(String.format("\t%s\t%s", flagData.getName(), flagData.getDescription())); 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /common/flags/tests/FlagTestClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.common.flags.tests; 18 | 19 | import com.google.startupos.common.flags.Flag; 20 | import com.google.startupos.common.flags.FlagDesc; 21 | 22 | class FlagTestClass { 23 | @SuppressWarnings("unused") 24 | @FlagDesc(name = "string_test_flag", description = "A flag description") 25 | static final Flag stringTestFlag = Flag.create("default value"); 26 | 27 | class ClassWithoutFlags {} 28 | } 29 | 30 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/app-testing-module.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 4 | import { RouterTestingModule } from '@angular/router/testing'; 5 | 6 | import { CoreModule } from '@/core'; 7 | import { SharedModule } from '@/shared'; 8 | import { AuthService, FirebaseService } from '@/core/services'; 9 | import { AuthMockService, FirebaseMockService } from '@/core/services/mock'; 10 | import { DiffModule } from '@/routes'; 11 | 12 | export function configureTestingModule(): void { 13 | TestBed.configureTestingModule({ 14 | imports: [ 15 | BrowserModule, 16 | BrowserAnimationsModule, 17 | CoreModule, 18 | SharedModule, 19 | RouterTestingModule, 20 | DiffModule, 21 | ], 22 | providers: [AuthMockService, FirebaseMockService], 23 | }) 24 | .overrideProvider(AuthService, { useValue: new AuthMockService() }) 25 | .overrideProvider(FirebaseService, { useValue: new FirebaseMockService() }) 26 | .compileComponents(); 27 | } 28 | -------------------------------------------------------------------------------- /tools/protoc/README.md: -------------------------------------------------------------------------------- 1 | # How to create proto functions 2 | 3 | ## Installation 4 | Run from this folder: `npm install` to install node modules of protoc. 5 | 6 | ## Setting 7 | A project must contain `proto.json` file with required paths. 8 | Example: 9 | ``` 10 | { 11 | // Path to folder, where proto functions will be located. 12 | // The path is relative to the project 13 | "exportPath": "src/app/core/proto", 14 | // List with paths to each .proto file, which are used in the project. 15 | // The paths are relative to the workspace 16 | "protoList": [ 17 | "hasadna/projects/angular-proto-firestore/proto/data.proto", 18 | "startup-os/tools/reviewer/reviewer.proto" 19 | ] 20 | } 21 | ``` 22 | 23 | ## Running 24 | Run from your project: `workspacerun protoc` to generate proto functions. [More info](https://github.com/google/startup-os/blob/master/tools/workspacerun/README.md) 25 | 26 | Alternative way, if you need to generate proto functions from outside of project root. 27 | Example: `node /path/to/script/protoc.js hasadna/projects/angular-proto-firestore` 28 | 29 | ## Supported platforms 30 | Supported on Linux and Mac only. 31 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/diff-status/status-list.ts: -------------------------------------------------------------------------------- 1 | import { Diff } from '@/core/proto'; 2 | 3 | export interface Status { 4 | label: string; 5 | icon: string; 6 | } 7 | 8 | export const statusList: Status[] = []; 9 | 10 | statusList[Diff.Status.REVIEW_NOT_STARTED] = { 11 | label: 'Review Not Started', 12 | icon: 'ic-review-not-started.svg', 13 | }; 14 | statusList[Diff.Status.NEEDS_MORE_WORK] = { 15 | label: 'Needs More Work', 16 | icon: 'ic-needs-more-work.svg', 17 | }; 18 | statusList[Diff.Status.UNDER_REVIEW] = { 19 | label: 'Under Review', 20 | icon: 'ic-under-review.svg', 21 | }; 22 | statusList[Diff.Status.ACCEPTED] = { 23 | label: 'Accepted', 24 | icon: 'ic-accepted.svg', 25 | }; 26 | statusList[Diff.Status.SUBMITTING] = { 27 | label: 'Submitting', 28 | icon: 'ic-submitting.svg', 29 | }; 30 | statusList[Diff.Status.SUBMITTED] = { 31 | label: 'Submitted', 32 | icon: 'ic-submitted.svg', 33 | }; 34 | statusList[Diff.Status.REVERTING] = { 35 | label: 'Reverting', 36 | icon: 'ic-reverting.svg', 37 | }; 38 | statusList[Diff.Status.REVERTED] = { 39 | label: 'Reverted', 40 | icon: 'ic-reverted.svg', 41 | }; 42 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/select-dashboard/select-dashboard.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | position: relative; 3 | .dashboard-button { 4 | cursor: pointer; 5 | background: #d7efff; 6 | padding: 0 18px; 7 | border: solid 1px #979797; 8 | font-size: 16px; 9 | border-radius: 8px; 10 | user-select: none; 11 | height: 30px; 12 | line-height: 0; 13 | } 14 | .dashboards { 15 | top: 40px; 16 | position: absolute; 17 | background: white; 18 | border: solid 2px #8c8c8c; 19 | border-radius: 8px; 20 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.5); 21 | margin-top: 5px; 22 | z-index: 2; 23 | >.users { 24 | padding: 5px 0; 25 | >.user { 26 | >.mat-button { 27 | width: 100%; 28 | } 29 | } 30 | } 31 | >speech-arrow { 32 | $speech-arrow: 15px; 33 | line-height: $speech-arrow; 34 | top: -$speech-arrow; 35 | left: 30px; 36 | position: absolute; 37 | } 38 | } 39 | .popup-overlay { 40 | position: fixed; 41 | top: 0; 42 | left: 0; 43 | height: 100%; 44 | width: 100%; 45 | z-index: 1; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { SharedModule } from '@/shared'; 4 | import { DeleteDiffDialogComponent } from './delete-diff-dialog'; 5 | import { DiffDiscussionComponentList } from './diff-discussion'; 6 | import { DiffDiscussionServiceList } from './diff-discussion'; 7 | import { DiffFilesComponent } from './diff-files'; 8 | import { 9 | AddUserPopupComponent, 10 | DiffHeaderComponentList, 11 | UserPopupComponent, 12 | } from './diff-header'; 13 | import { DiffRoutingModule } from './diff-routing.module'; 14 | import { DiffComponent } from './diff.component'; 15 | 16 | @NgModule({ 17 | imports: [ 18 | SharedModule, 19 | DiffRoutingModule, 20 | ], 21 | declarations: [ 22 | DiffComponent, 23 | ...DiffHeaderComponentList, 24 | DiffFilesComponent, 25 | ...DiffDiscussionComponentList, 26 | DeleteDiffDialogComponent, 27 | ], 28 | providers: [ 29 | ...DiffDiscussionServiceList, 30 | ], 31 | entryComponents: [ 32 | DeleteDiffDialogComponent, 33 | UserPopupComponent, 34 | AddUserPopupComponent, 35 | ], 36 | }) 37 | export class DiffModule { } 38 | -------------------------------------------------------------------------------- /common/flags/FlagDesc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.common.flags; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** Annotation for flags. */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.FIELD) 27 | public @interface FlagDesc { 28 | 29 | String name(); 30 | 31 | String description(); 32 | 33 | boolean required() default false; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /common/grpc_auth/README.md: -------------------------------------------------------------------------------- 1 | # grpc_auth 2 | 3 | This package shows sample gRPC server and client 4 | using an SSL-encrypted connection and authenticating via 5 | [Firebase Identity Token](https://firebase.google.com/docs/auth/admin/verify-id-tokens). 6 | 7 | ## Generate certificate and key 8 | 9 | ``` 10 | openssl req -new -newkey rsa:1024 -nodes -out ca.csr -keyout ca.key -subj '/CN=localhost' 11 | openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.csr -out ca.pem 12 | ``` 13 | 14 | # Running server 15 | 16 | Supply certificate and key files obtained at the previous step 17 | and Firebase project ID as command line arguments: 18 | 19 | 20 | ``` 21 | bazel run //common/grpc_auth:server -- \ 22 | --certificate_file ca.pem \ 23 | --key_file ca.key \ 24 | --project_id startupos-5f279 25 | ``` 26 | 27 | 28 | # Running client 29 | 30 | Supply the same certificate as to server, Firebase identity token 31 | and an integer as RPC parameter as command line arguments: 32 | 33 | 34 | ``` 35 | bazel run //common/grpc_auth:client -- \ 36 | --certificate_file ca.pem \ 37 | --token $FIREBASE_ID_TOKEN \ 38 | --n 0 39 | ``` 40 | -------------------------------------------------------------------------------- /tools/reviewer/ReviewerConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.tools.reviewer; 18 | 19 | public class ReviewerConstants { 20 | public static final String REVIEWER_COLLECTION = "/reviewer"; 21 | public static final String LAST_DIFF_NUMBER_DOCUMENT = "/reviewer/data"; 22 | public static final String DIFF_COLLECTION = "/reviewer/data/diff"; 23 | public static final String CI_REQUESTS_PATH = "/reviewer/ci/requests"; 24 | public static final String CI_RESPONSES_PATH = "/reviewer/ci/responses/%s/history"; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /common/grpc_auth/ClientAuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.google.startupos.common.grpc_auth; 2 | 3 | import io.grpc.CallOptions; 4 | import io.grpc.Channel; 5 | import io.grpc.ClientCall; 6 | import io.grpc.ClientInterceptor; 7 | import io.grpc.ForwardingClientCall; 8 | import io.grpc.Metadata; 9 | import io.grpc.MethodDescriptor; 10 | 11 | import static io.grpc.Metadata.ASCII_STRING_MARSHALLER; 12 | 13 | public class ClientAuthInterceptor implements ClientInterceptor { 14 | 15 | private String tokenValue; 16 | 17 | public ClientAuthInterceptor(String token) { 18 | tokenValue = token; 19 | } 20 | 21 | @Override 22 | public ClientCall interceptCall( 23 | MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { 24 | return new ForwardingClientCall.SimpleForwardingClientCall( 25 | channel.newCall(methodDescriptor, callOptions)) { 26 | @Override 27 | public void start(Listener listener, Metadata metadata) { 28 | metadata.put(Metadata.Key.of("token", ASCII_STRING_MARSHALLER), tokenValue); 29 | super.start(listener, metadata); 30 | } 31 | }; 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /third_party/maven/com/google/firebase/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "firebase_admin", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvncom/google/firebase/firebase_admin", 11 | ], 12 | runtime_deps = [ 13 | "//third_party/maven/com/google/api:api_common", 14 | "//third_party/maven/com/google/api_client:google_api_client", 15 | "//third_party/maven/com/google/api_client:google_api_client_gson", 16 | "//third_party/maven/com/google/auth:google_auth_library_oauth2_http", 17 | "//third_party/maven/com/google/cloud:google_cloud_firestore", 18 | "//third_party/maven/com/google/cloud:google_cloud_storage", 19 | "//third_party/maven/com/google/guava", 20 | "//third_party/maven/com/google/http_client:google_http_client", 21 | "//third_party/maven/io/netty:netty_codec_http", 22 | "//third_party/maven/io/netty:netty_handler", 23 | "//third_party/maven/io/netty:netty_transport", 24 | "//third_party/maven/org/json", 25 | "//third_party/maven/org/slf4j:slf4j_api", 26 | ], 27 | ) 28 | -------------------------------------------------------------------------------- /common/firestore/tests/BUILD: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTO-GENERATED 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 6 | 7 | java_binary( 8 | name = "firestore_client_tool", 9 | srcs = ["FirestoreClientTool.java"], 10 | main_class = "com.google.startupos.common.firestore.tests.FirestoreClientTool", 11 | deps = [ 12 | "//common", 13 | "//common:dagger_with_annotation_processor", 14 | "//common/firestore", 15 | "//common/flags", 16 | "//third_party/maven/com/google/cloud:google_cloud_firestore", 17 | "//third_party/maven/com/google/code/findbugs:jsr305", 18 | "//third_party/maven/com/google/flogger:flogger_system_backend", 19 | "//third_party/maven/com/google/guava", 20 | "//third_party/maven/javax/inject:javax_inject", 21 | "//tools/reviewer:reviewer_java_proto", 22 | "//tools/reviewer/local_server/service:auth_service", 23 | "//tools/reviewer/local_server/service:code_review_java_proto", 24 | ], 25 | ) 26 | 27 | checkstyle_test( 28 | name = "firestore_client_tool-checkstyle", 29 | target = ":firestore_client_tool", 30 | ) 31 | -------------------------------------------------------------------------------- /third_party/maven/org/apache/httpcomponents/BUILD: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "fluent_hc", 3 | licenses = [ 4 | "permissive", 5 | ], 6 | visibility = [ 7 | "//visibility:public", 8 | ], 9 | exports = [ 10 | "//external:jar/mvnorg/apache/httpcomponents/fluent_hc", 11 | ], 12 | runtime_deps = [ 13 | ":httpclient", 14 | "//third_party/maven/commons_logging", 15 | ], 16 | ) 17 | 18 | java_library( 19 | name = "httpclient", 20 | licenses = [ 21 | "permissive", 22 | ], 23 | visibility = [ 24 | "//third_party/maven:__subpackages__", 25 | ], 26 | exports = [ 27 | "//external:jar/mvnorg/apache/httpcomponents/httpclient", 28 | ], 29 | runtime_deps = [ 30 | ":httpcore", 31 | "//third_party/maven/commons_codec", 32 | "//third_party/maven/commons_logging", 33 | ], 34 | ) 35 | 36 | java_library( 37 | name = "httpcore", 38 | licenses = [ 39 | "permissive", 40 | ], 41 | visibility = [ 42 | "//third_party/maven:__subpackages__", 43 | ], 44 | exports = [ 45 | "//external:jar/mvnorg/apache/httpcomponents/httpcore", 46 | ], 47 | ) 48 | -------------------------------------------------------------------------------- /tools/reviewer/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | # Docker compose for Reviewer local server and jobs 2 | # TODO: Add jobs services 3 | # 4 | # docker-compose up - run all images 5 | # docker-compose up - run 6 | # docker-compose pull - refresh image cache. Fails if there are local images. 7 | 8 | version: "3" 9 | services: 10 | 11 | helloserver: 12 | image: gcr.io/startup-os/hello-server:latest 13 | ports: 14 | - "8000:8000" 15 | 16 | hello_server_local: 17 | image: bazel/examples/docker:hello_server 18 | ports: 19 | - "8000:8000" 20 | 21 | local_server_local: 22 | image: bazel/tools/reviewer/local_server:local_server 23 | ports: 24 | - "7000:7000" 25 | environment: 26 | - "BUILD_WORKSPACE_DIRECTORY=/base" 27 | volumes: 28 | - "/home/oferb/devel/base:/base" 29 | 30 | local_reviewer_job: 31 | image: bazel/tools/reviewer/job:job 32 | environment: 33 | - "BUILD_WORKSPACE_DIRECTORY=/base" 34 | command: 35 | - "--service_account_json=/base/local/startupos-5f279-firebase-adminsdk-v8n9e-2418a5ae73.json" 36 | - "--repo_url=https://github.com/google/startup-os" 37 | volumes: 38 | - "/home/oferb/devel/base:/base" 39 | -------------------------------------------------------------------------------- /common/firestore/MessageWithId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The StartupOS Authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.startupos.common.firestore; 18 | 19 | import com.google.auto.value.AutoValue; 20 | import com.google.protobuf.Message; 21 | 22 | /** A holder class for a proto message and an ID, typically the Firestore document ID. */ 23 | @AutoValue 24 | public abstract class MessageWithId { 25 | public abstract String id(); 26 | 27 | public abstract Message message(); 28 | 29 | static MessageWithId create(String id, Message msg) { 30 | return new AutoValue_MessageWithId(id, msg); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /tools/reviewer/remote_server/README.md: -------------------------------------------------------------------------------- 1 | # Remote Server 2 | 3 | # Workflow 4 | 5 | 6 | ## Initial Auth 7 | 1. Client authenticates with Google and gets `{code: }` message 8 | 1. Client posts `{code: }` message to `/gcode` endpoint 9 | 1. Server exchange code for `accessToken`/`refreshToken` pair 10 | 1. `/gcode` endpoint responds with `accessToken`/`refreshToken` pair 11 | 12 | Note: server has to be secured by HTTPS so code and tokens are secure in transit. 13 | 14 | ## Refreshing token 15 | 1. Client posts `refreshToken` to `/refresh` endpoint 16 | 1. Server requests new `accessToken` by providing `refreshToken` 17 | and `clientId`/`clientSecret` pair 18 | 1. `/refresh` endpoint responds with new `accessToken` 19 | 20 | 21 | # Testing locally 22 | 23 | 1. Serve `index.html` in this directory locally. The easiest way to do it is using `python`: 24 | 25 | `python2 -m SimpleHTTPServer 7000` 26 | -or- 27 | `python3 -m http.server 7000` 28 | 29 | Specifying port *is* important because there’s a 30 | whitelist set in Google Cloud’s console. 31 | 32 | 33 | 2. Go to `localhost:7000`, open Google Chrome Dev Tools, 34 | authenticate with Google and watch for `{code: <>}` message 35 | in dev console -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/routes/diff/diff-discussion/diff-discussion.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | import { Diff } from '@/core/proto'; 4 | import { ThreadStateService } from './thread-state.service'; 5 | 6 | // The component implements UI of discussions of a diff 7 | // How it looks: https://i.imgur.com/p7YnDl8.jpg 8 | @Component({ 9 | selector: 'diff-discussion', 10 | templateUrl: './diff-discussion.component.html', 11 | styleUrls: ['./diff-discussion.component.scss'], 12 | }) 13 | export class DiffDiscussionComponent { 14 | isExpanded: boolean = false; 15 | 16 | @Input() diff: Diff; 17 | 18 | constructor(private threadStateService: ThreadStateService) { } 19 | 20 | // Changes "Expand" button to "Collapse", when at least one comment is expanded 21 | commentExpanded(): void { 22 | this.isExpanded = true; 23 | } 24 | 25 | // Expands or collapses all threads 26 | toggleComments(): void { 27 | this.isExpanded = !this.isExpanded; 28 | this.threadStateService.toggle(this.isExpanded); 29 | } 30 | 31 | isThreadExist(): boolean { 32 | return this.diff.getDiffThreadList().length > 0 || this.diff.getCodeThreadList().length > 0; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /common/flags/tests/BUILD: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTO-GENERATED 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | load("//tools/checkstyle:checkstyle.bzl", "checkstyle_test") 6 | 7 | java_library( 8 | name = "flag_desc_test_class", 9 | srcs = ["FlagDescTestClass.java"], 10 | deps = ["//common/flags"], 11 | ) 12 | 13 | checkstyle_test( 14 | name = "flag_desc_test_class-checkstyle", 15 | target = ":flag_desc_test_class", 16 | ) 17 | 18 | java_library( 19 | name = "flag_test_class", 20 | srcs = ["FlagTestClass.java"], 21 | deps = ["//common/flags"], 22 | ) 23 | 24 | checkstyle_test( 25 | name = "flag_test_class-checkstyle", 26 | target = ":flag_test_class", 27 | ) 28 | 29 | java_test( 30 | name = "flags_test", 31 | srcs = ["FlagsTest.java"], 32 | test_class = "com.google.startupos.common.flags.tests.FlagsTest", 33 | deps = [ 34 | ":flag_desc_test_class", 35 | ":flag_test_class", 36 | "//common/flags", 37 | "//third_party/maven/com/google/flogger:flogger_system_backend", 38 | "//third_party/maven/junit", 39 | ], 40 | ) 41 | 42 | checkstyle_test( 43 | name = "flags_test-checkstyle", 44 | target = ":flags_test", 45 | ) 46 | -------------------------------------------------------------------------------- /tools/reviewer/webapp/src/app/shared/code-changes/code-changes.interface.ts: -------------------------------------------------------------------------------- 1 | import { DiffLine, Thread } from '@/core/proto'; 2 | 3 | export enum BlockIndex { 4 | leftFile, 5 | rightFile, 6 | } 7 | 8 | // Code line of a block of code 9 | export interface BlockLine { 10 | clearCode: string; 11 | // Code with highlighting 12 | code: string; 13 | wordChanges: string; 14 | lineNumber: number; 15 | // Is the line a placeholder? 16 | isPlaceholder: boolean; 17 | threads: Thread[]; 18 | isChanged: boolean; 19 | diffLine: DiffLine; 20 | } 21 | 22 | // Line of code changes (left and right blocks) 23 | export interface ChangesLine { 24 | // We keep it as an array to display blocks by ngFor 25 | blocks: BlockLine[]; 26 | // Is the line a line with comments? 27 | isCommentsLine: boolean; 28 | commentsLine: ChangesLine; 29 | } 30 | 31 | export interface Dictionary { 32 | [id: number]: number; 33 | } 34 | 35 | export interface CodeGroup { 36 | changes: ChangesLine[]; 37 | // To get index by line number 38 | map: Dictionary[]; 39 | isExpandUpVisible: boolean; 40 | isExpandDownVisible: boolean; 41 | } 42 | 43 | export interface Section { 44 | startLineNumber: number; 45 | endLineNumber: number; 46 | } 47 | --------------------------------------------------------------------------------