Skip to content

*: use default commit author in bazel update workflow#67000

Merged
ti-chi-bot[bot] merged 15 commits into
pingcap:masterfrom
hawkingrei:chore/auto-update-bazel-workflow
Mar 16, 2026
Merged

*: use default commit author in bazel update workflow#67000
ti-chi-bot[bot] merged 15 commits into
pingcap:masterfrom
hawkingrei:chore/auto-update-bazel-workflow

Conversation

@hawkingrei
Copy link
Copy Markdown
Member

@hawkingrei hawkingrei commented Mar 13, 2026

What problem does this PR solve?

Issue Number: ref #66999

Problem Summary:

The Bazel auto-update workflow redundantly hard-codes the commit author fields even though stefanzweifel/git-auto-commit-action already provides a default commit identity.

What changed and how does it work?

This PR removes the explicit commit_author, commit_user_name, and commit_user_email settings from .github/workflows/update-bazel-files.yml and lets the auto-commit action use its default author configuration.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Manual test steps:

  1. Inspect the workflow diff in .github/workflows/update-bazel-files.yml.
  2. Validate the workflow YAML parses successfully.
  3. Confirm there are no whitespace or formatting issues in the workflow diff.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Summary by CodeRabbit

  • Chores
    • Updated build system infrastructure to enhance efficiency and maintainability of the project.
    • Streamlined dependency sources to improve build reliability and performance by consolidating mirror configurations.

@ti-chi-bot ti-chi-bot Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Mar 13, 2026
@pantheon-ai
Copy link
Copy Markdown

pantheon-ai Bot commented Mar 13, 2026

Review failed due to infrastructure/execution failure after retries. Please re-trigger review.

ℹ️ Learn more details on Pantheon AI.

@ti-chi-bot ti-chi-bot Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 13, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

📝 Walkthrough

Walkthrough

This PR introduces a GitHub Actions workflow to automatically update Bazel configuration files on pull requests and removes redundant download URLs from the WORKSPACE file, consolidating dependencies to essential mirrors.

Changes

Cohort / File(s) Summary
Bazel Automation Workflow
.github/workflows/update-bazel-files.yml
New workflow triggered on pull requests that checks out code, runs Bazel build preparation steps, cleans DEPS.bzl and WORKSPACE files via sed, and auto-commits resulting changes.
WORKSPACE Dependencies
WORKSPACE
Removed 18 lines of legacy/redundant HTTP download URLs from various http_archive definitions (bazel_skylib, io_bazel_rules_go, bazel_gazelle, rules_cc, rules_python, go_sdk, remote_java_tools, rules_java, toolchains_protoc), retaining only primary mirrors.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • winoros
  • lance6716

Poem

