Skip to content

process: sync commits from Aspect-internal silo#801

Merged
jbedard merged 17 commits intomainfrom
788EA150BB0FAAB4A3FF81F26DCBE189
Jan 22, 2025
Merged

process: sync commits from Aspect-internal silo#801
jbedard merged 17 commits intomainfrom
788EA150BB0FAAB4A3FF81F26DCBE189

Conversation

@jbedard
Copy link
Member

@jbedard jbedard commented Jan 22, 2025

@aspect-workflows
Copy link

aspect-workflows bot commented Jan 22, 2025

Test

105 test targets passed

Targets
//docs/bazelrc:update_aspect_bazelrc_presets_0_test [k8-fastbuild]  309ms
//docs/bazelrc:update_aspect_bazelrc_presets_4_test [k8-fastbuild]  307ms
//gazelle/js/typescript:typescript_test [k8-fastbuild]              262ms
//gazelle/js:declare_module_test [k8-fastbuild]                     151ms
//gazelle/js:declare_module_types_test [k8-fastbuild]               158ms
//gazelle/js:dynamic_import_test [k8-fastbuild]                     149ms
//gazelle/js:gazelle_disable_conflict_test [k8-fastbuild]           101ms
//gazelle/js:gazelle_disable_test [k8-fastbuild]                    162ms
//gazelle/js:gazelle_exclude_directive_test [k8-fastbuild]          183ms
//gazelle/js:gazelle_generation_mode_legacy_test [k8-fastbuild]     58ms
//gazelle/js:gazelle_generation_mode_test [k8-fastbuild]            143ms
//gazelle/js:gazelle_ignore_directive_test [k8-fastbuild]           142ms
//gazelle/js:gazelle_keep_test [k8-fastbuild]                       109ms
//gazelle/js:gazelle_map_kind_directive_test [k8-fastbuild]         177ms
//gazelle/js:groups_add_remove_rules_test [k8-fastbuild]            156ms
//gazelle/js:groups_configs_test [k8-fastbuild]                     175ms
//gazelle/js:groups_deps_test [k8-fastbuild]                        168ms
//gazelle/js:groups_simple_files_test [k8-fastbuild]                169ms
//gazelle/js:ignore_config_files_test [k8-fastbuild]                92ms
//gazelle/js:ignore_import_directive_test [k8-fastbuild]            118ms
//gazelle/js:js_test [k8-fastbuild]                                 77ms
//gazelle/js:node_native_test [k8-fastbuild]                        239ms
//gazelle/js:npm_changed_deps_test [k8-fastbuild]                   117ms
//gazelle/js:npm_link_all_packages_test [k8-fastbuild]              109ms
//gazelle/js:npm_package_deps_lib_test [k8-fastbuild]               382ms
//gazelle/js:npm_package_deps_test [k8-fastbuild]                   172ms
//gazelle/js:npm_package_deps_tsconfig_test [k8-fastbuild]          285ms
//gazelle/js:npm_package_lib_target_name_test [k8-fastbuild]        323ms
//gazelle/js:npm_package_target_enabled_test [k8-fastbuild]         115ms
//gazelle/js:npm_package_target_name_test [k8-fastbuild]            128ms
//gazelle/js:npm_package_target_referenced_test [k8-fastbuild]      126ms
//gazelle/js:npm_simple_deps_test [k8-fastbuild]                    278ms
//gazelle/js:npm_types_package_test [k8-fastbuild]                  148ms
//gazelle/js:parse_errors_test [k8-fastbuild]                       154ms
//gazelle/js:pnpm_project_refs_lock5_test [k8-fastbuild]            118ms
//gazelle/js:pnpm_project_refs_lock6_test [k8-fastbuild]            109ms
//gazelle/js:pnpm_project_refs_lock9_test [k8-fastbuild]            190ms
//gazelle/js:pnpm_workspace_rerooted_test [k8-fastbuild]            160ms
//gazelle/js:pnpm_workspace_test [k8-fastbuild]                     142ms
//gazelle/js:resolve_directive_test [k8-fastbuild]                  111ms
//gazelle/js:resolve_order_test [k8-fastbuild]                      154ms
//gazelle/js:rules_conflicting_name_mapped_kind_test [k8-fastbuild] 34ms
//gazelle/js:rules_conflicting_name_nojs_test [k8-fastbuild]        79ms
//gazelle/js:rules_conflicting_name_test [k8-fastbuild]             45ms
//gazelle/js:simple_dts_only_dep_test [k8-fastbuild]                454ms
//gazelle/js:simple_empty_test [k8-fastbuild]                       98ms
//gazelle/js:simple_extra_files_test [k8-fastbuild]                 227ms
//gazelle/js:simple_file_exts_test [k8-fastbuild]                   271ms
//gazelle/js:simple_file_test [k8-fastbuild]                        165ms
//gazelle/js:simple_globs_keep_test [k8-fastbuild]                  187ms
//gazelle/js:simple_globs_test [k8-fastbuild]                       115ms
//gazelle/js:simple_import_disabled_test [k8-fastbuild]             132ms
//gazelle/js:simple_import_generated_test [k8-fastbuild]            123ms
//gazelle/js:simple_imports_cjs_test [k8-fastbuild]                 242ms
//gazelle/js:simple_imports_dynamic_test [k8-fastbuild]             233ms
//gazelle/js:simple_imports_test [k8-fastbuild]                     155ms
//gazelle/js:simple_json_import_test [k8-fastbuild]                 177ms
//gazelle/js:simple_new_file_test [k8-fastbuild]                    196ms
//gazelle/js:simple_rule_naming_directives_test [k8-fastbuild]      121ms
//gazelle/js:tests_initial_test [k8-fastbuild]                      235ms
//gazelle/js:tests_new_test [k8-fastbuild]                          130ms
//gazelle/js:tests_nolib_test [k8-fastbuild]                        105ms
//gazelle/js:tests_simple_test [k8-fastbuild]                       127ms
//gazelle/js:tests_subdir_test [k8-fastbuild]                       147ms
//gazelle/js:tests_subproject_test [k8-fastbuild]                   197ms
//gazelle/js:ts_proto_library_test [k8-fastbuild]                   143ms
//gazelle/js:tsconfig_attrs_inherited_test [k8-fastbuild]           98ms
//gazelle/js:tsconfig_baseurl_test [k8-fastbuild]                   162ms
//gazelle/js:tsconfig_composite_test [k8-fastbuild]                 79ms
//gazelle/js:tsconfig_custom_file_name_test [k8-fastbuild]          155ms
//gazelle/js:tsconfig_deps_test [k8-fastbuild]                      150ms
//gazelle/js:tsconfig_disabled_manual_test [k8-fastbuild]           80ms
//gazelle/js:tsconfig_incremental_test [k8-fastbuild]               116ms
//gazelle/js:tsconfig_invalid_test [k8-fastbuild]                   81ms
//gazelle/js:tsconfig_jsx_test [k8-fastbuild]                       187ms
//gazelle/js:tsconfig_lax_json_test [k8-fastbuild]                  130ms
//gazelle/js:tsconfig_manual_test [k8-fastbuild]                    57ms
//gazelle/js:tsconfig_nomore_configs_test [k8-fastbuild]            129ms
//gazelle/js:tsconfig_outdir_genfiles_test [k8-fastbuild]           80ms
//gazelle/js:tsconfig_outdir_test [k8-fastbuild]                    142ms
//gazelle/js:tsconfig_paths_test [k8-fastbuild]                     192ms
//gazelle/js:tsconfig_pnpm_ref_rerooted_test [k8-fastbuild]         44ms
//gazelle/js:tsconfig_pnpm_ref_test [k8-fastbuild]                  70ms
//gazelle/js:tsconfig_rootdir_test [k8-fastbuild]                   202ms
//gazelle/js:tsconfig_rootdirs_test [k8-fastbuild]                  170ms
//gazelle/js:tsconfig_tsbuildinfo_test [k8-fastbuild]               79ms
//gazelle/js:tsconfig_tslib_test [k8-fastbuild]                     79ms
//gazelle/js:validate_import_statements_off_test [k8-fastbuild]     185ms
//gazelle/js:validate_import_statements_test [k8-fastbuild]         166ms
//gazelle/js:validate_import_statements_warn_test [k8-fastbuild]    142ms
//gazelle/js:visibility_test [k8-fastbuild]                         227ms
//gazelle/kotlin:simple_empty_maven_test [k8-fastbuild]             36ms
//integration_tests/aspect:configure_test [k8-fastbuild]            47s
//integration_tests/aspect:help_test [k8-fastbuild]                 45s
//integration_tests/aspect:hints_test [k8-fastbuild]                21s
//integration_tests/aspect:info_test [k8-fastbuild]                 20s
//integration_tests/aspect:init_test [k8-fastbuild]                 32s
//integration_tests/aspect:lint_test [k8-fastbuild]                 1m 13s
//integration_tests/aspect:reenter_test [k8-fastbuild]              33s
//integration_tests/aspect:version_test [k8-fastbuild]              20s
+ 5 other targets

