Skip to content

CI: Automatic PR labelling is back #10201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 8, 2025
Merged

Conversation

VeckoTheGecko
Copy link
Contributor

@VeckoTheGecko VeckoTheGecko commented Apr 4, 2025

Automatic PR labelling was added in #6912, then removed in [#8524, #8525] due to an archived dependency.

This PR fixes #8524. It:

  • restores automatic PR labelling in full
    • labelling all PRs as needs triage
    • labelling PRs as needed based on .github/labeler.yml
  • updates config to latest (v5) version of labeler action
    • The old config looks to be based off something like v3 of the labeler action. According their old README, the migration looks to be just pre-pending changed-files: any-glob-to-any-file: to each glob.

Please validate the labeler.yml config is correct and matches current project structure, or modify as you otherwise see fit.

See open PR on my fork (VeckoTheGecko#3) for an example.

(ps, can someone update the body of GH10198 to point to point to GH9524 not GH8524? Kinda funny that a typo led to this PR 😂)

@VeckoTheGecko
Copy link
Contributor Author

VeckoTheGecko commented Apr 4, 2025

Here's a script for your convenience showing each glob and the files it matches. Just CTRL+F for "no matches"

from pathlib import Path
import yaml

CODEBASE = Path(".")
CONFIG_PATH = CODEBASE / ".github/labeler.yml"
CONFIG = yaml.safe_load(CONFIG_PATH.read_text())
del CONFIG["needs triage"]


def main():
    for topic, label_obj in CONFIG.items():
        globs = label_obj[0]["changed-files"][0]["any-glob-to-any-file"]
        print(f"## {topic}")

        for glob in globs:
            print(f"- glob: {glob}")
            matches = list(CODEBASE.glob(glob))
            for m in matches:
                print(f"  - {m}")
            if len(matches) == 0:
                print("  - no matches")

        print("\n")


if __name__ == "__main__":
    main()
output


## Automation
- glob: .github/**
  - .github
  - .github/workflows
  - .github/ISSUE_TEMPLATE


## CI
- glob: ci/**
  - ci
  - ci/requirements


## dependencies
- glob: ci/requirements/*
  - ci/requirements/environment.yml
  - ci/requirements/environment-windows.yml
  - ci/requirements/min-all-deps.yml
  - ci/requirements/environment-windows-3.14.yml
  - ci/requirements/all-but-numba.yml
  - ci/requirements/environment-3.14.yml
  - ci/requirements/all-but-dask.yml
  - ci/requirements/bare-minimum.yml
  - ci/requirements/doc.yml


## topic-arrays
- glob: xarray/core/duck_array_ops.py
  - xarray/core/duck_array_ops.py


## topic-backends
- glob: xarray/backends/**
  - xarray/backends
  - xarray/backends/__pycache__


## topic-cftime
- glob: xarray/coding/*time*
  - xarray/coding/times.py
  - xarray/coding/cftime_offsets.py
  - xarray/coding/cftimeindex.py


## topic-CF conventions
- glob: xarray/conventions.py
  - xarray/conventions.py


## topic-combine
- glob: xarray/core/combine.py
  - no matches


## topic-dask
- glob: xarray/core/dask*
  - no matches
- glob: xarray/core/parallel.py
  - xarray/core/parallel.py


## topic-DataTree
- glob: xarray/core/datatree*
  - xarray/core/datatree_mapping.py
  - xarray/core/datatree_render.py
  - xarray/core/datatree.py
  - xarray/core/datatree_io.py


## topic-faq
- glob: doc/howdoi.rst
  - doc/howdoi.rst


## topic-groupby
- glob: xarray/core/groupby.py
  - xarray/core/groupby.py


## topic-html-repr
- glob: xarray/core/formatting_html.py
  - xarray/core/formatting_html.py


## topic-hypothesis
- glob: xarray/properties/*
  - no matches
- glob: xarray/testing/strategies/*
  - no matches


## topic-indexing
- glob: xarray/core/indexes.py
  - xarray/core/indexes.py
- glob: xarray/core/indexing.py
  - xarray/core/indexing.py


## topic-NamedArray
- glob: xarray/namedarray/*
  - xarray/namedarray/_typing.py
  - xarray/namedarray/_aggregations.py
  - xarray/namedarray/_array_api.py
  - xarray/namedarray/__init__.py
  - xarray/namedarray/core.py
  - xarray/namedarray/dtypes.py
  - xarray/namedarray/__pycache__
  - xarray/namedarray/parallelcompat.py
  - xarray/namedarray/utils.py
  - xarray/namedarray/pycompat.py
  - xarray/namedarray/daskmanager.py


## topic-performance
- glob: asv_bench/benchmarks/**
  - asv_bench/benchmarks


## topic-plotting
- glob: xarray/plot/*
  - xarray/plot/accessor.py
  - xarray/plot/__init__.py
  - xarray/plot/dataarray_plot.py
  - xarray/plot/utils.py
  - xarray/plot/facetgrid.py
  - xarray/plot/dataset_plot.py
- glob: xarray/plot/**/*
  - xarray/plot/accessor.py
  - xarray/plot/__init__.py
  - xarray/plot/dataarray_plot.py
  - xarray/plot/utils.py
  - xarray/plot/facetgrid.py
  - xarray/plot/dataset_plot.py


## topic-rolling
- glob: xarray/core/rolling.py
  - no matches
- glob: xarray/core/rolling_exp.py
  - no matches


## topic-testing
- glob: conftest.py
  - conftest.py
- glob: xarray/testing.py
  - no matches
- glob: xarray/testing/*
  - xarray/testing/strategies.py
  - xarray/testing/__init__.py
  - xarray/testing/__pycache__
  - xarray/testing/assertions.py


## topic-typing
- glob: xarray/core/types.py
  - xarray/core/types.py


## topic-zarr
- glob: xarray/backends/zarr.py
  - xarray/backends/zarr.py


## io
- glob: xarray/backends/**
  - xarray/backends
  - xarray/backends/__pycache__




@VeckoTheGecko
Copy link
Contributor Author

pinging @TomNicholas since you submitted the prior issues/PRs on this topic. Feel free to review if you have a moment :)

@max-sixty
Copy link
Collaborator

this looks good!

I would recommend we slim down the categories a bit — easy to add more if we need, harder to prune

I think the standard could be "would someone reasonable want to subscribe to one of the labels", for example I would like to immediately look at any issues with Rolling...

@max-sixty max-sixty added the plan to merge Final call for comments label Apr 8, 2025
@max-sixty
Copy link
Collaborator

lgtm — any feedback from anyone before merging?

Copy link
Member

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

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

This is great - I've missed this bot - thanks @VeckoTheGecko !

@TomNicholas TomNicholas added the CI Continuous Integration tools label Apr 8, 2025
@max-sixty max-sixty merged commit dd446d7 into pydata:main Apr 8, 2025
43 checks passed
@VeckoTheGecko VeckoTheGecko deleted the auto-pr-label branch April 8, 2025 16:09
Mikejmnez pushed a commit to Mikejmnez/xarray that referenced this pull request Apr 12, 2025
* Revert "Remove PR labeler bot (pydata#8525)"

This reverts commit ce1af97.

* Remove redundant globs

There was some duplication here as `**` would capture `*` etc

* Update actions/labeler to v5

* Label all PRs as "needs triage"

* Try my best to update config to match current structure

* patch needs triage regex

* run pre-commit

* Update labeler.yml to match current project structure

* pr feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration tools plan to merge Final call for comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PR labeler bot broken and possibly dead
3 participants