diff --git a/.aspect/cli/config.yaml b/.aspect/cli/config.yaml new file mode 100644 index 0000000..2acef66 --- /dev/null +++ b/.aspect/cli/config.yaml @@ -0,0 +1,14 @@ +# Configuration of plugins to the Aspect CLI +# See https://docs.aspect.build/v/cli/plugins +plugins: + - name: augment-error + # This file is created by running `bazel build :dev` so that we can easily test local changes. + # Since the bazel-bin folder is in .gitignore, you'll get a warning on the first run. + # Users will install the plugin from a pre-built binary, using the instructions in the release notes. + from: bazel-bin/plugin + # The possible log levels are: TRACE, DEBUG, INFO, WARN, ERROR, OFF. + # NB: to diagnose plugin crashes, use DEBUG + log_level: WARN + properties: + error_mappings: + demo: this message helps our devs understand failures with the string "demo" \ No newline at end of file diff --git a/.aspect/cli/plugins.yaml b/.aspect/cli/plugins.yaml deleted file mode 100644 index d684035..0000000 --- a/.aspect/cli/plugins.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Configuration of plugins to the Aspect CLI -# See https://github.com/aspect-build/aspect-cli/blob/main/docs/help/topics/plugins.md -- name: augment-error - # This file is created by running `bazel build :dev` so that we can easily test local changes. - # Since the bazel-bin folder is in .gitignore, you'll get a warning on the first run. - # Users will install the plugin from a pre-built binary, using the instructions in the release notes. - from: bazel-bin/plugin - # The possible log levels are: TRACE, DEBUG, INFO, WARN, ERROR, OFF. - # NB: to diagnose plugin crashes, use DEBUG - log_level: WARN - properties: - error_mappings: - demo: this message helps our devs understand failures with the string "demo" \ No newline at end of file diff --git a/.github/workflows/release_notes.txt b/.github/workflows/release_notes.txt index 640504f..72fee72 100644 --- a/.github/workflows/release_notes.txt +++ b/.github/workflows/release_notes.txt @@ -1,7 +1,8 @@ -To use this plugin, add it to your `.aspect/cli/plugins.yaml` file like so: +To use this plugin, add it to your `.aspect/cli/config.yaml` file like so: ``` -- name: hello-world - from: github.com/aspect-build/aspect-cli-plugin-template - version: ${GITHUB_REF_NAME} +plugins: + - name: augment-error + from: github.com/aspect-build/plugin-augment-error + version: ${GITHUB_REF_NAME} ``` diff --git a/BUILD.bazel b/BUILD.bazel index 7b93309..b649955 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -43,7 +43,7 @@ go_binary( ) # Copy the plugin to bazel-bin/plugin and checksum it. -# Referenced by the .aspect/cli/plugins.yaml in the `From:` line. +# Referenced by the .aspect/cli/config.yaml in the `From:` line. local_plugin( name = "dev", binary = ":main", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cff716..8d78eed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ First build the plugin from source: % bazel build ... ``` -Note that the `.aspect/cli/plugins.yaml` file has a reference to the path under `bazel-bin` where the plugin binary was just written. +Note that the `.aspect/cli/config.yaml` file has a reference to the path under `bazel-bin` where the plugin binary was just written. On the first build, you'll see a warning printed that the plugin doesn't exist at this path. This is just the development flow for working on plugins; users will reference the plugin's releases which are downloaded for them automatically. diff --git a/README.md b/README.md index e53fe2c..7e34e6f 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,18 @@ It matches on error messages from Bazel, and adds extra information that can hel such as golinks to your internal documentation, tell them that a migration is underway with additional instructions, or whatever you can think of. -Users configure it in an `error_mappings` property in the `.aspect/cli/plugins.yaml` file in their repo. +Users configure it in an `error_mappings` property in the `.aspect/cli/config.yaml` file in their repo. ## Demo With a configuration like: ```yaml -- name: augment-error - properties: - error_mappings: - demo: this message helps our devs understand failures with the string "demo" +plugins: + - name: augment-error + properties: + error_mappings: + demo: this message helps our devs understand failures with the string "demo" ``` This plugin will print the message when the error contains "demo", like the following: diff --git a/release/BUILD.bazel b/release/BUILD.bazel index e821297..4dc7652 100644 --- a/release/BUILD.bazel +++ b/release/BUILD.bazel @@ -4,7 +4,7 @@ load(":release.bzl", "multi_platform_binaries", "release") # Build a plugin for all supported platforms multi_platform_binaries( - # This name will determine what users put in their .aspect/cli/plugins.yaml: + # This name will determine what users put in their .aspect/cli/config.yaml: # - name: augment-error name = "augment-error", embed = ["//:main_lib"],