Total test execution time was 6m 14s. 114 tests (52.1%) were fully cached saving 15s.


Buildifier      Format

@jbedard jbedard force-pushed the 788EA150BB0FAAB4A3FF81F26DCBE189 branch 2 times, most recently from 894ac73 to 2b91007 Compare January 22, 2025 22:13
gregmagolan and others added 17 commits January 22, 2025 14:18
Bedrock Robotics has the BB CLI enabled and wants to run BB In parallel
with Workflows during the trial. BB CLI has badly formatted output for
the `bazel help flags-as-proto` command which the Aspect CLI makes which
break the base64 decode. This change sanitizes the output of the `help
flags-as-proto` command so that Workflows can handle the BB CLI
configured in a `.bazeliskrc` file.

---

### Changes are visible to end-users: yes

- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes

Workflows now sanitizes the output of `bazel help flags-as-proto` in
order the handle the BuildBuddy CLI configured in a repos `.bazeliskrc`
file (for example `USE_BAZEL_VERSION=buildbuddy-io/5.0.112`).

### Test plan

- Manual testing; please provide instructions so we can reproduce:

Tested with a `.bazeliskrc`:
```
USE_BAZEL_VERSION=buildbuddy-io/5.0.112
```
https://buildkite.com/aspect-build/silo-aws/builds/30559#_
GitOrigin-RevId: e05315c917873baeff904c9ccd550e4b16e51cb6
Found a weird issue in the CLI where if you run this command it fails
silently:
```
bazel build //cli/pro && bazel-bin/cli/pro/pro_/pro outputs ExecutableHash
```