🐰 A workflow springs to life, so neat and swift,
Bazel files dance in the GitHub drift,
Old mirrors fade, redundant URLs gone,
Automatic updates keep the build strong! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: removing explicit commit author configuration from the Bazel update workflow to use the action's default instead.
Description check ✅ Passed The description follows the template structure, includes an issue reference (ref #66999), explains the problem and solution clearly, marks manual testing as performed, and specifies no release note is needed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.7632%. Comparing base (cc8c83b) to head (b01ff4d).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #67000        +/-   ##
================================================
+ Coverage   77.7062%   77.7632%   +0.0570%     
================================================
  Files          2012       1934        -78     
  Lines        550606     542872      -7734     
================================================
- Hits         427855     422155      -5700     
+ Misses       121035     120708       -327     
+ Partials       1716          9      -1707     
Flag Coverage Δ
integration 41.4991% <ø> (-6.6631%) ⬇️
unit 76.8934% <ø> (+0.6181%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 56.7974% <ø> (ø)
parser ∅ <ø> (∅)
br 48.8964% <ø> (-12.0199%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/update-bazel-files.yml (1)

51-55: Darwin branch is dead code on ubuntu-latest.

The workflow runs on ubuntu-latest (line 30), so uname -s will always return Linux. The Darwin branch (lines 51-55) is unreachable and can be removed to reduce maintenance burden.

Simplified version
         run: |
           #!/bin/bash
           unset CI
-          system_name=$(uname -s)
-          if [ "$system_name" == "Darwin" ]; then
-            sed -i '' '/bazel-cache/d' DEPS.bzl
-            sed -i '' '/ats.apps.svc/d' DEPS.bzl
-            sed -i '' '/bazel-cache/d' WORKSPACE
-            sed -i '' '/ats.apps.svc/d' WORKSPACE
-          elif [ "$system_name" == "Linux" ]; then
-            sed -i '/bazel-cache/d' DEPS.bzl
-            sed -i '/ats.apps.svc/d' DEPS.bzl
-            sed -i '/bazel-cache/d' WORKSPACE
-            sed -i '/ats.apps.svc/d' WORKSPACE
-          fi
           make bazel_prepare
+          sed -i '/bazel-cache/d' DEPS.bzl WORKSPACE
+          sed -i '/ats.apps.svc/d' DEPS.bzl WORKSPACE
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-bazel-files.yml around lines 51 - 55, Remove the
unreachable Darwin branch by deleting the conditional block that checks if [
"$system_name" == "Darwin" ] and its four sed -i '' commands (the lines
containing sed -i '' '/bazel-cache/d' DEPS.bzl, sed -i '' '/ats.apps.svc/d'
DEPS.bzl, sed -i '' '/bazel-cache/d' WORKSPACE, and sed -i '' '/ats.apps.svc/d'
WORKSPACE); leave the existing Linux branch (sed -i ... without the '' macOS
argument) intact so the workflow running on ubuntu-latest only executes the
applicable sed commands.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/update-bazel-files.yml:
- Around line 6-13: The workflow currently uses pull_request_target and then
checks out and runs PR head code (pull_request_target), which exposes repo
secrets; re-enable the commented conditional guard by adding the if condition
that checks github.event.pull_request.head.repo.full_name == github.repository
|| github.event.pull_request.maintainer_can_modify so the job only runs for
same-repo PRs or maintainer-modifiable PRs, or alternatively switch the trigger
to pull_request and avoid checking out PR head with repository secrets; ensure
secrets referenced (secrets.BAZELRC, secrets.GCP_SA_KEY,
secrets.BAZEL_PREPARE_PUSH_TOKEN) are only used when the guard passes and the
checkout action does not pull untrusted PR code.
- Around line 47-62: The sed deletions are running before make bazel_prepare and
get overwritten; reorder the steps so the script runs make bazel_prepare first
(invoke make bazel_prepare), then detect the OS (system_name=$(uname -s)) and
apply the OS-specific sed -i commands to DEPS.bzl and WORKSPACE to remove
'bazel-cache' and 'ats.apps.svc'; keep the existing Darwin vs Linux sed flags
and unset CI logic but move the four sed invocations for DEPS.bzl and WORKSPACE
to execute after the make bazel_prepare call.

In `@pkg/util/dummy_bazel_trigger.go`:
- Around line 1-4: Add the standard TiDB Apache 2.0 license header to the top of
pkg/util/dummy_bazel_trigger.go (above package util); copy the exact header text
from an existing file in the same pkg/util/ directory to ensure consistency and
formatting, keeping the rest of the file intact (function DummyBazelTrigger
should remain unchanged).

---

Nitpick comments:
In @.github/workflows/update-bazel-files.yml:
- Around line 51-55: Remove the unreachable Darwin branch by deleting the
conditional block that checks if [ "$system_name" == "Darwin" ] and its four sed
-i '' commands (the lines containing sed -i '' '/bazel-cache/d' DEPS.bzl, sed -i
'' '/ats.apps.svc/d' DEPS.bzl, sed -i '' '/bazel-cache/d' WORKSPACE, and sed -i
'' '/ats.apps.svc/d' WORKSPACE); leave the existing Linux branch (sed -i ...
without the '' macOS argument) intact so the workflow running on ubuntu-latest
only executes the applicable sed commands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dbbc80e0-65df-4ef8-ad3c-ceebce4df476

📥 Commits

Reviewing files that changed from the base of the PR and between b6af20e and cf3bf54.

📒 Files selected for processing (5)
  • .github/workflows/update-bazel-files.yml
  • WORKSPACE
  • pkg/dxf/importinto/conflict_resolution_test.go
  • pkg/util/BUILD.bazel
  • pkg/util/dummy_bazel_trigger.go
💤 Files with no reviewable changes (1)
  • WORKSPACE

Comment thread .github/workflows/update-bazel-files.yml
Comment thread .github/workflows/update-bazel-files.yml
Comment thread pkg/util/dummy_bazel_trigger.go Outdated
@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 13, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.github/workflows/update-bazel-files.yml (1)

40-49: ⚠️ Potential issue | 🟠 Major

sed modifications are still overwritten by make bazel_prepare.

The sed commands (lines 45-48) that remove bazel-cache and ats.apps.svc URLs run before make bazel_prepare (line 49). Since make bazel_prepare regenerates DEPS.bzl from go.mod, these sed modifications will be overwritten.

Move make bazel_prepare to run before the sed commands:

Proposed fix
       - name: Run Bazel Prepare
         shell: bash
         run: |
           #!/bin/bash
           unset CI
+          make bazel_prepare
           sed -i '/bazel-cache/d' DEPS.bzl
           sed -i '/ats.apps.svc/d' DEPS.bzl
           sed -i '/bazel-cache/d' WORKSPACE
           sed -i '/ats.apps.svc/d' WORKSPACE
-          make bazel_prepare
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-bazel-files.yml around lines 40 - 49, The sed
removals for 'bazel-cache' and 'ats.apps.svc' are executed before make
bazel_prepare so their edits get clobbered; reorder the steps so make
bazel_prepare runs first (invoke make bazel_prepare before running the sed
commands) and then run the sed commands that modify DEPS.bzl and WORKSPACE to
remove those URLs (keep references to the existing sed invocations and the make
bazel_prepare target so you update the same job commands).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/update-bazel-files.yml:
- Around line 40-49: The sed removals for 'bazel-cache' and 'ats.apps.svc' are
executed before make bazel_prepare so their edits get clobbered; reorder the
steps so make bazel_prepare runs first (invoke make bazel_prepare before running
the sed commands) and then run the sed commands that modify DEPS.bzl and
WORKSPACE to remove those URLs (keep references to the existing sed invocations
and the make bazel_prepare target so you update the same job commands).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 51966bc6-e569-4e51-910f-1ef51fa2e8ca

📥 Commits

Reviewing files that changed from the base of the PR and between cf3bf54 and ad25d49.

📒 Files selected for processing (2)
  • .github/workflows/update-bazel-files.yml
  • DEPS.bzl

@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 13, 2026
@ti-chi-bot ti-chi-bot Bot added the approved label Mar 13, 2026
@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 13, 2026
@hawkingrei
Copy link
Copy Markdown
Member Author

/hold

Let us merge this pr on monday.

@ti-chi-bot ti-chi-bot Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 13, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, lance6716

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 13, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 13, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-03-13 13:01:55.430922899 +0000 UTC m=+11572.431696360: ☑️ agreed by lance6716.
  • 2026-03-13 13:34:27.901151289 +0000 UTC m=+13524.901924753: ☑️ agreed by D3Hunter.

@D3Hunter
Copy link
Copy Markdown
Contributor

/retest
/retest

@hawkingrei
Copy link
Copy Markdown
Member Author

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Mar 16, 2026

@hawkingrei: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-build-next-gen b01ff4d link unknown /test pull-build-next-gen

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@hawkingrei
Copy link
Copy Markdown
Member Author

/retest

@ti-chi-bot ti-chi-bot Bot merged commit 987e37f into pingcap:master Mar 16, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants