Skip to content

Makefile: add command to lint changed files not the whole pkg#66117

Merged
ti-chi-bot[bot] merged 6 commits intopingcap:masterfrom
winoros:lint-changed-only
Feb 7, 2026
Merged

Makefile: add command to lint changed files not the whole pkg#66117
ti-chi-bot[bot] merged 6 commits intopingcap:masterfrom
winoros:lint-changed-only

Conversation

@winoros
Copy link
Member

@winoros winoros commented Feb 6, 2026

What problem does this PR solve?

Issue Number: close #66115

Problem Summary:

What changed and how does it work?

This pr doesn't intend to improve the CI efficiency.
As the first step, it focuses on improving the local workflow for developers and agents.

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.

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

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 6, 2026
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.5074%. Comparing base (85389ef) to head (1925e21).
⚠️ Report is 53 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #66117        +/-   ##
================================================
- Coverage   77.7818%   77.5074%   -0.2745%     
================================================
  Files          2001       1924        -77     
  Lines        545618     541596      -4022     
================================================
- Hits         424392     419777      -4615     
- Misses       119564     121797      +2233     
+ Partials       1662         22      -1640     
Flag Coverage Δ
integration 41.6290% <ø> (-6.5308%) ⬇️
unit 76.7493% <ø> (+0.3357%) ⬆️

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

Components Coverage Δ
dumpling 56.7974% <ø> (ø)
parser ∅ <ø> (∅)
br 48.3315% <ø> (-12.6498%) ⬇️
🚀 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.

@winoros
Copy link
Member Author

winoros commented Feb 6, 2026

As a comparison, in my local env(ryzen 9950x), change some files in optimizer and make sure that bazel clean is executed to clear the build cache:

  • If we run a full compile&nogocheck, it spends 18~19 min to complete
  • If we run the make bazel_lint_changed, it costs 1 min~ to finish.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 6, 2026
@winoros
Copy link
Member Author

winoros commented Feb 6, 2026

/hold for a while

@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 Feb 6, 2026
@hawkingrei
Copy link
Member

/retest

@wjhuang2016
Copy link
Member

This PR adds make bazel_lint_changed, which builds (with nogo) only the Bazel packages detected as changed vs an auto-detected base ref (build/
get_changed_bazel_pkgs.sh + build/detect_base_branch.sh), and updates AGENTS.md to suggest git fetch origin --prune before running it.

Main review concerns (likely correctness/coverage gaps):

  • Uncommitted changes are ignored: build/get_changed_bazel_pkgs.sh#L45 uses git diff --name-only "$BASE_REF...HEAD", so running “before committing” (as suggested in
    AGENTS.md) can yield an empty package set and skip linting.
  • Deletions are ignored: build/get_changed_bazel_pkgs.sh#L47 filters out paths that no longer exist ([ -e "$f" ] || continue), so PRs that only delete or rename
    files can also produce an empty set and skip.
  • Root-level changes likely produce no targets: the upward dirname walk stops at "." (build/get_changed_bazel_pkgs.sh#L49), so changes to root-level files won’t map
    to any //... label; the //:all branch (build/get_changed_bazel_pkgs.sh#L58-L60) is effectively unreachable with the current loop.
  • Base ref auto-detection is brittle/slow in some setups: build/detect_base_branch.sh#L41-L45 only scans refs/remotes/origin/{master,release-,feature/}. This can
    fail or pick the wrong base in common fork setups (origin != upstream), and iterating origin/feature/* may be expensive.

Suggested fixes (implementation up to the author):

  • Include staged/worktree diffs (or update docs to “run after commit” if that’s the intended contract).
  • Don’t drop deleted paths when computing affected packages; ensure deletions still map to a Bazel package or trigger a safe fallback.
  • Handle root-level changes (either map to //:all or fall back to //... when appropriate).
  • Allow overriding the base ref/remote via an env var or argument (e.g. BASE_REF=... or REMOTE=upstream) to make behavior predictable.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, wjhuang2016

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:
  • OWNERS [hawkingrei,wjhuang2016]

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 Feb 6, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 6, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-06 08:36:16.957819067 +0000 UTC m=+1753.263676458: ☑️ agreed by hawkingrei.
  • 2026-02-06 16:07:47.777949626 +0000 UTC m=+24111.745126490: ☑️ agreed by wjhuang2016.

@winoros
Copy link
Member Author

winoros commented Feb 6, 2026

/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 Feb 6, 2026
@winoros
Copy link
Member Author

winoros commented Feb 7, 2026

/retest

@tiprow
Copy link

tiprow bot commented Feb 7, 2026

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

Test name Commit Details Required Rerun command
fast_test_tiprow 1925e21 link true /test fast_test_tiprow
tidb_parser_test 1925e21 link true /test tidb_parser_test

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.

@ti-chi-bot ti-chi-bot bot merged commit d3cabd6 into pingcap:master Feb 7, 2026
28 of 30 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve the way for the nogo static check

3 participants