This change allows the error to show up but I do not understand why

---

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases
- New test cases added
- Manual testing; please provide instructions so we can reproduce:

GitOrigin-RevId: ea05475612ecc74bfe0889a4984589713c84d476
Change the npm package resolution to a gazelle `CrossResolver` so other
gazelle languages (such as orion) can resolve npm dependencies.

The first commit just moves code around so the main commit has a simpler
diff.

---

### Changes are visible to end-users: yes

- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes

Support BUILD-generation dependencies on npm packages from other gazelle
languages such as orion.

### Test plan

- Covered by existing test cases
- New test cases added

GitOrigin-RevId: a3779b341711d5bb4ab89fd9ad7f005352e27e64
…(#7716)

I'm pretty sure the `.Fatal` call outputs to stdout in the cli but it
was not shown in stdout of the gazelle tests.

---

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases
- Manual testing; please provide instructions so we can reproduce: run
tests failing due to this error, it should report the stdout

GitOrigin-RevId: 7d55ba711e0f4425214c33ff2f8e47100b8477eb
There is now a marvin specific for skipped targets
as well as an animated one for ongoing builds.

Fixes #7230

---

### Changes are visible to end-users: no

### Test plan

- Manual testing; please provide instructions so we can reproduce:
Posted a gif of the ongoing marvin to slack :)

GitOrigin-RevId: 883121b9c0c17ef2e84bc6246909ef9b9d4c66bd
Our bazel-examples repo doesn't have a WORKSPACE file currently. Patches
bazel-contrib/bazel-gazelle#2013

---

### Changes are visible to end-users: no

### Test plan

- Manual testing; please provide instructions so we can reproduce:

Built the CLI and ran it in `bazel-examples` repo, this error goes away:
```
Error: -repo_root not specified, and WORKSPACE cannot be found: file does not exist
```
GitOrigin-RevId: 389c7cee67922c4d62c956322d94883ec727ae57
This brings the feature that
https://github.com/aspect-build/plugin-augment-error adds to Aspect CLI
and bakes it into the Aspect CLI itself as a "hints" feature configured
in the `.aspect/cli/config.yaml` file via a top-level `hints` attribute
that is a map of regex to hint/suggestion.

For example:
```
hints:
  foo: bar
  bar: fum
```

will produce the following output after the Aspect CLI command is run if
`foo` and `bar` are present in the output:

```
 ------------------------------------------------------------------------------------------
| [Aspect CLI]                                                                             |
|                                                                                          |
| - bar                                                                                    |
| - fum                                                                                    |
 ------------------------------------------------------------------------------------------
```

