diff --git a/.aspect/workflows/README.md b/.aspect/workflows/README.md deleted file mode 100644 index 59693ea..0000000 --- a/.aspect/workflows/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Aspect Workflows demonstration deployment - -This deployment of [Aspect Workflows](https://www.aspect.build/workflows) is configured to run on Buildkite. - -You can see this Aspect Workflows demonstration deployment live at -https://buildkite.com/aspect/rules-jest. - -The two components of the configuration for this repository are, - -1. Aspect Workflows configuration yaml -1. Buildkite pipeline configuration (in the Buildkite UI) - -## Aspect Workflows configuration yaml - -This is the [config.yaml](./config.yaml) file in this directory. - -## Buildkite pipeline configuration (in the Buildkite UI) - -There are two pipelines configured on Buildkite. - -1. Main build & test pipeline: https://buildkite.com/aspect/rules-jest -2. Scheduled warming pipeline: https://buildkite.com/aspect/rules-jest-warming - -### Main build & test pipeline configuration - -The main build & test pipeline found at https://buildkite.com/aspect/rules-jest is configured -with the following yaml steps: - -``` -steps: - - label: ":aspect: Setup Aspect Workflows" - commands: - - "rosetta steps | buildkite-agent pipeline upload" - agents: - queue: aspect-nano-graviton -``` - -> [!IMPORTANT] -> The Setup Aspect Workflows step above is configured to run on the `aspect-nano-graviton` queue that is serviced by a runner group made up of lightweight and inexpensive `t4g.nano` AWS instances. - -### Scheduled warming pipeline configuration - -The scheduled warming pipeline found at https://buildkite.com/aspect/rules-jest-warming is -configured with the following yaml steps: - -``` -env: - ASPECT_WORKFLOWS_BIN_DIR: /etc/aspect/workflows/bin -steps: - - label: ":fire: Create warming archives" - commands: | - echo "--- :aspect-build: Configure environment" - ${ASPECT_WORKFLOWS_BIN_DIR}/configure_workflows_env - echo "--- :stethoscope: Agent health checks" - ${ASPECT_WORKFLOWS_BIN_DIR}/agent_health_check - echo "--- :bazel: Create warming archive" - rosetta run warming - ${ASPECT_WORKFLOWS_BIN_DIR}/warming_archive - agents: - queue: aspect-warming -``` - -The warming pipeline is not configured to trigger on commits or PRs. Instead, a scheduled is -configured for this pipeline with the cron interval `0 1 * * * America/Vancouver` so that it -runs periodically to create up-to-date warming archives that caches repository rules so that the -"default" build & test runners don't have to re-fetch them on their first build. diff --git a/.aspect/workflows/bazelrc b/.aspect/workflows/bazelrc index 2caf3be..72d0869 100644 --- a/.aspect/workflows/bazelrc +++ b/.aspect/workflows/bazelrc @@ -12,3 +12,11 @@ common --remote_download_outputs=minimal common --experimental_fetch_all_coverage_outputs # https://github.com/bazelbuild/bazel/blob/e3e4d61b2c2b241d0426ea20143b8a07d6fadfcd/tools/test/collect_cc_coverage.sh#L30 common --test_env=COVERAGE_GCOV_PATH=/usr/bin/gcov + +# remote execution +common:rbe --extra_execution_platforms=//bazel/platforms:x86_64_linux_remote +common:rbe --host_platform=//bazel/platforms:x86_64_linux_remote +common:rbe --remote_executor=unix:///mnt/ephemeral/buildbarn/.cache/bb_clientd/grpc +common:rbe --genrule_strategy=remote,local +common:rbe --jobs=32 +common:rbe --remote_timeout=3600 diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index d48d495..2819a28 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -1,30 +1,11 @@ -# See https://docs.aspect.build/v/workflows/config ---- +# See https://docs.aspect.build/workflows/configuration tasks: - format: - queue: aspect-small + queue: aspect-medium - buildifier: - queue: aspect-small - - gazelle: - queue: aspect-small - - configure: - queue: aspect-small + queue: aspect-medium - test: coverage: true - upload_test_logs: executed - - delivery: - auto_deliver: true - rules: - - deliverable: 'attr("tags", "\bdeliverable\b", //...)' - condition: - branches: - - main - - deliverable: - - //docs:docs_delivery - condition: - only_on_change: false - branches: - - main - finalization: queue: aspect-small notifications: diff --git a/.bazeliskrc b/.bazeliskrc index 269fbb0..5ca935b 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1,2 +1,2 @@ -BAZELISK_BASE_URL=https://github.com/aspect-build/aspect-cli/releases/download -USE_BAZEL_VERSION=aspect/5.9.25 +BAZELISK_BASE_URL=https://static.aspect.build/aspect +USE_BAZEL_VERSION=aspect/2024.51.11 \ No newline at end of file diff --git a/.bazelversion b/.bazelversion index 21c8c7b..b616717 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.1.1 +7.4.0 \ No newline at end of file diff --git a/.github/workflows/new_issue.yaml b/.github/workflows/new_issue.yaml deleted file mode 100644 index 19e4c84..0000000 --- a/.github/workflows/new_issue.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: New issue -on: - issues: - types: - - opened - - reopened -jobs: - new_issue: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - # https://docs.github.com/en/actions/managing-issues-and-pull-requests/adding-labels-to-issues - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ["untriaged"] - }) - # https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects#adding-an-item-to-a-project - - run: | - gh api graphql -f query="mutation { addProjectV2ItemById(input: {projectId: \"$PROJECT_ID\" contentId: \"$CONTENT_ID\"}) { item { id } } }" - env: - GITHUB_TOKEN: ${{ secrets.GH_PROJECTS_RW_TOKEN }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - CONTENT_ID: ${{ github.event.issue.node_id }} - PROJECT_ID: PVT_kwDOA6IKMs4ALj2o # Aspect OSS Bazel Rules diff --git a/BUILD.bazel b/BUILD.bazel index 167ce1b..717b264 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,30 +1,11 @@ load("@aspect_bazel_lib//lib:copy_file.bzl", "copy_file") load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") -load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@npm//:defs.bzl", "npm_link_all_packages") load("//jest:defs.bzl", "jest_test") npm_link_all_packages(name = "node_modules") -gazelle_binary( - name = "gazelle_bin", - languages = ["@bazel_skylib_gazelle_plugin//bzl"], -) - -gazelle( - name = "gazelle", - gazelle = "gazelle_bin", - mode = "fix", -) - -gazelle( - name = "gazelle.check", - gazelle = "gazelle_bin", - mode = "diff", -) - buildifier( name = "buildifier", exclude_patterns = ["./.git/*"], @@ -74,10 +55,3 @@ copy_to_bin( srcs = ["test_case8.jest.config.js"], visibility = ["//visibility:public"], ) - -bzl_library( - name = "internal_deps", - srcs = ["internal_deps.bzl"], - visibility = ["//visibility:public"], - deps = ["//jest/private:maybe"], -) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 560b963..d38894d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,12 +13,6 @@ pre-commit install Otherwise later tooling on CI may yell at you about formatting/linting violations. -## Updating BUILD files - -Some targets are generated from sources. -Currently this is just the `bzl_library` targets. -Run `bazel run //:gazelle` to keep them up-to-date. - ## Using this as a development dependency of other rules You'll commonly find that you develop in another WORKSPACE, such as diff --git a/MODULE.bazel b/MODULE.bazel index 1d6c788..2d2bfc3 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,7 +14,5 @@ bazel_dep(name = "rules_nodejs", version = "6.2.0") ####### Dev dependencies ######## -bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True) bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True) -bazel_dep(name = "gazelle", version = "0.36.0", dev_dependency = True, repo_name = "bazel_gazelle") bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") diff --git a/WORKSPACE b/WORKSPACE index d429989..a18e0dd 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -20,18 +20,6 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") - -############################################ -# Gazelle, for generating bzl_library targets -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") - -go_rules_dependencies() - -go_register_toolchains(version = "1.19.3") - -gazelle_dependencies() - # Test case 4 (see //jest/tests) local_repository( name = "case4", diff --git a/bazel/platforms/BUILD.bazel b/bazel/platforms/BUILD.bazel new file mode 100644 index 0000000..df58fbd --- /dev/null +++ b/bazel/platforms/BUILD.bazel @@ -0,0 +1,12 @@ +platform( + name = "x86_64_linux_remote", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + ], + exec_properties = { + "OSFamily": "Linux", + "container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448", + }, + visibility = ["//visibility:public"], +) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 60b5f25..4083aa3 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -12,20 +12,3 @@ update_docs( name = "update", tags = ["skip-on-bazel6"], # slight docs difference in Bazel 6 ) - -# Demonstration delivery target for Aspect Workflows. -# In the future this could be wired up to push to a demonstration S3 bucket. -sh_binary( - name = "docs_delivery_only_on_change", - srcs = ["delivery.sh"], - data = glob(["*.md"]), - tags = ["deliverable"], -) - -# Demonstration delivery target for Aspect Workflows. -# In the future this could be wired up to push to a demonstration S3 bucket. -sh_binary( - name = "docs_delivery", - srcs = ["delivery.sh"], - data = glob(["*.md"]), -) diff --git a/docs/delivery.sh b/docs/delivery.sh deleted file mode 100755 index b88f661..0000000 --- a/docs/delivery.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -o nounset -o pipefail - -echo "Demostration delivery target" diff --git a/internal_deps.bzl b/internal_deps.bzl index e45be48..fff4ad1 100644 --- a/internal_deps.bzl +++ b/internal_deps.bzl @@ -9,24 +9,6 @@ load("//jest/private:maybe.bzl", http_archive = "maybe_http_archive") def rules_jest_internal_deps(): "Fetch deps needed for local development" - http_archive( - name = "io_bazel_rules_go", - sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184", - urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip"], - ) - - http_archive( - name = "bazel_gazelle", - integrity = "sha256-dd8ojEsxyB61D1Hi4U9HY8t1SNquEmgXJHBkY3/Z6mI=", - urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz"], - ) - - http_archive( - name = "bazel_skylib_gazelle_plugin", - sha256 = "747addf3f508186234f6232674dd7786743efb8c68619aece5fb0cac97b8f415", - urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-gazelle-plugin-1.5.0.tar.gz"], - ) - http_archive( name = "io_bazel_stardoc", sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",