Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #744

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .aspect/cli/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ configure:
go: false
kotlin: false
protobuf: true
lint:
aspects:
- //tools/lint:linters.bzl%shellcheck
3 changes: 3 additions & 0 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ tasks:
queue: aspect-cli-small-graviton
- configure:
queue: aspect-cli-small-graviton
- lint:
failure_strategy: 'hard'
only_annotate_changed_regions: false
- test:
hooks:
- type: before_task
Expand Down
4 changes: 2 additions & 2 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
BAZELISK_BASE_URL=https://github.com/aspect-build/aspect-cli/releases/download
USE_BAZEL_VERSION=aspect/5.9.32
BAZELISK_BASE_URL=https://static.aspect.build/aspect
USE_BAZEL_VERSION=aspect/2024.37.24
43 changes: 43 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ workflows:
- aw-format:
context: []
workspace: .
- aw-lint:
context: []
workspace: .
- aw-test:
context: []
workspace: .
Expand Down Expand Up @@ -220,6 +223,46 @@ jobs:
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-lint:
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/aspect-cli-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 lint --workspace << parameters.workspace >>
name: Lint
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 >>
Expand Down
6 changes: 6 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Turn on warnings for unquoted variables with safe values
enable=quote-safe-variables
# Turn on warnings for unassigned uppercase variables
enable=check-unassigned-uppercase
# Prefer putting braces around variable references even when not strictly required
enable=require-variable-braces
7 changes: 4 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")

# When generating the documents for this repo bazel needs to be started so that we can generate
# the correct flags. To do this we need version from .bazelversion
exports_files([
# When generating the documents for this repo bazel needs to be started so that we can generate
# the correct flags. To do this we need version from .bazelversion
".bazelversion",
".shellcheckrc",
"LICENSE",
"README.md",
])
Expand Down Expand Up @@ -121,5 +122,5 @@ buildifier(

alias(
name = "format",
actual = "//tools:format",
actual = "//tools/format",
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Overview

The `aspect` CLI is a drop-in replacement for the `bazel` CLI that comes with Bazel.

# Why Aspect CLI
# Why Aspect CLI!

Every organization has a different engineering culture and developer stack.
Bazel was designed for Google's workflows, not yours.
Expand Down Expand Up @@ -42,8 +42,8 @@ Note, if you manually install for MacOS, you can bypass the "Unknown Developer"
In an already-existing Bazel workspace, you can have [bazelisk]
install the Aspect CLI just like it can install the standard Bazel CLI.

>[!NOTE]
>This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.
> [!NOTE]
> This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.

From the [releases page](https://github.com/aspect-build/aspect-cli/releases),
copy the `.bazeliskrc` snippet into your `.bazeliskrc` file to install Aspect for all developers in this repository.
Expand Down
11 changes: 7 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ http_archive(

http_archive(
name = "aspect_rules_lint",
sha256 = "bd5a82b350cf20a662c45d6baa0f301a6a1a81833122e1d68a91a120e33a14dd",
strip_prefix = "rules_lint-37d0160469035e4ea0f1824135cb198cbdcc59e0",
url = "https://github.com/aspect-build/rules_lint/archive/37d0160469035e4ea0f1824135cb198cbdcc59e0.zip",
sha256 = "fe2c8fc9419e5cd31ae63c1b8c3ae643b10a2befe810dcb8d142a7fe9554ec36",
strip_prefix = "rules_lint-1.0.1",
url = "https://github.com/aspect-build/rules_lint/releases/download/v1.0.1/rules_lint-v1.0.1.tar.gz",
)

http_archive(
Expand Down Expand Up @@ -309,7 +309,10 @@ load("@rules_multitool//multitool:multitool.bzl", "multitool")

multitool(
name = "multitool",
lockfile = "@aspect_rules_lint//format:multitool.lock.json",
lockfiles = [
"@aspect_rules_lint//format:multitool.lock.json",
"@aspect_rules_lint//lint:multitool.lock.json",
],
)

load("//.aspect/workflows:deps.bzl", "fetch_workflows_deps")
Expand Down
17 changes: 17 additions & 0 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,20 @@ sh_binary(
srcs = ["update.sh"],
data = ["gen/" + d for d in _DOCS],
)

# 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"]),
)
8 changes: 8 additions & 0 deletions docs/delivery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail

msg="Demostration delivery target"
echo $msg

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellCheck provided a suggestion

Suggested change
echo $msg
echo "${msg}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellCheck provided a suggestion

Suggested change
echo $msg
echo "${msg}"


export FOO="${BAR}"
File renamed without changes.
Empty file added tools/lint/BUILD.bazel
Empty file.
8 changes: 8 additions & 0 deletions tools/lint/linters.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"Create linter aspects, see https://github.com/aspect-build/rules_lint/blob/main/docs/linting.md#installation"

load("@aspect_rules_lint//lint:shellcheck.bzl", "lint_shellcheck_aspect")

shellcheck = lint_shellcheck_aspect(
binary = "@multitool//tools/shellcheck",
config = "@@//:.shellcheckrc",
)
Loading