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

chore(copybara): sync commits from Aspect-internal silo #629

Merged
merged 14 commits into from
Feb 16, 2024

Conversation

alexeagle
Copy link
Member

@alexeagle alexeagle commented Feb 16, 2024

@alexeagle alexeagle force-pushed the 8AEF12339515D0A47D3EA1E9D42A18D8 branch 2 times, most recently from 5463300 to 183962e Compare February 16, 2024 18:19
Updates the proto files used for the BEP, and adds a
`write_source_files` style rule to keep the checked in `.pb.go` files up
to date so the IDE is happier.

Part of #4438

---

### Type of change

- Refactor (a code change that neither fixes a bug or adds a new
feature)

### Test plan

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

CI

GitOrigin-RevId: ba6fb33cf65eef01eb86b841562c1514ec7dda3a
@alexeagle alexeagle force-pushed the 8AEF12339515D0A47D3EA1E9D42A18D8 branch from 2a4c8da to 0002308 Compare February 16, 2024 20:00
alexeagle and others added 12 commits February 16, 2024 12:00
### Type of change

- Chore (any other change that doesn't affect source or test files, such
as configuration)

### Test plan

- Manual testing; please provide instructions so we can reproduce:
`bazel run format`

GitOrigin-RevId: dcedf5dbfacdcb307dba319ba4161dbd88a12e1e
Bumps rules_go to 0.45.1

GitOrigin-RevId: 3bf9916d81550f141db3bf9280594ff1c5018c0f
It can be buggy to not name fields with this type of assignment, as
adding or removing fields on the struct will cause the meaning of this
code to change.

---

### Type of change

- Bug fix (change which fixes an issue)

GitOrigin-RevId: e6099feceac7b6c83726bd6f69ae70abb374bf56
The improper use of `Skip` caused the remaining tests to be skipped.
Fixing the use of `Skip` shows that all these tests are failing
currently, so mark the target as manual until resolved.

`interface{}` is a terrible type.

GitOrigin-RevId: 10aa62b4995bdee615da68bcec16b367f234a22a
Ensure that the go-routine closes over a copy of the loop variable to
avoid it changing during the loop.

---

### Type of change

- Bug fix (change which fixes an issue)

GitOrigin-RevId: 57e4a4427029434001f16a0f9eb39b6dcf4bed02
Ensure the resolver error is logged. There are two issues here, `Warnf`
had no formatting string, and the `nil` check is never `true`, as `err`
from the conditional is no longer in scope.

---

### Type of change

- Bug fix (change which fixes an issue)

---------

Co-authored-by: Jason Bedard <jason@aspect.dev>
GitOrigin-RevId: b7ff188e2d1401ef3b3c62e90acbdfb1caa3f876
This will be useful when Marvin wants to wire up this data to the GitHub
Checks API.

---

### Type of change

- New feature or functionality (change which adds functionality)

### Test plan

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

