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

testdata with buildable Go pkg deep below #1433

Merged
merged 1 commit into from
Jan 29, 2023

Conversation

linzhp
Copy link
Contributor

@linzhp linzhp commented Jan 29, 2023

What type of PR is this?
Bug fix

What package or component does this PR mostly affect?
language/go

What does this PR do? Why is it needed?
According to the doc: https://github.com/bazelbuild/bazel-gazelle/blob/22241605ec8c4ef6d11e9adf5f71846cccbb3d2d/language/go/lang.go#L61-L64

However, the current implementation doesn't include directories with buildable packages 2 or more levels down, causing Gazelle to generate data = glob("testdata/**") for such directories.

This PR checks the existence of a directory in golang.goPkgRels, not the value of it to include such case.

Which issues(s) does this PR fix?

Fixes bazel-contrib/rules_go#3431

Other notes for review

@linzhp linzhp merged commit 350e975 into bazel-contrib:master Jan 29, 2023
@linzhp linzhp deleted the testdata branch January 29, 2023 19:48
renovate bot referenced this pull request in cgrindel/bazel-starlib Mar 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_gazelle](https://togithub.com/bazelbuild/bazel-gazelle) |
http_archive | minor | `v0.29.0` -> `v0.30.0` |

---

### Release Notes

<details>
<summary>bazelbuild/bazel-gazelle</summary>

###
[`v0.30.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/tag/v0.30.0)

[Compare
Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.29.0...v0.30.0)

#### What's Changed

- fix: add missing Starlark dependency and introduce `bzl_test` by
[@&#8203;cgrindel](https://togithub.com/cgrindel) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1413](https://togithub.com/bazelbuild/bazel-gazelle/pull/1413)
- Upgrade rules_go and known imports by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1426](https://togithub.com/bazelbuild/bazel-gazelle/pull/1426)
- Regenerate known imports from downgraded go_googleapis by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1429](https://togithub.com/bazelbuild/bazel-gazelle/pull/1429)
- testdata with buildable Go pkg deep below by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1433](https://togithub.com/bazelbuild/bazel-gazelle/pull/1433)
- language/go: add //go:embed all:<pattern> support by
[@&#8203;mbicz](https://togithub.com/mbicz) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1432](https://togithub.com/bazelbuild/bazel-gazelle/pull/1432)
- Fix `go mod download` output expectation for errors by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1442](https://togithub.com/bazelbuild/bazel-gazelle/pull/1442)
- Apply map_kind to existing rules as well as new ones by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1425](https://togithub.com/bazelbuild/bazel-gazelle/pull/1425)
- Ignore symlinks into Bazel output rather than relying on name by
[@&#8203;cpsauer](https://togithub.com/cpsauer) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1384](https://togithub.com/bazelbuild/bazel-gazelle/pull/1384)
- Use `short_path` for `go` in the wrapper by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1446](https://togithub.com/bazelbuild/bazel-gazelle/pull/1446)
- feature: gazelle wrapper allows to pass environment variables by
[@&#8203;manuelnaranjo](https://togithub.com/manuelnaranjo) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1438](https://togithub.com/bazelbuild/bazel-gazelle/pull/1438)
- Update directive documentation by
[@&#8203;moisesvega](https://togithub.com/moisesvega) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1454](https://togithub.com/bazelbuild/bazel-gazelle/pull/1454)
- Update gazelle directive documenmtation. by
[@&#8203;moisesvega](https://togithub.com/moisesvega) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1455](https://togithub.com/bazelbuild/bazel-gazelle/pull/1455)
- Default Visibility extension overwrite on descent (fixes
[#&#8203;1467](https://togithub.com/bazelbuild/bazel-gazelle/issues/1467))
by [@&#8203;dnathe4th](https://togithub.com/dnathe4th) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1472](https://togithub.com/bazelbuild/bazel-gazelle/pull/1472)
- Allow keep to be explained by
[@&#8203;stevebarrau](https://togithub.com/stevebarrau) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1447](https://togithub.com/bazelbuild/bazel-gazelle/pull/1447)
- Respect repo_name in MODULE.bazel for load generation by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1463](https://togithub.com/bazelbuild/bazel-gazelle/pull/1463)
- Add `.ijwb` to `.gitignore` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1478](https://togithub.com/bazelbuild/bazel-gazelle/pull/1478)
- Use spaces instead of tabs in go_repositor_tools_srcs.bzl by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1479](https://togithub.com/bazelbuild/bazel-gazelle/pull/1479)
- Run buildifier by [@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1480](https://togithub.com/bazelbuild/bazel-gazelle/pull/1480)
- bzlmod: Test BCR test module on all platforms by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1481](https://togithub.com/bazelbuild/bazel-gazelle/pull/1481)
- bzlmod: Allow overriding default Go module configuration by
[@&#8203;seh](https://togithub.com/seh) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1456](https://togithub.com/bazelbuild/bazel-gazelle/pull/1456)
- fix(bzlmod): apply go.sum sums after version resolution by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1477](https://togithub.com/bazelbuild/bazel-gazelle/pull/1477)
- fix(bzlmod/go_deps): don't read go.sum for empty go.mod files by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1484](https://togithub.com/bazelbuild/bazel-gazelle/pull/1484)
- feat(bzlmod): support go.mod replace directives by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1450](https://togithub.com/bazelbuild/bazel-gazelle/pull/1450)
- README update mentioning gazelle-haskell-modules by
[@&#8203;kczulko](https://togithub.com/kczulko) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1439](https://togithub.com/bazelbuild/bazel-gazelle/pull/1439)
- Exclude `.ijwb` from repository tools srcs by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1490](https://togithub.com/bazelbuild/bazel-gazelle/pull/1490)
- bzlmod: Fix interaction between replace and implicit upgrade check by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1492](https://togithub.com/bazelbuild/bazel-gazelle/pull/1492)

#### New Contributors

- [@&#8203;darist](https://togithub.com/darist) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1410](https://togithub.com/bazelbuild/bazel-gazelle/pull/1410)
- [@&#8203;mbicz](https://togithub.com/mbicz) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1432](https://togithub.com/bazelbuild/bazel-gazelle/pull/1432)
- [@&#8203;cpsauer](https://togithub.com/cpsauer) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1384](https://togithub.com/bazelbuild/bazel-gazelle/pull/1384)
- [@&#8203;manuelnaranjo](https://togithub.com/manuelnaranjo) made their
first contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1438](https://togithub.com/bazelbuild/bazel-gazelle/pull/1438)
- [@&#8203;moisesvega](https://togithub.com/moisesvega) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1454](https://togithub.com/bazelbuild/bazel-gazelle/pull/1454)
- [@&#8203;stevebarrau](https://togithub.com/stevebarrau) made their
first contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1447](https://togithub.com/bazelbuild/bazel-gazelle/pull/1447)
- [@&#8203;seh](https://togithub.com/seh) made their first contribution
in
[https://github.com/bazelbuild/bazel-gazelle/pull/1456](https://togithub.com/bazelbuild/bazel-gazelle/pull/1456)
- [@&#8203;kczulko](https://togithub.com/kczulko) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1439](https://togithub.com/bazelbuild/bazel-gazelle/pull/1439)

**Full Changelog**:
bazel-contrib/bazel-gazelle@v0.29.0...v0.30.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/cgrindel/bazel-starlib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4yMy4zIiwidXBkYXRlZEluVmVyIjoiMzUuMjMuMyJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in kreempuff/rules_unreal_engine Apr 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_gazelle](https://togithub.com/bazelbuild/bazel-gazelle) |
http_archive | minor | `v0.29.0` -> `v0.30.0` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>bazelbuild/bazel-gazelle</summary>

###
[`v0.30.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/tag/v0.30.0)

[Compare
Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.29.0...v0.30.0)

#### What's Changed

- fix: add missing Starlark dependency and introduce `bzl_test` by
[@&#8203;cgrindel](https://togithub.com/cgrindel) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1413](https://togithub.com/bazelbuild/bazel-gazelle/pull/1413)
- Upgrade rules_go and known imports by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1426](https://togithub.com/bazelbuild/bazel-gazelle/pull/1426)
- Regenerate known imports from downgraded go_googleapis by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1429](https://togithub.com/bazelbuild/bazel-gazelle/pull/1429)
- testdata with buildable Go pkg deep below by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1433](https://togithub.com/bazelbuild/bazel-gazelle/pull/1433)
- language/go: add //go:embed all:<pattern> support by
[@&#8203;mbicz](https://togithub.com/mbicz) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1432](https://togithub.com/bazelbuild/bazel-gazelle/pull/1432)
- Fix `go mod download` output expectation for errors by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1442](https://togithub.com/bazelbuild/bazel-gazelle/pull/1442)
- Apply map_kind to existing rules as well as new ones by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1425](https://togithub.com/bazelbuild/bazel-gazelle/pull/1425)
- Ignore symlinks into Bazel output rather than relying on name by
[@&#8203;cpsauer](https://togithub.com/cpsauer) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1384](https://togithub.com/bazelbuild/bazel-gazelle/pull/1384)
- Use `short_path` for `go` in the wrapper by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1446](https://togithub.com/bazelbuild/bazel-gazelle/pull/1446)
- feature: gazelle wrapper allows to pass environment variables by
[@&#8203;manuelnaranjo](https://togithub.com/manuelnaranjo) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1438](https://togithub.com/bazelbuild/bazel-gazelle/pull/1438)
- Update directive documentation by
[@&#8203;moisesvega](https://togithub.com/moisesvega) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1454](https://togithub.com/bazelbuild/bazel-gazelle/pull/1454)
- Update gazelle directive documenmtation. by
[@&#8203;moisesvega](https://togithub.com/moisesvega) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1455](https://togithub.com/bazelbuild/bazel-gazelle/pull/1455)
- Default Visibility extension overwrite on descent (fixes
[#&#8203;1467](https://togithub.com/bazelbuild/bazel-gazelle/issues/1467))
by [@&#8203;dnathe4th](https://togithub.com/dnathe4th) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1472](https://togithub.com/bazelbuild/bazel-gazelle/pull/1472)
- Allow keep to be explained by
[@&#8203;stevebarrau](https://togithub.com/stevebarrau) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1447](https://togithub.com/bazelbuild/bazel-gazelle/pull/1447)
- Respect repo_name in MODULE.bazel for load generation by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1463](https://togithub.com/bazelbuild/bazel-gazelle/pull/1463)
- Add `.ijwb` to `.gitignore` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1478](https://togithub.com/bazelbuild/bazel-gazelle/pull/1478)
- Use spaces instead of tabs in go_repositor_tools_srcs.bzl by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1479](https://togithub.com/bazelbuild/bazel-gazelle/pull/1479)
- Run buildifier by [@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1480](https://togithub.com/bazelbuild/bazel-gazelle/pull/1480)
- bzlmod: Test BCR test module on all platforms by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1481](https://togithub.com/bazelbuild/bazel-gazelle/pull/1481)
- bzlmod: Allow overriding default Go module configuration by
[@&#8203;seh](https://togithub.com/seh) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1456](https://togithub.com/bazelbuild/bazel-gazelle/pull/1456)
- fix(bzlmod): apply go.sum sums after version resolution by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1477](https://togithub.com/bazelbuild/bazel-gazelle/pull/1477)
- fix(bzlmod/go_deps): don't read go.sum for empty go.mod files by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1484](https://togithub.com/bazelbuild/bazel-gazelle/pull/1484)
- feat(bzlmod): support go.mod replace directives by
[@&#8203;tyler-french](https://togithub.com/tyler-french) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1450](https://togithub.com/bazelbuild/bazel-gazelle/pull/1450)
- README update mentioning gazelle-haskell-modules by
[@&#8203;kczulko](https://togithub.com/kczulko) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1439](https://togithub.com/bazelbuild/bazel-gazelle/pull/1439)
- Exclude `.ijwb` from repository tools srcs by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1490](https://togithub.com/bazelbuild/bazel-gazelle/pull/1490)
- bzlmod: Fix interaction between replace and implicit upgrade check by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[https://github.com/bazelbuild/bazel-gazelle/pull/1492](https://togithub.com/bazelbuild/bazel-gazelle/pull/1492)

#### New Contributors

- [@&#8203;darist](https://togithub.com/darist) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1410](https://togithub.com/bazelbuild/bazel-gazelle/pull/1410)
- [@&#8203;mbicz](https://togithub.com/mbicz) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1432](https://togithub.com/bazelbuild/bazel-gazelle/pull/1432)
- [@&#8203;cpsauer](https://togithub.com/cpsauer) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1384](https://togithub.com/bazelbuild/bazel-gazelle/pull/1384)
- [@&#8203;manuelnaranjo](https://togithub.com/manuelnaranjo) made their
first contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1438](https://togithub.com/bazelbuild/bazel-gazelle/pull/1438)
- [@&#8203;moisesvega](https://togithub.com/moisesvega) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1454](https://togithub.com/bazelbuild/bazel-gazelle/pull/1454)
- [@&#8203;stevebarrau](https://togithub.com/stevebarrau) made their
first contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1447](https://togithub.com/bazelbuild/bazel-gazelle/pull/1447)
- [@&#8203;seh](https://togithub.com/seh) made their first contribution
in
[https://github.com/bazelbuild/bazel-gazelle/pull/1456](https://togithub.com/bazelbuild/bazel-gazelle/pull/1456)
- [@&#8203;kczulko](https://togithub.com/kczulko) made their first
contribution in
[https://github.com/bazelbuild/bazel-gazelle/pull/1439](https://togithub.com/bazelbuild/bazel-gazelle/pull/1439)

**Full Changelog**:
bazel-contrib/bazel-gazelle@v0.29.0...v0.30.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/kreempuff/rules_unreal_engine).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4yMy4zIiwidXBkYXRlZEluVmVyIjoiMzUuNDAuMCJ9-->
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.

golang/x/tools patch has empty glob
2 participants