Skip to content

ci: run the Python suite when .cargo/config.toml or clippy.toml changes - #8985

Open
LuciferYang wants to merge 1 commit into
lance-format:mainfrom
LuciferYang:ci/python-paths-cargo-config
Open

ci: run the Python suite when .cargo/config.toml or clippy.toml changes#8985
LuciferYang wants to merge 1 commit into
lance-format:mainfrom
LuciferYang:ci/python-paths-cargo-config

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

What this changes

.cargo/config.toml and clippy.toml join python.yml's pull_request paths: filter. Two lines, no job changes. Closes #8906.

Why the root .cargo/config.toml reaches the Python builds

Cargo merges configuration up the directory hierarchy, so a build rooted in python/ reads both python/.cargo/config.toml and the repository-root file. Measured, because the interesting part is what happens to a key both files set: with [target.aarch64-apple-darwin] rustflags = ["--cfg", "outer_flag"] in a parent .cargo/config.toml and ["--cfg", "inner_flag"] in the child's, cargo build -v in the child passes both to rustc. Arrays are joined rather than shadowed, so a root-only edit to either rustflags line changes what the Python extension compiles with even though the sibling sets the same key. On top of that, [profile.release-no-lto] and [profile.bench] are defined only in the root file, so the Python builds take them from there outright.

Why clippy.toml as well

python.yml's lint job runs cargo clippy with working-directory: python, and clippy reads an ancestor clippy.toml. Measured the same way: a crate in a subdirectory of a directory holding a clippy.toml with an unknown field fails with error reading Clippy's configuration file: unknown field. The repository has exactly one clippy.toml, at the root, and no python/clippy.toml, so that file is what this job's clippy run uses. Its disallowed-macros entries gate the Rust code behind the Python extension, and editing them currently triggers no Python job.

Test plan

yaml.safe_load parses the file and returns the filter with the two new entries in place.

The trigger itself is not exercisable from inside this pull request: proving the new entries match would take a pull request whose only change is one of those two files. What this one does show is the existing behaviour, since it edits .github/workflows/python.yml, which the filter already lists, so the Python jobs run here.

rust.yml got the same two entries in #8867.

@github-actions github-actions Bot added A-ci CI / build workflows ci Github Action or Test issues labels Sep 4, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The two exact path entries close the demonstrated pull-request trigger gap: changes to the root Cargo configuration that reach Python extension builds, and changes to the root Clippy configuration that affect the Python Rust lint job, will now run the Python workflow. Exact-file matching keeps the added runner cost narrowly scoped.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci CI / build workflows ci Github Action or Test issues K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: python.yml does not run when the root .cargo/config.toml changes

1 participant