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

process: sync commits from Aspect-internal silo #712

Merged
merged 21 commits into from
Jun 10, 2024

Conversation

mattem and others added 19 commits June 10, 2024 11:12
Upgrade Typescript 🛻

---

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 4e834c729ed4f6941c2ed2c60a58595d45cbb22e
…stead of one call per result (#5599)

Refactor for the lint task

---

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

### Test plan

- Covered by existing test cases

CI

GitOrigin-RevId: cef7d390843a2cb8214c7ed2894f5eee83fa9ccb
Add the starzelle gazelle plugin by default pro cli. Starzelle plugins can be enabled via the `STARZELLE_PLUGINS` env var pointing to a directory of `*.lang.star` plugins.

---

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

### Test plan

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

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 1301b058291548378130a7cbf800759f7acaac4f
### Changes are visible to end-users: no

### Test plan

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

GitOrigin-RevId: 32a3f0d11ea66f30e537534cc2e096fd6eba1614
We nil check `exitCodeFile` and `patchFile` but missed `reportFile`
which can be nil

---

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

### Test plan

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

Run and check the output of the lint task

GitOrigin-RevId: dbb8adf3127ad38f8eff560306213349a21ff98d
For local development and for silo CI it is desirable that the unstamped
build of the Aspect CLI ignores the version of the CLI in the
`.bazeliskrc` file in silo and does not re-enter by default. To override
this behaviour you can set `--aspect:lock_version=false` on an unstamped
cli.

---

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

### Test plan

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

Built stamped and unstamped versions of CLI pro locally and verified
that the unstamped has the version always locked (no re-entrance into
version specified in `.bazeliskrc`)

GitOrigin-RevId: 5831b4485593e9370f294c217f382726e85e4e38
The cli configure code copied from gazelle hasn't been properly kept up
to date the last few gazelle upgrades.

---

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 6676d12da96a1d1010d7d1f92ebcb11fb1db7d22
All the changes in `cli/core/pkg/aspect/configure/*.go` are from syncing
with the latest `bazel_gazelle` v0.37.0.

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 842fa6010fd4ce675b26c45ce145d5a5ea94b85f
I had a case where `runFixUpdate` return `nil, err` and this crashed due
to `stats` being `nil`.

---

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 48c19c4fd248a2effac2f8fa188ec2f417f55065
### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 5bd7069fe8dcd397279083993c19206a2beb3415
…ndles (#5659)

The core bazelbuild-gazel already respects .bazelignore

---

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: e13ae5fc294fb941ab752ad60486a594e525d012
Gazelle recently added utils for cpu + memory profiling to their CLI.
This adds support for those using env vars, the CLI params and public
API have not changed, this is not documented etc.

---

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

### Test plan

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

GitOrigin-RevId: 9583236ba685f779baf678eaa5730c02105302bc
…ISK_BASE_URL= on the environment (#5675)

From Airtable bug report:
https://aspect-build.slack.com/archives/C05S94VJWNM/p1717780481562359?thread_ts=1717777056.588929&cid=C05S94VJWNM

Airtable wants to be able to run,

```
BAZELISK_BASE_URL= USE_BAZEL_VERSION=25cf03c04a743ad6698d5e722f3e9d5c5a019c47 bazel test //...
```

so they can test against nightly versions of Bazel on canary CI but
there is a bug in Bazelisk where an empty env var such as
`BAZELISK_BASE_URL=` does not override/clear the `BAZELISK_BASE_URL`
value in `.bazeliskrc`. This fixes that bug.

I looked upstream in Bazelisk and the way they load the configs and envs
has drifted making it tricker to make this fix. Will not do that at this
point.

---

### 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

Aspect CLI now allows for clearing the `.bazeliskrc` values such as
`BAZELISK_BASE_URL` with the empty env var `BAZELISK_BASE_URL=`.
Previously the empty value from the env was ignored and treated the same
as the `BAZELISK_BASE_URL` key not being present on the env and the
`.bazeliskrc` value would still be used.

### Test plan

<!-- Delete any which do not apply -->

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

Ran
```
BAZELISK_BASE_URL= USE_BAZEL_VERSION=25cf03c04a743ad6698d5e722f3e9d5c5a019c47 bazel-bin/cli/pro/pro_/pro version
```

locally:

```
BAZELISK_BASE_URL= USE_BAZEL_VERSION=25cf03c04a743ad6698d5e722f3e9d5c5a019c47 bazel-bin/cli/pro/pro_/pro version
2024/06/07 10:26:27 Using unreleased version at commit 25cf03c04a743ad6698d5e722f3e9d5c5a019c47
Aspect CLI Pro version: unknown [not built with --stamp]
2024/06/07 10:26:27 Using unreleased version at commit 25cf03c04a743ad6698d5e722f3e9d5c5a019c47
Starting local Bazel server and connecting to it...
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0
```
GitOrigin-RevId: e27563aedb24f14a85ed2072f23c0f995877997d
To prevent allocating arrays just to iterate over them.

---

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 2cbaf6255c5b1496f17ee3546e4812f19f257d1c
A simple alias for now. Docs and things like `# gazelle:` references in
error messages and docs are not updated. Various tests have been changed
to use the alias.

`bazel-gazelle` in both the go.mod and `http_archive` are patched so
this applies to both the `gazelle_binary` and `bazel configure`.

---

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

### Test plan

- Covered by existing test cases
- New test cases added

GitOrigin-RevId: f974173963d5c01fff686a9093ad90d36c5ca581
GitOrigin-RevId: 514ba20025bfd449231a2884638cdf394622b77e
This way gazelle doesn't have to loop over both names every time. If
configured in the root BUILD it will often prevent 1 `fs.Stat` per
directory.

See `build_file_name` at
https://github.com/bazelbuild/bazel-gazelle?tab=readme-ov-file#fix-and-update

---

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

### Test plan

- Covered by existing test cases

GitOrigin-RevId: c7eee0006420233aa9b69bb66681491b7ecfaff1
GitOrigin-RevId: 28581789342b4d9fefde5edac11c3c0da786c4c3
Copy link

aspect-workflows bot commented Jun 10, 2024

Test

103 test targets passed

Targets
//gazelle/bzl:bazel_tools_test [k8-fastbuild]                           760ms
//gazelle/bzl:defaultvisibility_test [k8-fastbuild]                     1s
//gazelle/bzl:empty_test [k8-fastbuild]                                 5s
//gazelle/bzl:external_test [k8-fastbuild]                              167ms
//gazelle/bzl:import_test [k8-fastbuild]                                1s
//gazelle/bzl:multidir_test [k8-fastbuild]                              289ms
//gazelle/bzl:nobuildfiles_test [k8-fastbuild]                          218ms
//gazelle/bzl:private_test [k8-fastbuild]                               351ms
//gazelle/bzl:relative_import_test [k8-fastbuild]                       185ms
//gazelle/bzl:simple_test [k8-fastbuild]                                970ms
//gazelle/bzl:tests_test [k8-fastbuild]                                 722ms
//gazelle/bzl:workspace_name_test [k8-fastbuild]                        184ms
//gazelle/common/git:git_test [k8-fastbuild]                            179ms
//gazelle/common/starlark:starlark_test [k8-fastbuild]                  816ms
//gazelle/js:declare_module_test [k8-fastbuild]                         364ms
//gazelle/js:declare_module_types_test [k8-fastbuild]                   2s
//gazelle/js:dynamic_import_test [k8-fastbuild]                         355ms
//gazelle/js:gazelle_disable_conflict_test [k8-fastbuild]               165ms
//gazelle/js:gazelle_disable_test [k8-fastbuild]                        249ms
//gazelle/js:gazelle_exclude_directive_test [k8-fastbuild]              255ms
//gazelle/js:gazelle_generate_build_test [k8-fastbuild]                 245ms
//gazelle/js:gazelle_ignore_directive_test [k8-fastbuild]               291ms
//gazelle/js:gazelle_keep_test [k8-fastbuild]                           254ms
//gazelle/js:gazelle_map_kind_directive_test [k8-fastbuild]             1s
//gazelle/js:groups_add_remove_rules_test [k8-fastbuild]                311ms
//gazelle/js:groups_configs_test [k8-fastbuild]                         784ms
//gazelle/js:groups_deps_test [k8-fastbuild]                            270ms
//gazelle/js:groups_simple_files_test [k8-fastbuild]                    389ms
//gazelle/js:ignore_config_files_test [k8-fastbuild]                    432ms
//gazelle/js:ignore_import_directive_test [k8-fastbuild]                822ms
//gazelle/js:js_test [k8-fastbuild]                                     428ms
//gazelle/js:node_native_test [k8-fastbuild]                            414ms
//gazelle/js:npm_changed_deps_test [k8-fastbuild]                       608ms
//gazelle/js:npm_link_all_packages_test [k8-fastbuild]                  298ms
//gazelle/js:npm_package_target_name_test [k8-fastbuild]                1s
//gazelle/js:npm_simple_deps_cjs_test [k8-fastbuild]                    1s
//gazelle/js:npm_simple_deps_test [k8-fastbuild]                        4s
//gazelle/js:npm_types_package_test [k8-fastbuild]                      997ms
//gazelle/js:parse_errors_test [k8-fastbuild]                           963ms
//gazelle/js:pnpm_project_refs_lock5_test [k8-fastbuild]                5s
//gazelle/js:pnpm_project_refs_lock6_test [k8-fastbuild]                357ms
//gazelle/js:pnpm_project_refs_lock9_test [k8-fastbuild]                1s
//gazelle/js:pnpm_workspace_rerooted_test [k8-fastbuild]                393ms
//gazelle/js:pnpm_workspace_test [k8-fastbuild]                         679ms
//gazelle/js:resolve_directive_test [k8-fastbuild]                      292ms
//gazelle/js:resolve_order_test [k8-fastbuild]                          456ms
//gazelle/js:rules_conflicting_name_mapped_kind_test [k8-fastbuild]     153ms
//gazelle/js:rules_conflicting_name_nojs_test [k8-fastbuild]            717ms
//gazelle/js:rules_conflicting_name_test [k8-fastbuild]                 237ms
//gazelle/js:rules_ordering_test [k8-fastbuild]                         3s
//gazelle/js:simple_dts_only_dep_test [k8-fastbuild]                    366ms
//gazelle/js:simple_dts_only_test [k8-fastbuild]                        407ms
//gazelle/js:simple_empty_test [k8-fastbuild]                           4s
//gazelle/js:simple_extra_files_test [k8-fastbuild]                     717ms
//gazelle/js:simple_file_exts_test [k8-fastbuild]                       722ms
//gazelle/js:simple_file_test [k8-fastbuild]                            343ms
//gazelle/js:simple_globs_keep_test [k8-fastbuild]                      5s
//gazelle/js:simple_import_disabled_test [k8-fastbuild]                 3s
//gazelle/js:simple_import_generated_test [k8-fastbuild]                721ms
//gazelle/js:simple_imports_cjs_test [k8-fastbuild]                     370ms
//gazelle/js:simple_imports_dynamic_test [k8-fastbuild]                 332ms
//gazelle/js:simple_imports_test [k8-fastbuild]                         322ms
//gazelle/js:simple_json_import_test [k8-fastbuild]                     667ms
//gazelle/js:simple_new_file_test [k8-fastbuild]                        246ms
//gazelle/js:simple_rule_naming_directives_test [k8-fastbuild]          441ms
//gazelle/js:tests_initial_test [k8-fastbuild]                          247ms
//gazelle/js:tests_nolib_test [k8-fastbuild]                            303ms
//gazelle/js:tests_simple_test [k8-fastbuild]                           242ms
//gazelle/js:tests_subdir_test [k8-fastbuild]                           256ms
//gazelle/js:tests_subproject_test [k8-fastbuild]                       291ms
//gazelle/js:ts_proto_library_test [k8-fastbuild]                       242ms
//gazelle/js:tsconfig_baseurl_test [k8-fastbuild]                       247ms
//gazelle/js:tsconfig_deps_test [k8-fastbuild]                          1s
//gazelle/js:tsconfig_invalid_test [k8-fastbuild]                       280ms
//gazelle/js:tsconfig_lax_json_test [k8-fastbuild]                      6s
//gazelle/js:tsconfig_paths_test [k8-fastbuild]                         375ms
//gazelle/js:tsconfig_rootdir_test [k8-fastbuild]                       340ms
//gazelle/js:tsconfig_rootdirs_test [k8-fastbuild]                      1s
//gazelle/js:validate_import_statements_off_test [k8-fastbuild]         6s
//gazelle/js:validate_import_statements_test [k8-fastbuild]             673ms
//gazelle/js:validate_import_statements_warn_test [k8-fastbuild]        453ms
//gazelle/kotlin:bin_test [k8-fastbuild]                                334ms
//gazelle/kotlin:gazelle_disable_conflict_test [k8-fastbuild]           249ms
//gazelle/kotlin:gazelle_disable_test [k8-fastbuild]                    160ms
//gazelle/kotlin:gazelle_exclude_directive_test [k8-fastbuild]          501ms
//gazelle/kotlin:ignore_config_files_test [k8-fastbuild]                1s
//gazelle/kotlin:kotlin_test [k8-fastbuild]                             159ms
//gazelle/kotlin:native_deps_test [k8-fastbuild]                        392ms
//gazelle/kotlin:rules_conflicting_name_mapped_kind_test [k8-fastbuild] 4s
//gazelle/kotlin:rules_conflicting_name_test [k8-fastbuild]             322ms
//gazelle/kotlin:rules_jvm-maven_test [k8-fastbuild]                    619ms
//gazelle/kotlin:simple_file_test [k8-fastbuild]                        676ms
//gazelle/kotlin:unknown_imports_test [k8-fastbuild]                    474ms
//integration_tests/aspect:configure_test [k8-fastbuild]                42s
//integration_tests/aspect:flags_test [k8-fastbuild]                    2m 5s
//integration_tests/aspect:info_test [k8-fastbuild]                     27s
//integration_tests/aspect:init_test [k8-fastbuild]                     54s
//integration_tests/aspect:lint_test [k8-fastbuild]                     1m 8s
//integration_tests/aspect:reenter_test [k8-fastbuild]                  37s
//integration_tests/aspect:version_test [k8-fastbuild]                  40s
+ 3 other targets

Total test execution time was 8m 3s. 93 tests (47.4%) were fully cached saving 34s.


Buildifier      Format

@alexeagle alexeagle force-pushed the D5E6C3085CF669C3102897C2089A5B5C branch from 3ebe8ce to 12e1a9f Compare June 10, 2024 19:41
@alexeagle alexeagle merged commit 407ec81 into main Jun 10, 2024
9 checks passed
@alexeagle alexeagle deleted the D5E6C3085CF669C3102897C2089A5B5C branch June 10, 2024 20:14
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.

5 participants