From e54757cbc79d819b461e879e0af4c5e039bb49d9 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 30 Dec 2024 20:10:22 +0700 Subject: [PATCH] chore: switch to Aspect Workflows on Buildkite (#104) --- .aspect/workflows/BUILD.bazel | 13 - .aspect/workflows/README.md | 18 -- .aspect/workflows/bazelrc | 5 +- .aspect/workflows/config.yaml | 42 +-- .aspect/workflows/deps.bzl | 48 --- .circleci/BUILD.bazel | 61 ---- .circleci/config.yml | 488 ------------------------------- .circleci/user-config.yml | 52 ---- .github/workflows/new_issue.yaml | 31 -- BUILD.bazel | 18 -- CONTRIBUTING.md | 6 - MODULE.bazel | 2 - WORKSPACE.bazel | 5 - bazel/platforms/BUILD.bazel | 12 + docs/BUILD.bazel | 17 -- docs/delivery.sh | 5 - examples/macro/BUILD.bazel | 1 - terser/private/BUILD.bazel | 2 - 18 files changed, 22 insertions(+), 804 deletions(-) delete mode 100644 .aspect/workflows/BUILD.bazel delete mode 100644 .aspect/workflows/README.md delete mode 100644 .aspect/workflows/deps.bzl delete mode 100644 .circleci/BUILD.bazel delete mode 100644 .circleci/config.yml delete mode 100644 .circleci/user-config.yml delete mode 100644 .github/workflows/new_issue.yaml create mode 100644 bazel/platforms/BUILD.bazel delete mode 100755 docs/delivery.sh diff --git a/.aspect/workflows/BUILD.bazel b/.aspect/workflows/BUILD.bazel deleted file mode 100644 index 61fa702..0000000 --- a/.aspect/workflows/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -exports_files(["config.yaml"]) - -bzl_library( - name = "deps", - srcs = ["deps.bzl"], - visibility = ["//visibility:public"], - deps = [ - "@bazel_tools//tools/build_defs/repo:http.bzl", - "@bazel_tools//tools/build_defs/repo:utils.bzl", - ], -) diff --git a/.aspect/workflows/README.md b/.aspect/workflows/README.md deleted file mode 100644 index 378d711..0000000 --- a/.aspect/workflows/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Aspect Workflows demonstration deployment - -This deployment of [Aspect Workflows](https://www.aspect.build/workflows) is configured to run on GCP + CircleCI. - -You can see this Aspect Workflows demonstration deployment live at https://app.circleci.com/pipelines/github/aspect-build/rules_terser. - -The two components of the configuration in this repository are, - -1. Aspect Workflows configuration yaml -1. CircleCI pipeline configuration - -## Aspect Workflows configuration yaml - -This is the [config.yaml](./config.yaml) file in this directory. - -## CircleCI pipeline configuration - -This is the [.circleci/config.yml](../../.circleci/config.yml) file. diff --git a/.aspect/workflows/bazelrc b/.aspect/workflows/bazelrc index e865f71..33fb1ce 100644 --- a/.aspect/workflows/bazelrc +++ b/.aspect/workflows/bazelrc @@ -2,8 +2,9 @@ common --remote_download_outputs=minimal common --nobuild_runfile_links -common:rbe --extra_execution_platforms=@aspect_bazel_lib//platforms:x86_64_linux_remote -common:rbe --host_platform=@aspect_bazel_lib//platforms:x86_64_linux_remote +# 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 diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index 7a96d8c..183a659 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -1,55 +1,27 @@ -queue: oss-gcp-default -bazel: - flags: - - --config=rbe +# See https://docs.aspect.build/workflows/configuration workspaces: .: tasks: - test: - targets: - - //... - - configure: - bazel: - flags: [] # TODO: Aspect CLI does not support --config for configure cmd e2e/smoke: - icon: bazel tasks: - test: - queue: oss-gcp-small + queue: aspect-medium - format: without: true - - gazelle: - without: true - configure: without: true - buildifier: without: true - - delivery: - without: true tasks: - test: - format: - queue: oss-gcp-small - - gazelle: - queue: oss-gcp-small + queue: aspect-medium - configure: - queue: oss-gcp-small + queue: aspect-medium - buildifier: - queue: oss-gcp-small - - delivery: - auto_deliver: true - rules: - - deliverable: 'attr("tags", "\bdeliverable\b", //...)' - condition: - branches: - - main - - deliverable: - - //docs:docs_delivery - condition: - only_on_change: false - branches: - - main - - warming: - queue: oss-gcp-warming + queue: aspect-medium + - finalization: + queue: aspect-small notifications: github: {} diff --git a/.aspect/workflows/deps.bzl b/.aspect/workflows/deps.bzl deleted file mode 100644 index 6904d9a..0000000 --- a/.aspect/workflows/deps.bzl +++ /dev/null @@ -1,48 +0,0 @@ -"""Bazel dependencies for Aspect Workflows""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", _http_archive = "http_archive", _http_file = "http_file") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -# TODO: move this to a rule set so repositories on Aspect Workflows can avoid this boilerplate -rosetta_version = "5.11.0" -rosetta_integrity = { - "darwin_aarch64": "sha256-zmWdxspunpc9Sz5iZOow0FotE66EGe6WFeHk5+vwMJ8=", - "darwin_x86_64": "sha256-5V6SxvL3QYWbBE/GuwP1ReJwpe0zkznb+j8n4V36O+E=", - "linux_aarch64": "sha256-qwscEgk9kdMnNZ9df+Cw8aPo1ZokIHViS6+6nCSsfSU=", - "linux_x86_64": "sha256-WgDaxOssma7zDHGh+iZ4p3MyBvIBk6m138ZWzR44g2Q=", -} - -# https://github.com/suzuki-shunsuke/circleci-config-merge/releases -# https://dev.to/suzukishunsuke/splitting-circleci-config-yml-10gk -circleci_config_merge_version = "1.1.6" -circleci_config_merge_integrity = { - "darwin_aarch64": "sha256-7cQeLrSVRZR+mQu/njn+x//EIb2bhTV2+J8fafRHpr4=", - "darwin_x86_64": "sha256-vHKDSdDaYK58MaudJ9yOPRKh+OT/LiTQV/9E07RL8qA=", - "linux_aarch64": "sha256-MaXVQmRK9q9LgsfM5ZzxCIIT8rUcOBbzJ8aVDgK6zWs=", - "linux_x86_64": "sha256-3eYJn7dShZD1oiS3cgXfqXwdDzclf/N97A2nh7ZfW+w=", -} - -def http_archive(name, **kwargs): - maybe(_http_archive, name = name, **kwargs) - -def http_file(name, **kwargs): - maybe(_http_file, name = name, **kwargs) - -# buildifier: disable=function-docstring -def fetch_workflows_deps(): - for platform_arch in rosetta_integrity.keys(): - http_file( - name = "rosetta_{}".format(platform_arch), - downloaded_file_path = "rosetta", - executable = True, - integrity = rosetta_integrity[platform_arch], - urls = ["https://static.aspect.build/aspect/{0}/rosetta_real_{1}".format(rosetta_version, platform_arch.replace("aarch64", "arm64"))], - ) - - for platform_arch in circleci_config_merge_integrity.keys(): - http_archive( - name = "circleci_config_merge_{}".format(platform_arch), - build_file_content = "exports_files([\"circleci-config-merge\"])", - integrity = circleci_config_merge_integrity[platform_arch], - urls = ["https://github.com/suzuki-shunsuke/circleci-config-merge/releases/download/v{0}/circleci-config-merge_{0}_{1}.tar.gz".format(circleci_config_merge_version, platform_arch.replace("aarch64", "arm64").replace("x86_64", "amd64"))], - ) diff --git a/.circleci/BUILD.bazel b/.circleci/BUILD.bazel deleted file mode 100644 index 86abb1f..0000000 --- a/.circleci/BUILD.bazel +++ /dev/null @@ -1,61 +0,0 @@ -load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") - -CIRCLECI_ORG = "aspect-build" - -CIRCLECI_USER_CONFIG_FILE = "//.circleci:user-config.yml" - -not_windows = select({ - # There isn't a published rosetta binary for windows as of Feb 2024 - "@platforms//os:windows": ["@platforms//:incompatible"], - "//conditions:default": [], -}) - -alias( - name = "rosetta", - actual = select({ - "@bazel_tools//src/conditions:darwin_arm64": "@rosetta_darwin_aarch64//file:rosetta", - "@bazel_tools//src/conditions:darwin_x86_64": "@rosetta_darwin_x86_64//file:rosetta", - "@bazel_tools//src/conditions:linux_aarch64": "@rosetta_linux_aarch64//file:rosetta", - "@bazel_tools//src/conditions:linux_x86_64": "@rosetta_linux_x86_64//file:rosetta", - }), - target_compatible_with = not_windows, -) - -alias( - name = "circleci-config-merge", - actual = select({ - "@bazel_tools//src/conditions:darwin_arm64": "@circleci_config_merge_darwin_aarch64//:circleci-config-merge", - "@bazel_tools//src/conditions:darwin_x86_64": "@circleci_config_merge_darwin_x86_64//:circleci-config-merge", - "@bazel_tools//src/conditions:linux_aarch64": "@circleci_config_merge_linux_aarch64//:circleci-config-merge", - "@bazel_tools//src/conditions:linux_x86_64": "@circleci_config_merge_linux_x86_64//:circleci-config-merge", - }), - target_compatible_with = not_windows, -) - -genrule( - name = "aspect_workflows_config", - srcs = ["//.aspect/workflows:config.yaml"], - outs = [":aspect-workflows-config.yml"], - cmd = "CI=1 CIRCLE_PROJECT_USERNAME={0} ASPECT_WORKFLOWS_DISABLE_TRACES_COLLECTION=1 $(execpath :rosetta) steps --configuration .aspect/workflows/config.yaml --host circleci > $@".format(CIRCLECI_ORG), - target_compatible_with = not_windows, - tools = [":rosetta"], -) - -genrule( - name = "merge_config", - srcs = [ - ":aspect-workflows-config.yml", - CIRCLECI_USER_CONFIG_FILE, - ], - outs = [":_config.yml"], - cmd = "echo -e '# GENERATED FILE - DO NOT EDIT!\\n# Update with: bazel run //.circleci:write_merged_config' > $@ && $(execpath :circleci-config-merge) merge $(execpath :aspect-workflows-config.yml) $(execpath {0}) >> $@".format(CIRCLECI_USER_CONFIG_FILE), - target_compatible_with = not_windows, - tools = [":circleci-config-merge"], -) - -write_source_file( - name = "write_merged_config", - in_file = ":_config.yml", - out_file = "config.yml", - target_compatible_with = not_windows, -) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0a2c144..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,488 +0,0 @@ -# GENERATED FILE - DO NOT EDIT! -# Update with: bazel run //.circleci:write_merged_config -version: 2.1 -workflows: - aspect-workflows: - jobs: - - aw-auto-deliver: - context: [] - filters: - branches: - only: - - /^main$/ - requires: - - aw-root_workspace_test - workspace: . - - aw-buildifier: - context: [] - workspace: . - - aw-format: - context: [] - workspace: . - - aw-gazelle: - context: [] - workspace: . - - aw-root_workspace_configure: - context: [] - workspace: . - - aw-root_workspace_test: - context: [] - workspace: . - when: - and: - - not: << pipeline.parameters.perform_delivery >> - - not: - equal: - - scheduled_pipeline - - << pipeline.trigger_source >> - aspect-workflows-e2e-smoke: - jobs: - - aw-e2e_smoke_test: - context: [] - delivery_manifest: false - workspace: e2e/smoke - when: - and: - - not: << pipeline.parameters.perform_delivery >> - - not: - equal: - - scheduled_pipeline - - << pipeline.trigger_source >> - aspect-workflows-manual-deliver: - jobs: - - aw-manual-deliver: - context: [] - workspace: << pipeline.parameters.workspace >> - when: - equal: - - true - - << pipeline.parameters.perform_delivery >> - aspect-workflows-warming: - jobs: - - aw-warming: {} - when: - and: - - equal: - - scheduled_pipeline - - << pipeline.trigger_source >> - - equal: - - aspect-workflows-warming - - << pipeline.schedule.name >> - user-workflow: - jobs: - - user-job - when: - and: - - not: << pipeline.parameters.perform_delivery >> - - not: - equal: - - << pipeline.trigger_source >> - - scheduled_pipeline -jobs: - aw-auto-deliver: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >> - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - workspace: - type: string - resource_class: aspect-build/oss-gcp-default - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: git fetch - name: Git fetch - - when: - condition: << pipeline.parameters.delivery_commit >> - steps: - - run: - command: git checkout << pipeline.parameters.delivery_commit >> - name: Checkout release commit - - run: - command: rosetta run delivery - name: Delivery - no_output_timeout: 180m - working_directory: /mnt/ephemeral/workdir - aw-buildifier: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - delivery_manifest: - default: true - type: boolean - workspace: - type: string - resource_class: aspect-build/oss-gcp-small - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: rm -rf /workflows/artifacts /workflows/testlogs - name: Prepare archive directories - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run buildifier --workspace << parameters.workspace >> - name: Buildifier - no_output_timeout: 180m - - store_artifacts: - path: /workflows/artifacts - - run: - command: rosetta run finalization - name: Finalization - no_output_timeout: 10m - when: always - working_directory: /mnt/ephemeral/workdir - aw-e2e_smoke_test: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - delivery_manifest: - default: true - type: boolean - workspace: - type: string - resource_class: aspect-build/oss-gcp-small - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: rm -rf /workflows/artifacts /workflows/testlogs - name: Prepare archive directories - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run test --workspace << parameters.workspace >> - name: Test - no_output_timeout: 180m - - store_test_results: - path: /workflows/testlogs - - when: - condition: - and: - - <> - - or: - - matches: - pattern: ^main$ - value: << pipeline.git.branch >> - steps: - - run: - command: rosetta run delivery_manifest --workspace << parameters.workspace - >> --data TARGETS_SOURCE=test - name: Delivery manifest - no_output_timeout: 180m - - store_artifacts: - path: /workflows/testlogs - - store_artifacts: - path: /workflows/artifacts - - run: - command: rosetta run finalization - name: Finalization - no_output_timeout: 10m - when: always - working_directory: /mnt/ephemeral/workdir - aw-format: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - delivery_manifest: - default: true - type: boolean - workspace: - type: string - resource_class: aspect-build/oss-gcp-small - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: rm -rf /workflows/artifacts /workflows/testlogs - name: Prepare archive directories - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run format --workspace << parameters.workspace >> - name: Format - no_output_timeout: 180m - - store_artifacts: - path: /workflows/artifacts - - run: - command: rosetta run finalization - name: Finalization - no_output_timeout: 10m - when: always - working_directory: /mnt/ephemeral/workdir - aw-gazelle: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - delivery_manifest: - default: true - type: boolean - workspace: - type: string - resource_class: aspect-build/oss-gcp-small - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: rm -rf /workflows/artifacts /workflows/testlogs - name: Prepare archive directories - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run gazelle --workspace << parameters.workspace >> - name: Gazelle - no_output_timeout: 180m - - store_artifacts: - path: /workflows/artifacts - - run: - command: rosetta run finalization - name: Finalization - no_output_timeout: 10m - when: always - working_directory: /mnt/ephemeral/workdir - aw-manual-deliver: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >> - ASPECT_WORKFLOWS_DELIVERY_TARGETS: << pipeline.parameters.delivery_targets >> - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - workspace: - type: string - resource_class: aspect-build/oss-gcp-default - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: git fetch - name: Git fetch - - when: - condition: << pipeline.parameters.delivery_commit >> - steps: - - run: - command: git checkout << pipeline.parameters.delivery_commit >> - name: Checkout release commit - - run: - command: rosetta run delivery - name: Delivery - no_output_timeout: 180m - working_directory: /mnt/ephemeral/workdir - aw-root_workspace_configure: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - delivery_manifest: - default: true - type: boolean - workspace: - type: string - resource_class: aspect-build/oss-gcp-small - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: rm -rf /workflows/artifacts /workflows/testlogs - name: Prepare archive directories - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run configure --workspace << parameters.workspace >> - name: Configure - no_output_timeout: 180m - - store_artifacts: - path: /workflows/artifacts - - run: - command: rosetta run finalization - name: Finalization - no_output_timeout: 10m - when: always - working_directory: /mnt/ephemeral/workdir - aw-root_workspace_test: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - parameters: - delivery_manifest: - default: true - type: boolean - workspace: - type: string - resource_class: aspect-build/oss-gcp-default - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: rm -rf /workflows/artifacts /workflows/testlogs - name: Prepare archive directories - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run test --workspace << parameters.workspace >> - name: Test - no_output_timeout: 180m - - store_test_results: - path: /workflows/testlogs - - when: - condition: - and: - - <> - - or: - - matches: - pattern: ^main$ - value: << pipeline.git.branch >> - steps: - - run: - command: rosetta run delivery_manifest --workspace << parameters.workspace - >> --data TARGETS_SOURCE=test - name: Delivery manifest - no_output_timeout: 180m - - store_artifacts: - path: /workflows/testlogs - - store_artifacts: - path: /workflows/artifacts - - run: - command: rosetta run finalization - name: Finalization - no_output_timeout: 10m - when: always - working_directory: /mnt/ephemeral/workdir - aw-warming: - environment: - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> - ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> - ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows - ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml - XDG_CACHE_HOME: /mnt/ephemeral/caches - machine: true - resource_class: aspect-build/oss-gcp-warming - steps: - - run: - command: /etc/aspect/workflows/bin/configure_workflows_env - name: Workflows environment - - checkout - - run: - command: /etc/aspect/workflows/bin/agent_health_check - name: Agent health check - no_output_timeout: 180m - - run: - command: rosetta run warming --workspace e2e/smoke - name: Create warming archive for e2e/smoke - no_output_timeout: 180m - - run: - command: rosetta run warming --workspace . - name: Create warming archive for root - no_output_timeout: 180m - - run: - command: /etc/aspect/workflows/bin/warming_archive - name: Archive warming tars - working_directory: /mnt/ephemeral/workdir - user-job: - docker: - - image: cimg/base:2023.03 - steps: - - checkout - - run: echo "Example user CircleCI job that is not generated by Aspect Workflows." -parameters: - delivery_commit: - default: "" - description: The commit to checkout and run the delivery from. Targets listed - in the delivery manifest for this commit will be delivered unless specific targets - are listed in `delivery_targets`. - type: string - delivery_targets: - default: "" - description: List of Bazel targets to deliver, delimited by spaces. For example, - `//app/a:push_release //app/b:push_release`. If empty, targets listed in the - delivery manifest for the target commit will be delivered. - type: string - perform_delivery: - default: false - type: boolean - workspace: - default: . - description: The workspace that the `delivery_targets` live within. - type: string diff --git a/.circleci/user-config.yml b/.circleci/user-config.yml deleted file mode 100644 index a11cf53..0000000 --- a/.circleci/user-config.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This is an example of a user CircleCI configuration that is not generated by -# Aspect Workflows. The naming of this file is arbitrary. This configuration is -# merged with the generated Aspect Workflows CircleCI configuration into the -# load bearing load `.circleci/config.yaml` configuration file that is used by -# CircleCI. -# -# To update `.circleci/config.yaml` after editing this file run: -# -# bazel run //.circleci:write_merged_config -# -# -# Aspect Workflows workflow names are all prefixed with "aspect-workflows-". -# These currently include: -# -# - aspect-workflows -# - aspect-workflows-warming -# - aspect-workflows-manual-deliver -# -# Aspect Workflows job names are all prefixed with "aw-". These currently -# include. -# -# - aw-auto-deliver -# - aw-buildifier -# - aw-configure -# - aw-format -# - aw-gazelle -# - aw-manual-deliver -# - aw-test -# - aw-warming -# -# In your user CircleCI configuration, avoid workflow names prefixed with -# `aspect-workflows-` and job names prefixed with `aw-`. Conflicting workflow or -# job names will result in a bad configuration merge. -version: 2.1 -jobs: - user-job: - docker: - - image: cimg/base:2023.03 - steps: - - checkout - - run: echo "Example user CircleCI job that is not generated by Aspect Workflows." -workflows: - user-workflow: - jobs: - - user-job - when: - and: - - not: << pipeline.parameters.perform_delivery >> - - not: - equal: - - << pipeline.trigger_source >> - - scheduled_pipeline 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 a6023da..6bf8586 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,5 +1,4 @@ load("@buildifier_prebuilt//:rules.bzl", "buildifier") -load("@gazelle//:def.bzl", "DEFAULT_LANGUAGES", "gazelle", "gazelle_binary") load("@npm//:defs.bzl", "npm_link_all_packages") npm_link_all_packages(name = "node_modules") @@ -20,23 +19,6 @@ buildifier( tags = ["manual"], # tag as manual so windows ci does not build it by default ) -gazelle_binary( - name = "gazelle_bin", - languages = DEFAULT_LANGUAGES + ["@bazel_skylib_gazelle_plugin//bzl"], -) - -gazelle( - name = "gazelle", - gazelle = ":gazelle_bin", - mode = "fix", -) - -gazelle( - name = "gazelle.check", - gazelle = ":gazelle_bin", - mode = "diff", -) - alias( name = "format", actual = "//tools/format", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 745794c..979ff8f 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 `aspect configure` 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 c9373ce..b2dd075 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,9 +14,7 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0") ####### Dev dependencies ######## bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc9", dev_dependency = True) -bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True) bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True) -bazel_dep(name = "gazelle", version = "0.38.0", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index f35b3f6..e69de29 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -1,5 +0,0 @@ -############################################ -# Aspect Workflows -load("//.aspect/workflows:deps.bzl", "fetch_workflows_deps") - -fetch_workflows_deps() 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 2546539..ffe5a0f 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -8,20 +8,3 @@ stardoc_with_diff_test( ) update_docs(name = "update") - -# 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/examples/macro/BUILD.bazel b/examples/macro/BUILD.bazel index 5fabdfb..7a081bd 100644 --- a/examples/macro/BUILD.bazel +++ b/examples/macro/BUILD.bazel @@ -1,5 +1,4 @@ "Uses a macro which calls terser, skipping the custom rule altogether" -# gazelle:exclude *.bzl load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains") load("@npm//:terser/package_json.bzl", "bin") diff --git a/terser/private/BUILD.bazel b/terser/private/BUILD.bazel index 99b1614..aabd123 100644 --- a/terser/private/BUILD.bazel +++ b/terser/private/BUILD.bazel @@ -1,7 +1,5 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -# gazelle:exclude v*.*.*/* - exports_files([ "terser_config.default.json", "runner.cjs",