The reasoning behind hoisting this feature to be a first-class citizen
of the Aspect CLI is that not all of Bazel's output is present in the
ProgressMessage BES event, which the plugin-augment-error, scans. For
some use cases the error is only present in the stdout/stderr of Bazel
which makes it impossible to hint on when using the
plugin-augment-error.

---

- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes

Aspect CLI now supports adding "hints" in the Aspect CLI config file.
This is a map of regex to hint/suggestion that will be displayed when
the regex matches in stdout or stderr of the command.

- Manual testing; please provide instructions so we can reproduce:

Manually tested with locally build Aspect CLI these changes. The
stdout/stderr stream attachment is only made if there are hints
configured so the change is low risk. Will add automated tests in a
follow-up PR.

GitOrigin-RevId: 1e1f8f80986523705b1cd7108b337d231f2960c4
- Fixes multi-line hint formatting
- Strips color codes before regex matching
- Trims leading and trailing whitespace from line

Added a unit test.

---

### Changes are visible to end-users: no

Not yet released so doesn't affect users.

### Test plan

- New test cases added

GitOrigin-RevId: e9f675504761db7f2e945495ddd5561d2c6aca35
Nothing uses it yet, working on a trivial query test.

---

### Changes are visible to end-users: no

### Test plan

- Manual testing; please provide instructions so we can reproduce:
Will add in another commit

GitOrigin-RevId: 88b20590f741f370d39aa0eacef718f7f6be72f9
- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes

Support yaml queries in orion plugins using the yq/jq query language.

- New test cases added

GitOrigin-RevId: 34702afbb6022cbbc19e70da86ead975fa8e1939
…butes (#7803)

Attributes need to be marked as "mergeable" for gazelle to support
things like `# keep` comments on these attributes.

---

### Changes are visible to end-users: yes

- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes

Fix `# keep` directives on tsconfig related attributes with `aspect configure`.

### Test plan

- New test cases added

GitOrigin-RevId: 9d0fa13abe35369fa9bbed1f9958a7b1c0939d40
### Changes are visible to end-users: no

- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 7885b2a69b66841a9831112b447965f7ef8e9cc9
…(#7334)

An opt-in (via env var) POC to show progress, I found it interesting 🤷

---

### Changes are visible to end-users: no

### Test plan

- Manual testing; please provide instructions so we can reproduce: run
the cli with the opt-in var

TODO:
* respect the bazel `--[no]show_progress`
GitOrigin-RevId: c11291c5390f1e94e032c757631981fac764b52c
### Changes are visible to end-users: no

### Test plan

- Manual testing; please provide instructions so we can reproduce:
feature still works, but no longer directly imports golang/x/sys/unix

GitOrigin-RevId: ffaf120902c3bf478cba7bfff9d0ce3af4613be6
…n (#7840)

Found while using rules_jvm tests in a java plugin poc.

---

### Changes are visible to end-users: no

### Test plan

- New test cases added

GitOrigin-RevId: 8a5d4e12ecf1f60e6eb344e996394e8fad5c7568
I can't reproduce it with a real gazelle test, but this index out of
bounds was reported at a client and is an easy fix.

### Changes are visible to end-users: no

### Test plan

- New test cases added

GitOrigin-RevId: e9897a99d13ac7d7b4963d41e2b3e603410e59f5
… (#7843)

All generated js-related rules should persist this so the data (mainly
which source files are in it) doesn't have to be re-computed later.

When this data does not exist (such as rules not generated, or npm
package targets before this fix) then the rule is inspected to find this
which sometimes includes globbing the fs.

Note this exact line exists already for generated `ts_project` or
`js_library` targets, it is just the "package" target here where it was
missing (which might be `npm_package` or `js_library`).

---

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: d9eb92d2924a59edf2c42f9c342a1c9b1873e7c6
@jbedard jbedard force-pushed the 788EA150BB0FAAB4A3FF81F26DCBE189 branch from c7e32af to 455b1a5 Compare January 22, 2025 23:06
@jbedard jbedard requested a review from thesayyn January 22, 2025 23:14
Copy link
Member

@thesayyn thesayyn left a comment

Choose a reason for hiding this comment

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

LGTM, but windows should be fixed.

@jbedard jbedard merged commit a1899c2 into main Jan 22, 2025
1 of 2 checks passed
@jbedard jbedard deleted the 788EA150BB0FAAB4A3FF81F26DCBE189 branch January 22, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants