From afb78a55df67e353442e290775d5263e68e86302 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 17 Feb 2025 14:10:07 +0000 Subject: [PATCH] feat: Add more diff tests. These help make sure all repos have the same configs. --- .bazelrc | 16 ++-- .github/workflows/ci.yml | 72 +++++++++-------- .github/workflows/docker.yml | 58 +++++--------- .gitignore | 2 + btox | 2 +- c-toxcore | 2 +- ci_tools | 2 +- compose.yml | 79 +++++++++++++++++++ cspell.config.yaml | 14 ++++ debugtox | 2 +- dockerfiles | 2 +- experimental | 2 +- hs-apigen | 2 +- hs-cimple | 2 +- hs-github-tools | 2 +- hs-happy-arbitrary | 2 +- hs-msgpack-arbitrary | 2 +- hs-msgpack-binary | 2 +- hs-msgpack-json | 2 +- hs-msgpack-rpc-conduit | 2 +- hs-msgpack-testsuite | 2 +- hs-msgpack-types | 2 +- hs-schema | 2 +- hs-tokstyle | 2 +- hs-toxcore | 2 +- hs-toxcore-c | 2 +- js-toxcore-c | 2 +- jvm-toxcore-c | 2 +- py_toxcore_c | 2 +- qtox | 2 +- spec | 2 +- third_party/haskell/BUILD.bazel | 2 +- third_party/haskell/alex/build_defs.bzl | 2 +- third_party/haskell/happy/build_defs.bzl | 4 +- .../haskell/hspec-discover/build_defs.bzl | 8 +- third_party/libbacktrace.BUILD | 1 + third_party/nodejs/BUILD.bazel | 2 +- tokhub | 2 +- tools/.github | 2 +- tools/built/src/Dockerfile | 6 +- tools/built/src/Dockerfile.arm64 | 7 -- tools/built/src/Dockerfile.asan | 10 --- tools/built/src/Dockerfile.debug | 17 ---- tools/built/src/Dockerfile.dev | 2 +- tools/built/src/Dockerfile.fastbuild | 8 -- tools/built/src/Dockerfile.msan | 11 --- tools/built/src/Dockerfile.release | 10 --- tools/built/src/Dockerfile.tsan | 10 --- tools/built/src/Dockerfile.windows | 7 -- tools/built/src/setup-dev.sh | 17 ---- tools/haskell/BUILD.bazel | 2 +- tools/project/BUILD.bazel | 22 +++--- tools/project/build_defs.bzl | 70 +++++++++------- .../github/ISSUE_TEMPLATE/release.yml.base | 24 ++++++ .../{checks.base.yml => checks.yml.base} | 0 .../workflows/{ci.base.yml => ci.yml.base} | 0 .../{draft.base.yml => draft.yml.base} | 2 +- .../common/github/workflows/release.yml.base | 18 +++++ tools/project/common/reviewable/completion.js | 76 ++++++++++++++++++ tools/project/common/reviewable/settings.yaml | 4 + toxic | 2 +- toxins | 2 +- website | 2 +- 63 files changed, 386 insertions(+), 257 deletions(-) create mode 100644 compose.yml delete mode 100644 tools/built/src/Dockerfile.arm64 delete mode 100644 tools/built/src/Dockerfile.asan delete mode 100644 tools/built/src/Dockerfile.debug delete mode 100644 tools/built/src/Dockerfile.fastbuild delete mode 100644 tools/built/src/Dockerfile.msan delete mode 100644 tools/built/src/Dockerfile.release delete mode 100644 tools/built/src/Dockerfile.tsan delete mode 100644 tools/built/src/Dockerfile.windows create mode 100644 tools/project/common/github/ISSUE_TEMPLATE/release.yml.base rename tools/project/common/github/workflows/{checks.base.yml => checks.yml.base} (100%) rename tools/project/common/github/workflows/{ci.base.yml => ci.yml.base} (100%) rename tools/project/common/github/workflows/{draft.base.yml => draft.yml.base} (81%) create mode 100644 tools/project/common/github/workflows/release.yml.base create mode 100644 tools/project/common/reviewable/completion.js create mode 100644 tools/project/common/reviewable/settings.yaml diff --git a/.bazelrc b/.bazelrc index 2fb3f837..401d6260 100644 --- a/.bazelrc +++ b/.bazelrc @@ -754,8 +754,8 @@ build:nix --build_tag_filters=-windows,-macos build:nix --test_tag_filters=-windows,-macos # Non-Nix local toolchains. Nix-Haskell doesn't work with local toolchains. -build:local --build_tag_filters=-no-cross,-windows,-macos,-ui -build:local --test_tag_filters=-no-cross,-windows,-macos,-ui +build:local --build_tag_filters=-windows,-macos,-ui,-java,-javascript,-haskell,-no-cross +build:local --test_tag_filters=-windows,-macos,-ui,-java,-javascript,-haskell,-no-cross build:zig-cross --copt=-fPIC build:zig-cross --dynamic_mode=off @@ -768,22 +768,22 @@ build:zig-cross --per_file_copt='external/sdl2[:/]@-DICONV_INBUF_NONCONST=1' build:linux-arm64-musl --config=zig-cross build:linux-arm64-musl --platforms=@zig_sdk//platform:linux_arm64 build:linux-arm64-musl --extra_toolchains=@zig_sdk//toolchain:linux_arm64_musl -build:linux-arm64-musl --build_tag_filters=-no-cross,-qt,-windows,-macos,-java -build:linux-arm64-musl --test_tag_filters=-no-cross,-qt,-windows,-macos,-java +build:linux-arm64-musl --build_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross +build:linux-arm64-musl --test_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross build:linux-x86_64-musl --config=zig-cross build:linux-x86_64-musl --platforms=@zig_sdk//platform:linux_amd64 build:linux-x86_64-musl --extra_toolchains=@zig_sdk//toolchain:linux_amd64_musl -build:linux-x86_64-musl --build_tag_filters=-no-cross,-qt,-windows,-macos -build:linux-x86_64-musl --test_tag_filters=-no-cross,-qt,-windows,-macos +build:linux-x86_64-musl --build_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross +build:linux-x86_64-musl --test_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross build:linux-x86_64-musl --linkopt='-static' build:windows-x86_64 --config=zig-cross build:windows-x86_64 --linkopt="-lshlwapi" build:windows-x86_64 --platforms=@zig_sdk//platform:windows_amd64 build:windows-x86_64 --extra_toolchains=@zig_sdk//toolchain:windows_amd64 -build:windows-x86_64 --build_tag_filters=-no-cross,-qt,-macos,-java,-no-windows -build:windows-x86_64 --test_tag_filters=-no-cross,-qt,-macos,-java,-no-windows +build:windows-x86_64 --build_tag_filters=-no-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross +build:windows-x86_64 --test_tag_filters=-no-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross try-import %workspace%/.local.bazelrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 739e4ef8..3d8832a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,60 +42,68 @@ jobs: docker-test: runs-on: ubuntu-22.04 steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - uses: actions/checkout@v4 with: submodules: recursive - name: Build toxchat/toktok-stack:latest-third_party - run: docker build -t toxchat/toktok-stack:latest-third_party -f tools/built/src/Dockerfile.third_party . + run: docker compose build third_party - name: Build toxchat/toktok-stack:latest - run: docker build -t toxchat/toktok-stack:latest -f tools/built/src/Dockerfile . + run: docker compose build latest - - name: Build toxchat/toktok-stack:latest-msan + - name: Set up environment run: | - docker build -t toxchat/toktok-stack:latest-msan -f tools/built/src/Dockerfile.msan . - docker rmi toxchat/toktok-stack:latest-msan - docker system prune -f + echo "GROUP_ID=$(id -g)" >.env + echo "USER_ID=$(id -u)" >>.env - - name: Build toxchat/toktok-stack:latest-asan + - name: Build for msan run: | - docker build -t toxchat/toktok-stack:latest-asan -f tools/built/src/Dockerfile.asan . - docker rmi toxchat/toktok-stack:latest-asan - docker system prune -f + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/msan.tar) + docker compose run --rm msan + docker kill bazel-cache + rm -rf ../bazel-cache - - name: Build toxchat/toktok-stack:latest-release + - name: Build for asan run: | - docker build -t toxchat/toktok-stack:latest-release -f tools/built/src/Dockerfile.release . - docker rmi toxchat/toktok-stack:latest-release - docker system prune -f + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/asan.tar) + docker compose run --rm asan + docker kill bazel-cache + rm -rf ../bazel-cache - - name: Build toxchat/toktok-stack:latest-arm64 + - name: Build for release run: | - docker build -t toxchat/toktok-stack:latest-arm64 -f tools/built/src/Dockerfile.arm64 . - docker rmi toxchat/toktok-stack:latest-arm64 - docker system prune -f + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/release.tar) + docker compose run --rm release + docker kill bazel-cache + rm -rf ../bazel-cache - - name: Build toxchat/toktok-stack:latest-windows + - name: Build for arm64 run: | - docker build -t toxchat/toktok-stack:latest-windows -f tools/built/src/Dockerfile.windows . - docker rmi toxchat/toktok-stack:latest-windows - docker system prune -f + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/arm64.tar) + docker compose run --rm arm64 + docker kill bazel-cache + rm -rf ../bazel-cache - - name: Build toxchat/toktok-stack:latest-fastbuild - run: docker build -t toxchat/toktok-stack:latest-fastbuild -f tools/built/src/Dockerfile.fastbuild . + - name: Build for windows + run: | + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/windows.tar) + docker compose run --rm windows + docker kill bazel-cache + rm -rf ../bazel-cache - - name: Build toxchat/toktok-stack:latest-dev + - name: Build for fastbuild run: | - sed -i -e 's/ --remote_download_outputs=all//' tools/built/src/setup-dev.sh - docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev . + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/fastbuild.tar) + docker compose run --rm fastbuild + docker kill bazel-cache + rm -rf ../bazel-cache + + - name: Build toxchat/toktok-stack:latest-dev + run: docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev . local-build: runs-on: ubuntu-24.04 - # if: false env: CC: clang CXX: clang++ @@ -121,7 +129,7 @@ jobs: run: | . /home/runner/.nix-profile/etc/profile.d/nix.sh nix-shell -p patchelf --run "patchelf --version" - bazel test --config=local --config=remote -- //... -//jvm-toxcore-c/... -//third_party/... + bazel test --config=ci --config=local --config=remote -- //... -//jvm-toxcore-c/... -//third_party/... macos: runs-on: macos-14 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0ce27bef..58c175d4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -68,29 +68,9 @@ jobs: cache-to: type=inline push: true - docker-fastbuild: - runs-on: ubuntu-22.04 - needs: [docker] - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - file: tools/built/src/Dockerfile.fastbuild - tags: toxchat/toktok-stack:latest-fastbuild - cache-from: type=registry,ref=toxchat/toktok-stack:latest-fastbuild - cache-to: type=inline - push: true - docker-dev: runs-on: ubuntu-22.04 - needs: [docker-fastbuild] + needs: [docker] steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -108,26 +88,30 @@ jobs: cache-to: type=inline push: true - docker-built: + bazel-cache: strategy: fail-fast: false matrix: - flavour: [release, debug, asan, msan, tsan, arm64, windows] + flavour: [fastbuild, release, debug, asan, msan, tsan, arm64, windows] runs-on: ubuntu-22.04 needs: [docker] steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - uses: docker/login-action@v3 + - name: Set up environment + run: | + echo "GROUP_ID=$(id -g)" >.env + echo "USER_ID=$(id -u)" >>.env + - name: Download current cache and run the build + run: | + tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/${{ matrix.flavour }}.tar) || mkdir -p ../bazel-cache + docker compose run --rm ${{ matrix.flavour }} + tar -C .. -cf ${{ matrix.flavour }}.tar bazel-cache + - name: Upload updated cache to nightly release + uses: ncipollo/release-action@v1 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - file: tools/built/src/Dockerfile.${{ matrix.flavour }} - tags: toxchat/toktok-stack:latest-${{ matrix.flavour }} - cache-from: type=registry,ref=toxchat/toktok-stack:latest-${{ matrix.flavour }} - cache-to: type=inline - push: true + allowUpdates: true + tag: nightly + omitBodyDuringUpdate: true + omitNameDuringUpdate: true + prerelease: true + replacesArtifacts: true + artifacts: ${{ matrix.flavour }}.tar diff --git a/.gitignore b/.gitignore index 853da4f0..40cfcca3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Build artifacts. /.cache /.clangd +/.env /.vs /.vscode /.stack-work @@ -8,6 +9,7 @@ /bazel-* /cov-analysis* /external +/go.work.sum /toolchain /MODULE.bazel.lock *.log diff --git a/btox b/btox index d6d4caac..33af4a8b 160000 --- a/btox +++ b/btox @@ -1 +1 @@ -Subproject commit d6d4caac43c250137b1c81ed953d9f23d9abde7f +Subproject commit 33af4a8be6239d53cf8846988dad61791dcd2335 diff --git a/c-toxcore b/c-toxcore index c53c30e0..8278e9cd 160000 --- a/c-toxcore +++ b/c-toxcore @@ -1 +1 @@ -Subproject commit c53c30e09d996ceb6835287b4050841310a64e7c +Subproject commit 8278e9cda46ca6a506a2f987b05cc84d304daa8b diff --git a/ci_tools b/ci_tools index e27d696b..ad4f357f 160000 --- a/ci_tools +++ b/ci_tools @@ -1 +1 @@ -Subproject commit e27d696b55389106697f8cec6f2d35e148c860ac +Subproject commit ad4f357fa463d47ce4678cd43fc854bd305ac8b4 diff --git a/compose.yml b/compose.yml new file mode 100644 index 00000000..4ba2186d --- /dev/null +++ b/compose.yml @@ -0,0 +1,79 @@ +x-shared-params: &shared_params + container_name: bazel-build + depends_on: + - bazel-cache + build: + context: . + dockerfile: tools/built/src/Dockerfile + image: toxchat/toktok-stack:latest + environment: + HOME: /home/builder + +services: + bazel-cache: + user: ${USER_ID}:${GROUP_ID} + container_name: bazel-cache + image: buchgr/bazel-remote-cache + restart: on-failure + ports: + - "9092:9092" + command: --max_size=1 + volumes: + - ../bazel-cache:/data + environment: + BAZEL_REMOTE_GRPC_PORT: 9092 + third_party: + build: + context: . + dockerfile: tools/built/src/Dockerfile.third_party + image: toxchat/toktok-stack:latest-third_party + + latest: + <<: *shared_params + + fastbuild: + <<: *shared_params + command: bazel test + --remote_cache=grpc://bazel-cache:9092 + //... + + arm64: + <<: *shared_params + command: bazel build + --remote_cache=grpc://bazel-cache:9092 + --config=linux-arm64-musl + //... + + asan: + <<: *shared_params + command: bazel test + --remote_cache=grpc://bazel-cache:9092 + --config=asan + --build_tag_filters=-haskell,-fuzz-test + --test_tag_filters=-haskell,-fuzz-test + //c-toxcore/... + + msan: + <<: *shared_params + command: bazel test + --remote_cache=grpc://bazel-cache:9092 + --config=msan + --build_tag_filters=-haskell,-fuzz-test + --test_tag_filters=-haskell,-fuzz-test + -- + //c-toxcore/auto_tests/... + -//c-toxcore/auto_tests:proxy_test + + release: + <<: *shared_params + command: bazel test + --remote_cache=grpc://bazel-cache:9092 + --config=release + //... + + windows: + <<: *shared_params + command: bazel build + --remote_cache=grpc://bazel-cache:9092 + --config=windows-x86_64 + //... diff --git a/cspell.config.yaml b/cspell.config.yaml index b92612f6..c93738f2 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -10,17 +10,26 @@ words: - blargh - blyat - blyatyfy + - buildifier - buildx - ccache - choco - citri + - codesign + - createdmg - depfile + - depset + - diffutils - dockerfiles - dryrun - dups - endforeach - fastbuild - flathub + - fmap + - genrule + - gitmodules + - hditool - icotool - libc - libfuzzer @@ -30,6 +39,7 @@ words: - magick - makensis - mempty + - mkstamp - mypy - ncipollo - nixpkgs @@ -38,7 +48,11 @@ words: - qtox - qttools - realpath + - rfind + - runfiles - sqlcipher + - srcs + - startswith - teehee - toktok - toplevel diff --git a/debugtox b/debugtox index 725f7b96..65ce9aef 160000 --- a/debugtox +++ b/debugtox @@ -1 +1 @@ -Subproject commit 725f7b96dabcf207c61a16bc9808b76c6a0985b8 +Subproject commit 65ce9aeff1e007b237895c0d9c7281ab7970e567 diff --git a/dockerfiles b/dockerfiles index 45d1ed0f..bcc88e05 160000 --- a/dockerfiles +++ b/dockerfiles @@ -1 +1 @@ -Subproject commit 45d1ed0f9fb988e7b82410c1879b22ea964217a7 +Subproject commit bcc88e056a8dff20074d4b4821f0dd68a87351c4 diff --git a/experimental b/experimental index ee687b90..e643b4bd 160000 --- a/experimental +++ b/experimental @@ -1 +1 @@ -Subproject commit ee687b90c0d5d0d05564d726bedbd63a7c54e033 +Subproject commit e643b4bd984508fca0da9515a7a459943d244ff3 diff --git a/hs-apigen b/hs-apigen index 402113b3..f9be22fb 160000 --- a/hs-apigen +++ b/hs-apigen @@ -1 +1 @@ -Subproject commit 402113b302e1b90a64156f1d61540065bc8db2f2 +Subproject commit f9be22fb4e95e979fa0b9908817bd8dcc4518c19 diff --git a/hs-cimple b/hs-cimple index 9fabfbdb..f4370972 160000 --- a/hs-cimple +++ b/hs-cimple @@ -1 +1 @@ -Subproject commit 9fabfbdb9bdb36ed5081db88abfa555517621263 +Subproject commit f4370972cefe15ff259786cc50fdce5896890433 diff --git a/hs-github-tools b/hs-github-tools index e425a9f3..71820fc5 160000 --- a/hs-github-tools +++ b/hs-github-tools @@ -1 +1 @@ -Subproject commit e425a9f3a5ab642548e2f1d2cba441fa0e73d69f +Subproject commit 71820fc5701dc08a776e37c217cfbc089b81e25d diff --git a/hs-happy-arbitrary b/hs-happy-arbitrary index dbd66a8a..3ce1b5f4 160000 --- a/hs-happy-arbitrary +++ b/hs-happy-arbitrary @@ -1 +1 @@ -Subproject commit dbd66a8a1fe54176674443e9c8f528f197b88389 +Subproject commit 3ce1b5f4530724a0b18feb96a76afcb6f696db09 diff --git a/hs-msgpack-arbitrary b/hs-msgpack-arbitrary index 635727df..eee50aa8 160000 --- a/hs-msgpack-arbitrary +++ b/hs-msgpack-arbitrary @@ -1 +1 @@ -Subproject commit 635727df374c923364b6e3565868ea8007cf169a +Subproject commit eee50aa8883a7e0745093e100372e2a8ae975ebe diff --git a/hs-msgpack-binary b/hs-msgpack-binary index 6278b878..06e0f650 160000 --- a/hs-msgpack-binary +++ b/hs-msgpack-binary @@ -1 +1 @@ -Subproject commit 6278b87886d64874886ed114e5656123f5375734 +Subproject commit 06e0f650a44214e8cbb700d1e7e9992f1adccefa diff --git a/hs-msgpack-json b/hs-msgpack-json index 271028dd..bea15c0b 160000 --- a/hs-msgpack-json +++ b/hs-msgpack-json @@ -1 +1 @@ -Subproject commit 271028dd4fd32f0768a49f9d275f47ee14209c62 +Subproject commit bea15c0bdfd5e442269f8aed28fdca74fe2d9b9a diff --git a/hs-msgpack-rpc-conduit b/hs-msgpack-rpc-conduit index 6ff7be4a..40125922 160000 --- a/hs-msgpack-rpc-conduit +++ b/hs-msgpack-rpc-conduit @@ -1 +1 @@ -Subproject commit 6ff7be4af3e4932dc3ad6f1365fdd8586626a0f7 +Subproject commit 40125922483122f0c267cc3e1a73edf3bcbe9898 diff --git a/hs-msgpack-testsuite b/hs-msgpack-testsuite index d06d89df..e02a69c0 160000 --- a/hs-msgpack-testsuite +++ b/hs-msgpack-testsuite @@ -1 +1 @@ -Subproject commit d06d89df93400232a6a154af51fc4af12c47f11c +Subproject commit e02a69c052569cd898265f577d963cc9d3f41929 diff --git a/hs-msgpack-types b/hs-msgpack-types index e9921bd4..67bff417 160000 --- a/hs-msgpack-types +++ b/hs-msgpack-types @@ -1 +1 @@ -Subproject commit e9921bd495295878689eda65f45144a2cec0da89 +Subproject commit 67bff417c9f6e202e17815247e3f48d109613cbe diff --git a/hs-schema b/hs-schema index 13e6283a..d9ec8dcc 160000 --- a/hs-schema +++ b/hs-schema @@ -1 +1 @@ -Subproject commit 13e6283ac943128c07dc2417257db9b62bd13202 +Subproject commit d9ec8dcce60bb448ba4de503c34520f7bd2b1786 diff --git a/hs-tokstyle b/hs-tokstyle index 30db545c..17ee7ee9 160000 --- a/hs-tokstyle +++ b/hs-tokstyle @@ -1 +1 @@ -Subproject commit 30db545cf8cc9f9ebc92349a7804a03974d1b0e8 +Subproject commit 17ee7ee98cbce58c87e6823867bc6920021603d8 diff --git a/hs-toxcore b/hs-toxcore index 2eac4af6..2d2a7e23 160000 --- a/hs-toxcore +++ b/hs-toxcore @@ -1 +1 @@ -Subproject commit 2eac4af6bf3b9ff6ea4d14bdccf05fadc3ed1fe2 +Subproject commit 2d2a7e236e7b0c9c0f0894b02c1d6e31268b45c2 diff --git a/hs-toxcore-c b/hs-toxcore-c index e6357d76..ecca225f 160000 --- a/hs-toxcore-c +++ b/hs-toxcore-c @@ -1 +1 @@ -Subproject commit e6357d76e53da25d665f0f340ed28699318c31c8 +Subproject commit ecca225faf5f7ef5c1687fc46713e3fdb81866c4 diff --git a/js-toxcore-c b/js-toxcore-c index 446d964d..e38e866c 160000 --- a/js-toxcore-c +++ b/js-toxcore-c @@ -1 +1 @@ -Subproject commit 446d964dc532fdc191c993675d58ae75348a0529 +Subproject commit e38e866c5bb25b36aca961c7a4c30fc6a27ead04 diff --git a/jvm-toxcore-c b/jvm-toxcore-c index 6bd2b33d..10192a26 160000 --- a/jvm-toxcore-c +++ b/jvm-toxcore-c @@ -1 +1 @@ -Subproject commit 6bd2b33d3dbc6c8ecb774c008cbdf643eac4d8e9 +Subproject commit 10192a26782956f7fd3e2895e4a4b17cb0904e6d diff --git a/py_toxcore_c b/py_toxcore_c index 23f477af..33ab7178 160000 --- a/py_toxcore_c +++ b/py_toxcore_c @@ -1 +1 @@ -Subproject commit 23f477af20e2fefae6e68eb6f89dfc892c1ab6d2 +Subproject commit 33ab7178954896950c9c815985866877c59cc9e0 diff --git a/qtox b/qtox index 30ea2f81..babd84b9 160000 --- a/qtox +++ b/qtox @@ -1 +1 @@ -Subproject commit 30ea2f81ab4da55c2ad124b0b0afeabd097644e8 +Subproject commit babd84b915b3efa2e35d7a8f3c00b54faf3aae9c diff --git a/spec b/spec index 37095642..36f048dd 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit 37095642205dbf6a98bfadeb6144efa685799845 +Subproject commit 36f048ddcbb18086f95d95415bc6485869c35fbf diff --git a/third_party/haskell/BUILD.bazel b/third_party/haskell/BUILD.bazel index fa710c0f..2f96abe1 100644 --- a/third_party/haskell/BUILD.bazel +++ b/third_party/haskell/BUILD.bazel @@ -9,7 +9,7 @@ licenses(["notice"]) # can be referenced as dependencies. [haskell_toolchain_library( name = name, - tags = ["no-cross"], + tags = ["haskell"], ) for name in [ "aeson", "aeson-pretty", diff --git a/third_party/haskell/alex/build_defs.bzl b/third_party/haskell/alex/build_defs.bzl index 6c644ab0..67ad00b4 100644 --- a/third_party/haskell/alex/build_defs.bzl +++ b/third_party/haskell/alex/build_defs.bzl @@ -15,6 +15,6 @@ def alex_lexer(name, src): "-o $(location %s)" % out, "$(location %s)" % src, ]), - tags = ["no-cross"], + tags = ["haskell"], tools = [_ALEX], ) diff --git a/third_party/haskell/happy/build_defs.bzl b/third_party/haskell/happy/build_defs.bzl index 4e3692a9..9494caf8 100644 --- a/third_party/haskell/happy/build_defs.bzl +++ b/third_party/haskell/happy/build_defs.bzl @@ -32,7 +32,7 @@ def happy_parser(name, src, glr = False, preproc = None, preproc_tool = None): "$<", "$@", ]), - tags = ["no-cross"], + tags = ["haskell"], tools = [preproc] + ([preproc_tool] if preproc_tool else []), ) src = pp_src @@ -48,6 +48,6 @@ def happy_parser(name, src, glr = False, preproc = None, preproc_tool = None): "-o $(location %s)" % driver_out, "$(location %s)" % src, ] + happy_flags), - tags = ["no-cross"], + tags = ["haskell"], tools = [_HAPPY], ) diff --git a/third_party/haskell/hspec-discover/build_defs.bzl b/third_party/haskell/hspec-discover/build_defs.bzl index 30ae96bc..c8017d64 100644 --- a/third_party/haskell/hspec-discover/build_defs.bzl +++ b/third_party/haskell/hspec-discover/build_defs.bzl @@ -28,7 +28,7 @@ def hspec_library(name, src_strip_prefix, **kwargs): module_name = module_name, ), ]), - tags = ["no-cross"], + tags = ["haskell"], tools = [_HSPEC_DISCOVER], ) @@ -36,7 +36,7 @@ def hspec_library(name, src_strip_prefix, **kwargs): name = name, srcs = srcs + [name + "_hspec_driver"], src_strip_prefix = src_strip_prefix, - tags = ["no-cross"], + tags = ["haskell"], **kwargs ) @@ -52,7 +52,7 @@ def hspec_test(name, visibility=["//tools/haskell:__pkg__"], **kwargs): "cd %s/test" % native.package_name(), "../../$(location %s) $$(basename $@) Main.hs ../../$@" % _HSPEC_DISCOVER, ]), - tags = ["no-cross"], + tags = ["haskell"], tools = [_HSPEC_DISCOVER], ) @@ -61,7 +61,7 @@ def hspec_test(name, visibility=["//tools/haskell:__pkg__"], **kwargs): srcs = srcs + [name + "_hspec_driver"], main_file = "test/Spec.hs", src_strip_prefix = "test", - tags = ["no-cross"], + tags = ["haskell"], visibility = visibility, **kwargs ) diff --git a/third_party/libbacktrace.BUILD b/third_party/libbacktrace.BUILD index 4f51231a..8eb5f0ee 100644 --- a/third_party/libbacktrace.BUILD +++ b/third_party/libbacktrace.BUILD @@ -49,6 +49,7 @@ cc_library( "state.c", "@toktok//third_party/libbacktrace:config", ], + hdrs = ["backtrace.h"], copts = ["-I$(GENDIR)/third_party/libbacktrace"], visibility = ["//visibility:public"], ) diff --git a/third_party/nodejs/BUILD.bazel b/third_party/nodejs/BUILD.bazel index 5fee2042..ee8525b1 100644 --- a/third_party/nodejs/BUILD.bazel +++ b/third_party/nodejs/BUILD.bazel @@ -3,5 +3,5 @@ load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "hello", entry_point = "hello.js", - tags = ["no-cross"], + tags = ["javascript"], ) diff --git a/tokhub b/tokhub index 2985fd6d..60251782 160000 --- a/tokhub +++ b/tokhub @@ -1 +1 @@ -Subproject commit 2985fd6d762fe166c517a551fba4cfd2abe9c1fd +Subproject commit 602517825cb386e81be5df39b2973c794760a274 diff --git a/tools/.github b/tools/.github index 6ba11def..64792593 160000 --- a/tools/.github +++ b/tools/.github @@ -1 +1 @@ -Subproject commit 6ba11def37f38a13e0d1654e686ba4298b4ad26a +Subproject commit 64792593bfe9fd8a5fb3adfa7389ce54e56467bd diff --git a/tools/built/src/Dockerfile b/tools/built/src/Dockerfile index c2d001a6..164c072f 100644 --- a/tools/built/src/Dockerfile +++ b/tools/built/src/Dockerfile @@ -4,11 +4,7 @@ FROM toxchat/toktok-stack:latest-third_party # includes all of the sources of all projects. COPY --chown=builder:users . /src/workspace/ -RUN echo 'build --config=ci --config=nix' >/src/workspace/.local.bazelrc; \ - if curl -s -m1 http://code.tox.chat/bazel/ \ - | grep "resource name must be a SHA256 hash"; then \ - echo 'build --config=remote-grpc' | tee -a .local.bazelrc; \ - fi +RUN echo 'build --config=ci --config=nix' >/src/workspace/.local.bazelrc # Finally, we run another aquery. This will download some more dependencies, but # the most expensive ones should already have been downloaded in the third_party diff --git a/tools/built/src/Dockerfile.arm64 b/tools/built/src/Dockerfile.arm64 deleted file mode 100644 index 2f30fa05..00000000 --- a/tools/built/src/Dockerfile.arm64 +++ /dev/null @@ -1,7 +0,0 @@ -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=linux-arm64-musl' >>.local.bazelrc - -RUN sudo nix-daemon --daemon & bazel build -k //... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.asan b/tools/built/src/Dockerfile.asan deleted file mode 100644 index 785405c1..00000000 --- a/tools/built/src/Dockerfile.asan +++ /dev/null @@ -1,10 +0,0 @@ -# Pre-build //third_party in asan mode for speedy PR builds on sub-repos. -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=asan' >>.local.bazelrc - -RUN sudo nix-daemon --daemon \ - & bazel build -k //third_party/... -RUN bazel test -k //third_party/... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.debug b/tools/built/src/Dockerfile.debug deleted file mode 100644 index 948cfe2f..00000000 --- a/tools/built/src/Dockerfile.debug +++ /dev/null @@ -1,17 +0,0 @@ -# Pre-build //third_party in debug mode for speedy PR builds on sub-repos. -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=debug' >>.local.bazelrc - -RUN sudo nix-daemon --daemon & bazel build -k \ - --build_tag_filters=-haskell \ - --test_tag_filters=-haskell \ - //c-toxcore/... \ - //third_party/... -RUN bazel test -k //third_party/... \ - --build_tag_filters=-haskell \ - --test_tag_filters=-haskell \ - //c-toxcore/... \ - //third_party/... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.dev b/tools/built/src/Dockerfile.dev index 069a9e37..63ac03b8 100644 --- a/tools/built/src/Dockerfile.dev +++ b/tools/built/src/Dockerfile.dev @@ -4,7 +4,7 @@ # contains a few basic tools and has built and ran all the tests once, so the # results are cached. This is the quickest way to get started with TokTok # development. -FROM toxchat/toktok-stack:latest-fastbuild +FROM toxchat/toktok-stack:latest # Install our wrapper for lhs support in stylish-haskell. #RUN mv /usr/bin/stylish-haskell /usr/bin/stylish-haskell.distrib \ diff --git a/tools/built/src/Dockerfile.fastbuild b/tools/built/src/Dockerfile.fastbuild deleted file mode 100644 index 7d184b8c..00000000 --- a/tools/built/src/Dockerfile.fastbuild +++ /dev/null @@ -1,8 +0,0 @@ -# Pre-build //... in fastbuild mode for dev containers. -FROM toxchat/toktok-stack:latest - -RUN sudo nix-daemon --daemon \ - & bazel build -k //... -RUN bazel test -k //... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.msan b/tools/built/src/Dockerfile.msan deleted file mode 100644 index 2af6c364..00000000 --- a/tools/built/src/Dockerfile.msan +++ /dev/null @@ -1,11 +0,0 @@ -# Pre-build //third_party in msan mode for speedy PR builds on sub-repos. -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=msan' >>.local.bazelrc - -# Don't build any Go code. It needs sanitizer/msan_interface.h. -RUN sudo nix-daemon --daemon \ - & bazel build -k //third_party/... -RUN bazel test -k //third_party/... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.release b/tools/built/src/Dockerfile.release deleted file mode 100644 index bd050e6b..00000000 --- a/tools/built/src/Dockerfile.release +++ /dev/null @@ -1,10 +0,0 @@ -# Pre-build //... in release mode for speedy PR builds on sub-repos. -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=release' >>.local.bazelrc - -RUN sudo nix-daemon --daemon \ - & bazel build -k //... -RUN bazel test -k //... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.tsan b/tools/built/src/Dockerfile.tsan deleted file mode 100644 index 2efabf48..00000000 --- a/tools/built/src/Dockerfile.tsan +++ /dev/null @@ -1,10 +0,0 @@ -# Pre-build //third_party in tsan mode for speedy PR builds on sub-repos. -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=tsan' >>.local.bazelrc - -RUN sudo nix-daemon --daemon \ - & bazel build -k //third_party/... -RUN bazel test -k //third_party/... - -# vim:ft=dockerfile diff --git a/tools/built/src/Dockerfile.windows b/tools/built/src/Dockerfile.windows deleted file mode 100644 index 28675165..00000000 --- a/tools/built/src/Dockerfile.windows +++ /dev/null @@ -1,7 +0,0 @@ -FROM toxchat/toktok-stack:latest - -RUN echo 'build --config=windows-x86_64' >>.local.bazelrc - -RUN sudo nix-daemon --daemon & bazel build -k //... - -# vim:ft=dockerfile diff --git a/tools/built/src/setup-dev.sh b/tools/built/src/setup-dev.sh index 228e41b2..95456df2 100755 --- a/tools/built/src/setup-dev.sh +++ b/tools/built/src/setup-dev.sh @@ -12,20 +12,3 @@ for prog in buildifier buildozer unused_deps; do sudo install -o root -g root -m 755 "$prog" "$HOME/.bin/$prog" rm -f "$prog" done - -# There are tests that check whether this script was ran. We don't care about -# that in the toktok-stack builds. It's checked in the submodule builds. -tools/project/update_versions.sh - -# Start nix-daemon if it isn't running yet. -if ! (ps aux | grep nix-daemon | grep -v grep); then - sudo nix-daemon --daemon & - sleep 1 -fi - -# Run all tests to completion, so the dev container starts out with all tests -# passing (so any potential breakage is local only). -tools/retry 5 bazel test --show_timestamps -- //... - -# Generate compile_commands.json after having built everything. -bazel run //:refresh_compile_commands diff --git a/tools/haskell/BUILD.bazel b/tools/haskell/BUILD.bazel index f1d0ea48..0775d76f 100644 --- a/tools/haskell/BUILD.bazel +++ b/tools/haskell/BUILD.bazel @@ -5,6 +5,6 @@ haskell_repl( name = "hie-bios", testonly = True, collect_data = False, - tags = ["no-cross"], + tags = ["haskell"], deps = HASKELL_TARGETS, ) diff --git a/tools/project/BUILD.bazel b/tools/project/BUILD.bazel index 27f93cc7..78458c89 100644 --- a/tools/project/BUILD.bazel +++ b/tools/project/BUILD.bazel @@ -11,30 +11,34 @@ exports_files(srcs = [ "yamllint.rc", "yamllint_test.sh", ] + [ - "%s/github/workflows/%s.yml" % (lang, wf) + "%s/%s" % (lang, wf) for lang, wfs in WORKFLOWS.items() for wf in wfs ]) -# Test that language-specific workflows are supersets of common workflows. +# Test that language-specific workflows are super-sets of common workflows. [sh_test( name = "%s_github_%s_test" % (lang, wf), size = "small", srcs = ["//hs-github-tools/tools:check-workflows"], args = [ - "$(location common/github/workflows/%s.base.yml)" % wf, - "$(location %s/github/workflows/%s.yml)" % (lang, wf), + "workflows", + "$(location common/github/workflows/%s.base)" % wf, + "$(location %s/github/workflows/%s)" % (lang, wf), ], data = [ - "common/github/workflows/%s.base.yml" % wf, - "%s/github/workflows/%s.yml" % (lang, wf), + "common/github/workflows/%s.base" % wf, + "%s/github/workflows/%s" % (lang, wf), ], - tags = ["no-cross"], + tags = ["haskell"], ) for lang in WORKFLOWS.keys() for wf in [ wf[wf.rfind("/") + 1:wf.rfind(".")] - for wf in glob(["%s/github/workflows/*.yml" % lang]) + for wf in glob( + ["%s/github/workflows/*.yml" % lang], + allow_empty = True, + ) if glob( - ["common/github/workflows/%s.base.yml" % wf[wf.rfind("/") + 1:wf.rfind(".")]], + ["common/github/workflows/%s.base" % wf[wf.rfind("/") + 1:wf.rfind(".")]], allow_empty = True, ) ]] diff --git a/tools/project/build_defs.bzl b/tools/project/build_defs.bzl index 87075a7d..8b81b975 100644 --- a/tools/project/build_defs.bzl +++ b/tools/project/build_defs.bzl @@ -6,11 +6,19 @@ and correctness of the license text. WORKFLOWS = { "common": [ - "checks.base", - "ci.base", - # "draft.base", # TODO(iphydf): Restore after rename. + "github/ISSUE_TEMPLATE/release.yml.base", + "github/workflows/checks.yml.base", + "github/workflows/ci.yml.base", + "github/workflows/draft.yml.base", + "github/workflows/release.yml.base", + "reviewable/completion.js", + "reviewable/settings.yaml", + ], + "haskell": [ + "github/workflows/checks.yml", + "github/workflows/ci.yml", + "github/workflows/publish.yml", ], - "haskell": ["checks", "ci", "publish"], } _COMMON = "common" @@ -25,46 +33,52 @@ def _workflows(language): workflows = {} for lang in [_COMMON, language]: for wf_file in WORKFLOWS[lang]: - wf = wf_file[:wf_file.rfind(".")] if "." in wf_file else wf_file - workflows[wf] = [lang, wf, wf == wf_file] + cur = wf_file.removesuffix(".base") + workflows[cur] = struct( + language=lang, + ref=wf_file, + cur="." + cur, + type=cur.split("/")[1], + verbatim=not wf_file.endswith(".base"), + ) return workflows.values() -def _workflow_test(group, workflow, verbatim, tests): - suffix = "" if verbatim else ".base" - yml_cur = ".github/workflows/%s.yml" % workflow - yml_ref = "//tools/project:%s/github/workflows/%s%s.yml" % (group, workflow, suffix) - test_name = "github_%s_test" % workflow - tests.append(test_name) - if verbatim: +def _workflow_test(wf, cur): + ref = "//tools/project:%s/%s" % (wf.language, wf.ref) + if wf.verbatim: + test_name = "%s_diff_test" % (wf.ref.replace("/", "_").replace(".", "_").lower()) native.sh_test( name = test_name, size = "small", srcs = ["@diffutils//:diff"], args = [ "-u", - "$(location %s)" % yml_cur, - "$(location %s)" % yml_ref, + "$(location %s)" % cur, + "$(location %s)" % ref, ], data = [ - yml_cur, - yml_ref, + cur, + ref, ], ) else: + test_name = "%s_test" % wf.ref.replace("/", "_").replace(".", "_").lower() native.sh_test( name = test_name, size = "small", srcs = ["//hs-github-tools/tools:check-workflows"], args = [ - "$(location %s)" % yml_ref, - "$(location %s)" % yml_cur, + wf.type, + "$(location %s)" % ref, + "$(location %s)" % cur, ], data = [ - yml_ref, - yml_cur, + ref, + cur, ], tags = ["no-cross", "haskell"], ) + return test_name def _expand_template_impl(ctx): output = ctx.actions.declare_file(ctx.attr.name + ".expected") @@ -172,12 +186,14 @@ def project(name = "project", license = "gpl3", custom_cirrus = False): tests = [] language = _detect_language() - # ci-tools is special, because it provides the release workflow, so it - # calls itself via a local path. - if native.package_name() != "ci_tools": - for lang, wf, verbatim in _workflows(language): - if native.glob([".github/workflows/%s.yml" % wf], allow_empty = True): - _workflow_test(lang, wf, verbatim, tests) + for wf in _workflows(language): + if native.package_name() == "ci_tools" and wf.ref.startswith("github/workflows/"): + # ci-tools is special, because it provides the release workflow, so + # it calls itself via a local path. + continue + cur = native.glob([wf.cur, wf.cur.replace(".yml", ".yaml")], allow_empty = True) + if cur: + tests.append(_workflow_test(wf, cur[0])) if language == _HASKELL: _haskell_project( diff --git a/tools/project/common/github/ISSUE_TEMPLATE/release.yml.base b/tools/project/common/github/ISSUE_TEMPLATE/release.yml.base new file mode 100644 index 00000000..f4849632 --- /dev/null +++ b/tools/project/common/github/ISSUE_TEMPLATE/release.yml.base @@ -0,0 +1,24 @@ +name: 🚀 Release +description: Build and deploy a new release +title: Release tracking issue +labels: [chore] +type: Task +body: + - type: textarea + id: release-notes + attributes: + label: Release notes + description: Write something nice about the new release. + placeholder: "Here's our latest awesome release!" + validations: + required: true + - type: dropdown + id: production + attributes: + label: Release type + description: Whether this is a production release or a release candidate. + options: + - Release candidate + - Production release + validations: + required: true diff --git a/tools/project/common/github/workflows/checks.base.yml b/tools/project/common/github/workflows/checks.yml.base similarity index 100% rename from tools/project/common/github/workflows/checks.base.yml rename to tools/project/common/github/workflows/checks.yml.base diff --git a/tools/project/common/github/workflows/ci.base.yml b/tools/project/common/github/workflows/ci.yml.base similarity index 100% rename from tools/project/common/github/workflows/ci.base.yml rename to tools/project/common/github/workflows/ci.yml.base diff --git a/tools/project/common/github/workflows/draft.base.yml b/tools/project/common/github/workflows/draft.yml.base similarity index 81% rename from tools/project/common/github/workflows/draft.base.yml rename to tools/project/common/github/workflows/draft.yml.base index bcc460e9..6d2f8549 100644 --- a/tools/project/common/github/workflows/draft.base.yml +++ b/tools/project/common/github/workflows/draft.yml.base @@ -9,7 +9,7 @@ on: # Cancel old builds when pushing new commits. concurrency: - group: draft-${{ github.ref }} + group: draft-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: diff --git a/tools/project/common/github/workflows/release.yml.base b/tools/project/common/github/workflows/release.yml.base new file mode 100644 index 00000000..a5556cab --- /dev/null +++ b/tools/project/common/github/workflows/release.yml.base @@ -0,0 +1,18 @@ +name: release + +on: + issues: + types: [assigned] + +concurrency: + group: release-${{ github.event.issue.number }} + cancel-in-progress: true + +jobs: + release: + name: Release + uses: TokTok/ci-tools/.github/workflows/release-deploy.yml@master + with: + production: true + secrets: + TOKEN_RELEASES: ${{ secrets.TOKEN_RELEASES }} diff --git a/tools/project/common/reviewable/completion.js b/tools/project/common/reviewable/completion.js new file mode 100644 index 00000000..1bef3b62 --- /dev/null +++ b/tools/project/common/reviewable/completion.js @@ -0,0 +1,76 @@ +// jshint esversion: 6 + +// This code will check that the pull request has been approved via GitHub +// review approval by a minimum number of reviewers and by all assignees, and +// that no changes were requested by any reviewers. Only reviewers with write +// access to the repository are considered. +// +// This is very similar to GitHub's built-in branch protection option to require +// pull request reviews before merging, but allows for much more flexibility and +// customization. + +// dependencies: lodash4 + +// Helper function to check if a user is a bot. +function isBotAuthor(author) { + return ( + author.username.endsWith("[bot]") || author.username.startsWith("toktok-") + ); +} + +function equals(a) { + return (b) => a === b; +} + +// The number of approvals required to merge: at least 2 humans must approve the +// code. If the author is a bot, then 2 approvals are required; otherwise, only +// 1 approval is required (because 1 human wrote the code, so they approve). +let numApprovalsRequired = isBotAuthor(review.pullRequest.author) ? 2 : 1; + +const approvals = review.pullRequest.approvals; + +let numApprovals = _.filter(approvals, equals("approved")).length; +const numRejections = _.filter(approvals, equals("changes_requested")).length; + +const discussionBlockers = _(review.discussions) + .filter((x) => !x.resolved) + .flatMap("participants") + .filter((x) => !x.resolved) + .map((user) => _.pick(user, "username")) + .value(); + +let pendingReviewers = _(discussionBlockers) + .map((user) => _.pick(user, "username")) + .concat(review.pullRequest.requestedReviewers) + .value(); + +const required = _.map(review.pullRequest.assignees, "username"); +_.pull(required, review.pullRequest.author.username); +if (required.length) { + numApprovalsRequired = _.max([required.length, numApprovalsRequired]); + numApprovals = + _(approvals).pick(required).filter(equals("approved")).size() + + _.min([numApprovals, numApprovalsRequired - required.length]); + pendingReviewers = _(required) + .reject((username) => approvals[username] === "approved") + .reject((username) => pendingReviewers.length && approvals[username]) + .map((username) => ({ username })) + .concat(pendingReviewers) + .value(); +} + +pendingReviewers = _.uniqBy(pendingReviewers, "username"); + +const description = + (numRejections ? `${numRejections} change requests, ` : "") + + `${numApprovals} of ${numApprovalsRequired} approvals obtained`; +const shortDescription = + (numRejections ? `${numRejections} ✗, ` : "") + + `${numApprovals} of ${numApprovalsRequired} ✓`; + +return { + completed: numApprovals >= numApprovalsRequired, + description, + shortDescription, + pendingReviewers, +}; diff --git a/tools/project/common/reviewable/settings.yaml b/tools/project/common/reviewable/settings.yaml new file mode 100644 index 00000000..361886ff --- /dev/null +++ b/tools/project/common/reviewable/settings.yaml @@ -0,0 +1,4 @@ +# Reviewable settings file. Read the docs at https://docs.reviewable.io/repositories.html#store-repository-settings-using-the-reviewable-directory +approval-text: ":lgtm_strong:" +github-status: + updates: always diff --git a/toxic b/toxic index ee3d75a1..50f64b70 160000 --- a/toxic +++ b/toxic @@ -1 +1 @@ -Subproject commit ee3d75a11f6ced53cb74fff614349ad34fb78305 +Subproject commit 50f64b701d9a7dc8ed3265428c277773622c788b diff --git a/toxins b/toxins index b1b90de8..376fb6f0 160000 --- a/toxins +++ b/toxins @@ -1 +1 @@ -Subproject commit b1b90de8acd010c909320a3167638b04fed5ef75 +Subproject commit 376fb6f0d2844b151a3f7af59f23294bbd4609be diff --git a/website b/website index 4481bd78..c3ebebaf 160000 --- a/website +++ b/website @@ -1 +1 @@ -Subproject commit 4481bd78eeae116aa5d9d961574c1a6d2ef82c6a +Subproject commit c3ebebaf3f74059ee0a6addc13f72166d36b5bc6