GitOrigin-RevId: 8317ebeb3291b7f5dc7b23a3d8d907bfb70f5e87
…e (#4467)

This seems to be valid... a reference to a directory as a package. Where
normally such a reference is to a pnpm-workspace project and not just a
directory.

Note that no `npm_package` is generated because the directory is not in
`pnpm-workspace.yaml`, which I think is correct. We can't really create
a `npm_package` if it is not listed in the lockfile as a package etc.

I guess this is more like tsconfig `paths` where we reference something
by an artificial name and have no idea how it will actually work at
runtime.

Fix aspect-build/silo#4320

---

### Type of change

- Bug fix (change which fixes an issue)

### Test plan

- Covered by existing test cases
- New test cases added

GitOrigin-RevId: 99c529e077d317e3e1fbb27e4fc86f31a038035b
For use in new gazelle extensions.

---

### Type of change

- Refactor (a code change that neither fixes a bug or adds a new
feature)

### Test plan

- Covered by existing test cases
- New test cases added

GitOrigin-RevId: 75130d8979843c87af34a1ae93fba63a9818df3c
Copy paste error when copying this test from js and adding a few test
cases.

---

### Type of change

- Refactor (a code change that neither fixes a bug or adds a new
feature)

### Test plan

- Covered by existing test cases

GitOrigin-RevId: ec6b9f44d6b0686e69993c9251c1372490ee0af1
Supports machine-readable output for linting markdown prose

Note, I filed aspect-build/silo#4595 as the
output has the rule "code" jammed with the human-readable message.

---

### Type of change

- Chore (any other change that doesn't affect source or test files, such
as configuration)

### Test plan

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

```
$HOME/Projects/silo/bazel-bin/cli/core/cmd/aspect/aspect_/aspect lint src:md --output=sarif
INFO: Analyzed target //src:md (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
[1 / 1] checking cached actions
{
  "$schema": "http://json.schemastore.org/sarif-2.1.0-rtm.4",
  "runs": [
    {
      "results": [
        {
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "src/README.md",
                  "uriBaseId": "%SRCROOT%"
                },
                "region": {
                  "startColumn": 47,
                  "startLine": 3
                }
              }
            }
          ],
          "message": {
            "text": "Google.We:Try to avoid using first-person plural like 'We'."
          }
        },
        {
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "src/README.md",
                  "uriBaseId": "%SRCROOT%"
                },
                "region": {
                  "startColumn": 54,
                  "startLine": 3
                }
              }
            }
          ],
          "message": {
            "text": "write-good.Weasel:'really' is a weasel word!"
          }
        },
        {
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "src/README.md",
                  "uriBaseId": "%SRCROOT%"
                },
                "region": {
                  "startColumn": 82,
                  "startLine": 3
                }
              }
            }
          ],
          "message": {
            "text": "Vale.Spelling:Did you really mean 'speelling'?"
          }
        }
      ],
      "tool": {
        "driver": {
          "name": "Vale"
        }
      }
    }
  ],
  "version": "2.1.0"
```
GitOrigin-RevId: ed7dbdb7255abce357edebd1118db3029a4976cf
Inspired by #373 with a
re-write + simplication + improvement of the completion logic from the
original.

To enable bash completion:

```
$ brew install bash-completion
$ aspect completion bash > $(brew --prefix)/etc/bash_completion.d/aspect

# add to your .bash_profile:

if [[ -r "$HOMEBREW_PREFIX/etc/profile.d/bash_completion.sh" ]]; then
  . "$HOMEBREW_PREFIX/etc/profile.d/bash_completion.sh"
  echo "bash completion loaded"
fi
```

See https://tecadmin.net/enable-bash-completion-on-macos/ for more info.

Demos:

```
$ aspect <tab><tab>
analyze-profile     (Analyze build profile data)                                         info                (Display runtime info about the bazel server)
aquery              (Query the action graph)                                             init                (Create a new Bazel workspace)
build               (Build the specified targets)                                        license             (Prints the license of this software.)
canonicalize-flags  (Present a list of bazel options in a canonical form)                lint                (Run configured linters over the dependency graph.)
clean               (Remove the output tree)                                             outputs             (Print paths to declared output files)
completion          (Generate the autocompletion script for the specified shell)         print               (Print syntax elements from BUILD files)
config              (Displays details of configurations.)                                query               (Query the dependency graph, ignoring configuration flags)
configure           (Auto-configure Bazel by updating BUILD files)                       run                 (Build a single target and run it with the given arguments)
coverage            (Same as 'test', but also generates a code coverage report.)         shutdown            (Stop the bazel server)
cquery              (Query the dependency graph, honoring configuration flags)           support             (Interactive, human-escalated support for Bazel problems)
docs                (Open documentation in the browser)                                  test                (Build the specified targets and run all test targets among them)
fetch               (Fetch external repositories that are prerequisites to the targets)  version             (Print the versions of Aspect CLI and Bazel)
help
```

```
$ aspect test <tab><tab>
:test        :test2       foo          foo/bar      foo/fum/bar
```

```
$ aspect test foo<tab><tab>
foo           foo/bar       foo/fum/bar   foo:foo       foo:fum/test  foo:test      foo:test2
```

```
$ aspect test foo/<tab><tab>
foo/bar      foo/fum/bar
```

```
$ aspect test //foo<tab><tab>
//foo           //foo/bar       //foo/fum/bar   //foo:foo       //foo:fum/test  //foo:test      //foo:test2
```

```
$ aspect test //foo/<tab><tab>
//foo/bar      //foo/fum/bar
```

```
$ aspect test @//foo<tab><tab>
@//foo           @//foo/bar       @//foo/fum/bar   @//foo:foo       @//foo:fum/test  @//foo:test      @//foo:test2
```

```
$ aspect test @//foo/<tab><tab>
@//foo/bar      @//foo/fum/bar
```

```
$ aspect test @@//foo<tab><tab>
@@//foo           @@//foo/bar       @@//foo/fum/bar   @@//foo:foo       @@//foo:fum/test  @@//foo:test      @@//foo:test2
```

```
$ aspect test @@//foo/<tab><tab>
@@//foo/bar      @@//foo/fum/bar
```

```
$ cd foo
$ aspect test <tab><tab>
:foo       :fum/test  :test      :test2     bar        fum/bar
```

GitOrigin-RevId: 4044b8d8bb34dfad160cb1d4728bf13d10cb3b9c
@alexeagle alexeagle force-pushed the 8AEF12339515D0A47D3EA1E9D42A18D8 branch from 5ff77cd to bf7b3bf Compare February 16, 2024 22:56
@alexeagle alexeagle force-pushed the 8AEF12339515D0A47D3EA1E9D42A18D8 branch from bf7b3bf to c9748a5 Compare February 16, 2024 23:01
@gregmagolan gregmagolan merged commit 2270613 into main Feb 16, 2024
9 checks passed
@gregmagolan gregmagolan deleted the 8AEF12339515D0A47D3EA1E9D42A18D8 branch February 16, 2024 23:08
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.

4 participants