Skip to content

Scope 'performance' labeler to benchmarked modules#3357

Merged
brendancol merged 2 commits into
xarray-contrib:mainfrom
brendancol:issue-3356
Jun 15, 2026
Merged

Scope 'performance' labeler to benchmarked modules#3357
brendancol merged 2 commits into
xarray-contrib:mainfrom
brendancol:issue-3356

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3356

.github/labeler.yml matched xrspatial/*.py and xrspatial/**/*.py, so nearly every code PR picked up the performance label. That label is a trigger: benchmarks.yml runs the ASV suite whenever a PR carries it, so the benchmark job ran on almost every PR.

  • Scope the performance rule to the eight modules the PR-time benchmark filter actually measures: slope.py, proximity.py, zonal.py, cost_distance.py, focal.py, normalize.py (Rescale/Standardize), diffusion.py, dasymetric.py.
  • Add a comment tying the label to the asv continuous filter in benchmarks.yml so the list stays in sync as benchmarks are added.

Keeping the label (rather than removing it) preserves the on-demand benchmark trigger for the PRs that can move the numbers.

Not a code change, so no backend work (numpy / cupy / dask) applies.

Test plan:

  • yaml.safe_load parses the file and the structure matches the actions/labeler@v5 schema
  • all eight globbed paths exist in the tree

The labeler matched xrspatial/**/*.py, so nearly every code PR got the
'performance' label. That label triggers the ASV benchmark job in
benchmarks.yml, so the benchmarks ran on almost every PR.

Limit the label to the eight modules the PR-time benchmark filter
actually measures (Slope, Proximity, Zonal, CostDistance, Focal,
Rescale/Standardize, Diffusion, Dasymetric).

@brendancol brendancol left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PR Review: Scope 'performance' labeler to benchmarked modules

Config-only change, so the numerical/backend/NaN/dask/cupy sections of the review don't apply. I checked the parts that do: the glob list, the YAML structure, and whether the scoping lines up with what the benchmark job measures.

Blockers

None.

Suggestions

  • The eight modules match the asv continuous filter one-to-one, but the benchmarks also run through shared helpers that aren't in the glob. Focal pulls in convolution.py, Slope pulls in geodesic.py, and most of them touch utils.py. A PR that changes only one of those shifts the benchmark numbers but won't get auto-labeled, so a regression could land without the PR-time benchmark running. Two ways to handle it: add the main shared helpers (convolution.py, geodesic.py) to the glob, or leave the comment as-is and rely on maintainers applying the label by hand for helper-only changes. I'd lean toward the comment route since pulling in utils.py would re-broaden the rule back toward the original problem, but it's worth a deliberate call rather than leaving the gap silent.

Nits

None.

What looks good

  • Keeping the label instead of deleting it preserves the on-demand benchmark trigger, which is the better of the two options the issue raised.
  • The comment ties the glob to the asv filter in benchmarks.yml, so the next person editing benchmarks knows to keep the two in sync.
  • YAML parses and the structure matches the actions/labeler@v5 schema; all eight paths exist in the tree.

Checklist

  • YAML valid and matches actions/labeler@v5 schema
  • Globbed paths all exist
  • Scoping matches the benchmark filter
  • Shared-helper coverage gap (see Suggestions) — intentional tradeoff, flagged for a deliberate decision
  • n/a Algorithm / backends / NaN / dask / docstrings / README — no code or API change

…trib#3356)

Address review: the Focal and Slope benchmarks run through these shared
kernels, so a regression in them should trigger the benchmark job. utils.py
stays out to avoid re-broadening the label.

@brendancol brendancol left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Follow-up review

Re-reviewed after the follow-up commit (5c3dd7e).

The shared-helper coverage gap from the first pass is addressed: convolution.py (drives the Focal benchmarks) and geodesic.py (drives the Slope benchmarks) are now in the glob, so a regression in those kernels triggers the benchmark job. utils.py was deliberately left out and the reasoning is now in the file comment, which is the right call — it's touched by almost every PR and would undo the scoping.

No new findings. YAML still parses, the structure matches the actions/labeler@v5 schema, and all ten paths exist in the tree. No remaining blockers, suggestions, or nits.

@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Jun 15, 2026
@brendancol brendancol removed the performance PR touches performance-sensitive code label Jun 15, 2026
@brendancol

Copy link
Copy Markdown
Contributor Author

Root-cause note while verifying on this PR: the labeler tagged this PR performance even though it only touches .github/labeler.yml. That exposed a second cause beyond the broad glob.

The labeler workflow has no checkout step, so actions/labeler@v5 fetches the config from the base branch via the API and matches it against the PR's changed files. In the old config the test exclusion !xrspatial/tests/** sits inside any-glob-to-any-file, which ORs its patterns. A negated glob matches every file that is not a test file, so any non-test path in the repo — docs, CI, this very file — satisfies it and earns the label. That, on top of xrspatial/**/*.py, is why performance landed on nearly everything.

The new config uses only explicit positive globs and no negation, so a PR is labeled only when it changes one of the listed modules. I removed the stray performance label from this PR.

@brendancol brendancol merged commit b85d89e into xarray-contrib:main Jun 15, 2026
7 checks passed
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.

labeler.yml applies 'performance' to nearly every PR, triggering benchmarks each time

1 participant