Repository navigation
build: resolve Bazel Go deps through GOPROXY (#69503) - #69842
ti-chi-bot wants to merge 1 commit into
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe mirror tool now resolves Go modules through GOPROXY and emits their versions and sums directly into ChangesGOPROXY mirror migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Makefile
participant BazelMirror
participant GOPROXY
Makefile->>BazelMirror: run mirror target
BazelMirror->>GOPROXY: resolve and download Go modules
GOPROXY-->>BazelMirror: return module version and checksum
BazelMirror-->>Makefile: generate DEPS.bzl
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@ti-chi-bot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
cmd/mirror/mirror.go (2)
52-150: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winUnresolved merge/cherry-pick conflict markers left in source — file will not compile.
Lines 53 and 146-149 contain literal
<<<<<<< HEAD/=======/>>>>>>> 6c90f90bea7 (...)markers insideinit(), and the enclosed block still definesformatSubURL,formatGoProxyURL, andgetSha256OfFile(which usesha256/hex) even though the import block for this file was already updated elsewhere to dropcrypto/sha256andencoding/hex. This is invalid Go syntax and/or will fail to build due to missing imports regardless of resolution choice.🐛 Resolve the conflict by keeping only the new deprecated-flag registration
func init() { -<<<<<<< HEAD - flag.BoolVar(&isMirror, "mirror", false, "enable mirror mode") - flag.BoolVar(&isUpload, "upload", false, "enable upload mode") -} - -func formatSubURL(path, version string) string { - return fmt.Sprintf("gomod/%s/%s-%s.zip", path, modulePathToBazelRepoName(path), version) -} -... -func getSha256OfFile(path string) (string, error) { - ... - return hex.EncodeToString(h.Sum(nil)), nil -======= - flag.BoolVar(&isMirror, "mirror", false, "deprecated; ignored") - flag.BoolVar(&isUpload, "upload", false, "deprecated; ignored") ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) + flag.BoolVar(&isMirror, "mirror", false, "deprecated; ignored") + flag.BoolVar(&isUpload, "upload", false, "deprecated; ignored") }Also drop the now-dead
formatSubURL/formatGoProxyURL/getSha256OfFilehelpers if nothing else in the resolved file calls them.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmd/mirror/mirror.go` around lines 52 - 150, Resolve the conflict in init by removing all merge markers and retaining only the deprecated, ignored registrations for isMirror and isUpload. Delete the obsolete formatSubURL, formatGoProxyURL, getSha256OfFile, and related unused fallback helpers if no remaining code references them, leaving imports consistent with the resolved implementation.
372-461: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winSecond unresolved conflict block in
dumpNewDepsBzl— mixes removed mirror/upload logic with the new GOPROXY-based emission.This block still contains
<<<<<<< HEAD/=======/>>>>>>>markers and the HEAD side referencesexistingMirrors,ctx,client,g.Go,uploadFile,needGoProxyFallback, and theformatVPCPrivateURL/formatCDNURL/formatPublicURL/formatVPCPublicURLhelpers — all of which are removed by companion hunks in this same diff (uploadFile deleted at 160-167, getExistingMirrors deleted at 270-280). Resolving this incorrectly, or leaving it as-is, breaks the build.🐛 Resolve to keep only the GOPROXY-based emission path
-<<<<<<< HEAD - expectedVPCPrivateURL := formatVPCPrivateURL(replaced.Path, replaced.Version) - expectedCDNURL := formatCDNURL(replaced.Path, replaced.Version) - expectedPublicURL := formatPublicURL(replaced.Path, replaced.Version) - expectedVPCPublicURL := formatVPCPublicURL(replaced.Path, replaced.Version) - expectedGoProxyURL := formatGoProxyURL(replaced.Path, replaced.Version) -======= -======= ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) fmt.Printf(" importpath = \"%s\",\n", mod.Path) if err := dumpPatchArgsForRepo(repoName); err != nil { return err } -<<<<<<< HEAD - oldMirror, ok := existingMirrors[repoName] - ... (entire mirror/upload branch removed) ... -======= - d, ok := downloaded[replaced.Path] + d, ok := downloaded[replaced.Path] if !ok { return fmt.Errorf("could not find downloaded module for %s@%s", replaced.Path, replaced.Version) -<<<<<<< HEAD } if mod.Replace != nil { fmt.Printf(" replace = \"%s\",\n", replaced.Path) } fmt.Printf(` sum = "%s", version = "%s", `, d.Sum, d.Version) fmt.Println(" )") } return nil }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmd/mirror/mirror.go` around lines 372 - 461, Resolve the conflict in dumpNewDepsBzl by removing all conflict markers and the obsolete mirror reuse/upload branch, including references to existingMirrors, URL-formatting helpers, ctx, client, g.Go, uploadFile, and needGoProxyFallback. Keep the GOPROXY-based path that validates downloaded[replaced.Path], emits replace when applicable, and prints the module’s sum and version before closing the repository block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@DEPS.bzl`:
- Around line 7-24: Resolve all remaining merge-conflict blocks in DEPS.bzl,
including the cc_mvdan_gofumpt go_repository declaration, by removing every
conflict marker and choosing the correct dependency definition. Regenerate or
normalize the affected go_repository entries so DEPS.bzl contains one valid
Starlark declaration per dependency and parses successfully.
In `@go.mod`:
- Around line 69-78: Resolve the merge conflict in go.mod by removing all
conflict markers and retaining only the cherry-picked target versions of
github.com/google/pprof, github.com/google/uuid, and
github.com/gordonklaus/ineffassign. Ensure the resulting module requirements are
valid syntax.
In `@Makefile`:
- Around line 832-838: Resolve the conflict in the bazel_mirror_upload target by
removing all merge-conflict markers and retaining only the deprecation notice
that directs users to make bazel_mirror; remove the obsolete Bazel mirror upload
command.
- Around line 817-826: Resolve the conflict markers in the bazel_mirror target
and keep only the GOPROXY-based Bazel invocation, including the
--norun_validations option. Remove the obsolete --mirror variant and preserve
the existing temporary-file, copy, and cleanup steps.
- Around line 589-593: Resolve the merge conflict in the bazel_prepare target by
removing all conflict markers and retaining only the GOPROXY-based Bazel
invocation using BAZEL_GLOBAL_CONFIG and BAZEL_CMD_CONFIG; discard the stale
--mirror invocation.
---
Outside diff comments:
In `@cmd/mirror/mirror.go`:
- Around line 52-150: Resolve the conflict in init by removing all merge markers
and retaining only the deprecated, ignored registrations for isMirror and
isUpload. Delete the obsolete formatSubURL, formatGoProxyURL, getSha256OfFile,
and related unused fallback helpers if no remaining code references them,
leaving imports consistent with the resolved implementation.
- Around line 372-461: Resolve the conflict in dumpNewDepsBzl by removing all
conflict markers and the obsolete mirror reuse/upload branch, including
references to existingMirrors, URL-formatting helpers, ctx, client, g.Go,
uploadFile, and needGoProxyFallback. Keep the GOPROXY-based path that validates
downloaded[replaced.Path], emits replace when applicable, and prints the
module’s sum and version before closing the repository block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 09ba4287-652a-4618-9707-3c20ea330d3a
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (6)
DEPS.bzlMakefilecmd/mirror/BUILD.bazelcmd/mirror/mirror.gocmd/mirror/skylarkutil.gogo.mod
💤 Files with no reviewable changes (1)
- cmd/mirror/skylarkutil.go
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
cmd/mirror/mirror.go (2)
52-150: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winUnresolved merge/cherry-pick conflict markers left in source — file will not compile.
Lines 53 and 146-149 contain literal
<<<<<<< HEAD/=======/>>>>>>> 6c90f90bea7 (...)markers insideinit(), and the enclosed block still definesformatSubURL,formatGoProxyURL, andgetSha256OfFile(which usesha256/hex) even though the import block for this file was already updated elsewhere to dropcrypto/sha256andencoding/hex. This is invalid Go syntax and/or will fail to build due to missing imports regardless of resolution choice.🐛 Resolve the conflict by keeping only the new deprecated-flag registration
func init() { -<<<<<<< HEAD - flag.BoolVar(&isMirror, "mirror", false, "enable mirror mode") - flag.BoolVar(&isUpload, "upload", false, "enable upload mode") -} - -func formatSubURL(path, version string) string { - return fmt.Sprintf("gomod/%s/%s-%s.zip", path, modulePathToBazelRepoName(path), version) -} -... -func getSha256OfFile(path string) (string, error) { - ... - return hex.EncodeToString(h.Sum(nil)), nil -======= - flag.BoolVar(&isMirror, "mirror", false, "deprecated; ignored") - flag.BoolVar(&isUpload, "upload", false, "deprecated; ignored") ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) + flag.BoolVar(&isMirror, "mirror", false, "deprecated; ignored") + flag.BoolVar(&isUpload, "upload", false, "deprecated; ignored") }Also drop the now-dead
formatSubURL/formatGoProxyURL/getSha256OfFilehelpers if nothing else in the resolved file calls them.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmd/mirror/mirror.go` around lines 52 - 150, Resolve the conflict in init by removing all merge markers and retaining only the deprecated, ignored registrations for isMirror and isUpload. Delete the obsolete formatSubURL, formatGoProxyURL, getSha256OfFile, and related unused fallback helpers if no remaining code references them, leaving imports consistent with the resolved implementation.
372-461: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winSecond unresolved conflict block in
dumpNewDepsBzl— mixes removed mirror/upload logic with the new GOPROXY-based emission.This block still contains
<<<<<<< HEAD/=======/>>>>>>>markers and the HEAD side referencesexistingMirrors,ctx,client,g.Go,uploadFile,needGoProxyFallback, and theformatVPCPrivateURL/formatCDNURL/formatPublicURL/formatVPCPublicURLhelpers — all of which are removed by companion hunks in this same diff (uploadFile deleted at 160-167, getExistingMirrors deleted at 270-280). Resolving this incorrectly, or leaving it as-is, breaks the build.🐛 Resolve to keep only the GOPROXY-based emission path
-<<<<<<< HEAD - expectedVPCPrivateURL := formatVPCPrivateURL(replaced.Path, replaced.Version) - expectedCDNURL := formatCDNURL(replaced.Path, replaced.Version) - expectedPublicURL := formatPublicURL(replaced.Path, replaced.Version) - expectedVPCPublicURL := formatVPCPublicURL(replaced.Path, replaced.Version) - expectedGoProxyURL := formatGoProxyURL(replaced.Path, replaced.Version) -======= -======= ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) fmt.Printf(" importpath = \"%s\",\n", mod.Path) if err := dumpPatchArgsForRepo(repoName); err != nil { return err } -<<<<<<< HEAD - oldMirror, ok := existingMirrors[repoName] - ... (entire mirror/upload branch removed) ... -======= - d, ok := downloaded[replaced.Path] + d, ok := downloaded[replaced.Path] if !ok { return fmt.Errorf("could not find downloaded module for %s@%s", replaced.Path, replaced.Version) -<<<<<<< HEAD } if mod.Replace != nil { fmt.Printf(" replace = \"%s\",\n", replaced.Path) } fmt.Printf(` sum = "%s", version = "%s", `, d.Sum, d.Version) fmt.Println(" )") } return nil }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmd/mirror/mirror.go` around lines 372 - 461, Resolve the conflict in dumpNewDepsBzl by removing all conflict markers and the obsolete mirror reuse/upload branch, including references to existingMirrors, URL-formatting helpers, ctx, client, g.Go, uploadFile, and needGoProxyFallback. Keep the GOPROXY-based path that validates downloaded[replaced.Path], emits replace when applicable, and prints the module’s sum and version before closing the repository block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@DEPS.bzl`:
- Around line 7-24: Resolve all remaining merge-conflict blocks in DEPS.bzl,
including the cc_mvdan_gofumpt go_repository declaration, by removing every
conflict marker and choosing the correct dependency definition. Regenerate or
normalize the affected go_repository entries so DEPS.bzl contains one valid
Starlark declaration per dependency and parses successfully.
In `@go.mod`:
- Around line 69-78: Resolve the merge conflict in go.mod by removing all
conflict markers and retaining only the cherry-picked target versions of
github.com/google/pprof, github.com/google/uuid, and
github.com/gordonklaus/ineffassign. Ensure the resulting module requirements are
valid syntax.
In `@Makefile`:
- Around line 832-838: Resolve the conflict in the bazel_mirror_upload target by
removing all merge-conflict markers and retaining only the deprecation notice
that directs users to make bazel_mirror; remove the obsolete Bazel mirror upload
command.
- Around line 817-826: Resolve the conflict markers in the bazel_mirror target
and keep only the GOPROXY-based Bazel invocation, including the
--norun_validations option. Remove the obsolete --mirror variant and preserve
the existing temporary-file, copy, and cleanup steps.
- Around line 589-593: Resolve the merge conflict in the bazel_prepare target by
removing all conflict markers and retaining only the GOPROXY-based Bazel
invocation using BAZEL_GLOBAL_CONFIG and BAZEL_CMD_CONFIG; discard the stale
--mirror invocation.
---
Outside diff comments:
In `@cmd/mirror/mirror.go`:
- Around line 52-150: Resolve the conflict in init by removing all merge markers
and retaining only the deprecated, ignored registrations for isMirror and
isUpload. Delete the obsolete formatSubURL, formatGoProxyURL, getSha256OfFile,
and related unused fallback helpers if no remaining code references them,
leaving imports consistent with the resolved implementation.
- Around line 372-461: Resolve the conflict in dumpNewDepsBzl by removing all
conflict markers and the obsolete mirror reuse/upload branch, including
references to existingMirrors, URL-formatting helpers, ctx, client, g.Go,
uploadFile, and needGoProxyFallback. Keep the GOPROXY-based path that validates
downloaded[replaced.Path], emits replace when applicable, and prints the
module’s sum and version before closing the repository block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 09ba4287-652a-4618-9707-3c20ea330d3a
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (6)
DEPS.bzlMakefilecmd/mirror/BUILD.bazelcmd/mirror/mirror.gocmd/mirror/skylarkutil.gogo.mod
💤 Files with no reviewable changes (1)
- cmd/mirror/skylarkutil.go
🛑 Comments failed to post (5)
DEPS.bzl (1)
7-24: 🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Confirm the file actually contains literal git conflict markers as committed. rg -n '^(<<<<<<<|=======|>>>>>>>)' DEPS.bzl | head -50 rg -c '^<<<<<<< HEAD' DEPS.bzlRepository: pingcap/tidb
Length of output: 1912
Critical: remove the unresolved cherry-pick conflict markers from
DEPS.bzl.
DEPS.bzlstill contains literal<<<<<<< HEAD,=======, and>>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (#69503))blocks throughout the file, starting here and repeating later. Those markers are invalid Starlark, so Bazel cannot parse this file, and the duplicatedgo_repository()entries on both sides of the conflict need to be regenerated cleanly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@DEPS.bzl` around lines 7 - 24, Resolve all remaining merge-conflict blocks in DEPS.bzl, including the cc_mvdan_gofumpt go_repository declaration, by removing every conflict marker and choosing the correct dependency definition. Regenerate or normalize the affected go_repository entries so DEPS.bzl contains one valid Starlark declaration per dependency and parses successfully.go.mod (1)
69-78: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Unresolved merge conflict markers in
go.mod.Lines 69, 74, and 78 still contain literal
<<<<<<< HEAD/=======/>>>>>>> 6c90f90bea7 (...)markers. Ago.modwith these markers is not valid module syntax and will breakgo build,go mod tidy, and any Bazelgazelle/mirror invocation that parses it.🐛 Resolve to keep only the cherry-picked (target) versions
-<<<<<<< HEAD - github.com/google/pprof v0.0.0-20241001023024-f4c0cfd0cf1d - github.com/google/skylark v0.0.0-20181101142754-a5f7082aabed - github.com/google/uuid v1.6.0 - github.com/gordonklaus/ineffassign v0.1.0 -======= + github.com/google/pprof v0.0.0-20250903194437-c28834ac2320 github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518 github.com/gordonklaus/ineffassign v0.2.0 ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`))📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.github.com/google/pprof v0.0.0-20250903194437-c28834ac2320 github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518 github.com/gordonklaus/ineffassign v0.2.0🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@go.mod` around lines 69 - 78, Resolve the merge conflict in go.mod by removing all conflict markers and retaining only the cherry-picked target versions of github.com/google/pprof, github.com/google/uuid, and github.com/gordonklaus/ineffassign. Ensure the resulting module requirements are valid syntax.Makefile (3)
589-593: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Unresolved merge conflict markers in
bazel_preparetarget.Lines 589, 591, and 593 still contain literal
<<<<<<< HEAD/=======/>>>>>>>markers.makewill treat these as recipe lines and either fail outright or execute the wrong (stale,--mirror-flag) invocation.🐛 Resolve to keep only the GOPROXY-based invocation
$(eval $@TMP_OUT := $(shell mktemp -d -t tidbbzl.XXXXXX)) -<<<<<<< HEAD - bazel run //cmd/mirror -- --mirror> $($@TMP_OUT)/tmp.txt -======= - bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //cmd/mirror > $($@TMP_OUT)/tmp.txt ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) + bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //cmd/mirror > $($@TMP_OUT)/tmp.txt📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //cmd/mirror > $($@TMP_OUT)/tmp.txt🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` around lines 589 - 593, Resolve the merge conflict in the bazel_prepare target by removing all conflict markers and retaining only the GOPROXY-based Bazel invocation using BAZEL_GLOBAL_CONFIG and BAZEL_CMD_CONFIG; discard the stale --mirror invocation.
817-826: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Unresolved merge conflict markers in
bazel_mirrortarget.Lines 820, 822, and 824 still contain literal conflict markers. Static analysis (checkmake) is misinterpreting the raw recipe fragments as separate targets (
"bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //cmd/mirror"at line 821, and the--norun_validationsvariant at line 823) needing.PHONY— a direct symptom of the corrupted Makefile syntax rather than an independent phonydeclared issue.🐛 Resolve to keep only the GOPROXY-based invocation
$(eval $@TMP_OUT := $(shell mktemp -d -t tidbbzl.XXXXXX)) -<<<<<<< HEAD - bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //cmd/mirror:mirror -- --mirror> $($@TMP_OUT)/tmp.txt -======= - bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) --norun_validations //cmd/mirror:mirror > $($@TMP_OUT)/tmp.txt ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) + bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) --norun_validations //cmd/mirror:mirror > $($@TMP_OUT)/tmp.txt📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements..PHONY: bazel_mirror bazel_mirror: $(eval $@TMP_OUT := $(shell mktemp -d -t tidbbzl.XXXXXX)) bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) --norun_validations //cmd/mirror:mirror > $($@TMP_OUT)/tmp.txt cp $($@TMP_OUT)/tmp.txt DEPS.bzl rm -rf $($@TMP_OUT)🧰 Tools
🪛 checkmake (0.3.2)
[warning] 821-821: Target "bazel
$(BAZEL_GLOBAL_CONFIG) run $ (BAZEL_CMD_CONFIG) //cmd/mirror" should be declared PHONY.(phonydeclared)
[warning] 823-823: Target "bazel
$(BAZEL_GLOBAL_CONFIG) run $ (BAZEL_CMD_CONFIG) --norun_validations //cmd/mirror" should be declared PHONY.(phonydeclared)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` around lines 817 - 826, Resolve the conflict markers in the bazel_mirror target and keep only the GOPROXY-based Bazel invocation, including the --norun_validations option. Remove the obsolete --mirror variant and preserve the existing temporary-file, copy, and cleanup steps.Source: Linters/SAST tools
832-838: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Unresolved merge conflict markers in
bazel_mirror_uploadtarget.Lines 834, 836, and 838 still contain literal conflict markers around the target's body.
🐛 Resolve to keep only the deprecation-notice body
.PHONY: bazel_mirror_upload bazel_mirror_upload: -<<<<<<< HEAD - bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //cmd/mirror -- --mirror --upload -======= - `@echo` "bazel_mirror_upload is deprecated; Go modules are resolved through GOPROXY. Run 'make bazel_mirror' to regenerate DEPS.bzl." ->>>>>>> 6c90f90bea7 (build: resolve Bazel Go deps through GOPROXY (`#69503`)) + `@echo` "bazel_mirror_upload is deprecated; Go modules are resolved through GOPROXY. Run 'make bazel_mirror' to regenerate DEPS.bzl."📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements..PHONY: bazel_mirror_upload bazel_mirror_upload: `@echo` "bazel_mirror_upload is deprecated; Go modules are resolved through GOPROXY. Run 'make bazel_mirror' to regenerate DEPS.bzl."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` around lines 832 - 838, Resolve the conflict in the bazel_mirror_upload target by removing all merge-conflict markers and retaining only the deprecation notice that directs users to make bazel_mirror; remove the obsolete Bazel mirror upload command.
This is an automated cherry-pick of #69503
Issue Number: close #69513
Summary
cmd/mirrorto generatego_repositoryentries withsumandversioninstead of mirroredurls,sha256, andstrip_prefixpingcapmirrorGo module upload path and deprecatedbazel_mirror_uploadDEPS.bzlso Bazel Go dependencies are resolved by rules_go through the configured Go module environment, e.g.GOPROXY=...|...,directTest Plan
make tidygo test ./cmd/mirrorPATH=/tmp/tidb-bazel-shim:$PATH make bazel_preparePATH=/tmp/tidb-bazel-shim:$PATH make bazel_mirror_uploadPATH=/tmp/tidb-bazel-shim:$PATH make lintgit -c core.whitespace=-tab-in-indent diff --checkDEPS.bzlhas nopingcapmirror,cache.hawkingrei.com,urls,sha256, orstrip_prefixentries for Go modulesTests
Release note
Summary by CodeRabbit